Commit cd79dd8f authored by Jan's avatar Jan
Browse files

Backward compatible ifdefs for Qt Version

parent 655ba178
...@@ -316,9 +316,12 @@ void Core::loadPlugins() ...@@ -316,9 +316,12 @@ void Core::loadPlugins()
* Remove static plugins from dynamically loaded list. * Remove static plugins from dynamically loaded list.
*/ */
{ {
QStringList list = QString::fromUtf8(cmake::static_plugins).split("\n"); QStringList list = QString::fromUtf8(cmake::static_plugins).split("\n");
// This warning couöld be fixed when the minimal Qt Version is >= 5.14 #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QSet<QString> staticPlugins = QSet<QString>::fromList(list); QSet<QString> staticPlugins = QSet<QString>(list.begin(),list.end());
#else
QSet<QString> staticPlugins = QSet<QString>::fromList(list);
#endif
for (int i = 0; i < pluginlist.size(); ) { for (int i = 0; i < pluginlist.size(); ) {
const QString bn = QFileInfo(pluginlist[i]).fileName(); const QString bn = QFileInfo(pluginlist[i]).fileName();
if (staticPlugins.contains(bn)) { if (staticPlugins.contains(bn)) {
......
...@@ -504,11 +504,14 @@ void CoreWidget::applicationSnapshotDialog() { ...@@ -504,11 +504,14 @@ void CoreWidget::applicationSnapshotDialog() {
OpenFlipperSettings().setValue("Core/CurrentDir", QFileInfo(newName).absolutePath() ); OpenFlipperSettings().setValue("Core/CurrentDir", QFileInfo(newName).absolutePath() );
snapshotName_ = newName; snapshotName_ = newName;
dialog.hide(); dialog.hide();
QScreen* screen = window()->screen(); #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QPixmap pic = screen->grabWindow( winId() ); QScreen* screen = window()->screen();
QPixmap pic = screen->grabWindow( winId() );
#else
QPixmap pic = QPixmap::grabWindow( winId() );
#endif
QPainter painter (&pic); QPainter painter (&pic);
...@@ -535,8 +538,13 @@ void CoreWidget::applicationSnapshotDialog() { ...@@ -535,8 +538,13 @@ void CoreWidget::applicationSnapshotDialog() {
///Take a snapshot of the whole application ///Take a snapshot of the whole application
void CoreWidget::applicationSnapshot() { void CoreWidget::applicationSnapshot() {
QScreen* screen = window()->screen();
QPixmap pix = screen->grabWindow( winId() ); #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QScreen* screen = window()->screen();
QPixmap pix = screen->grabWindow( winId() );
#else
QPixmap pix = QPixmap::grabWindow( winId() ).
#endif
// Write image asynchronously // Write image asynchronously
QImage* pic = new QImage(pix.toImage()); QImage* pic = new QImage(pix.toImage());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment