Commit cd79dd8f authored by Jan's avatar Jan

Backward compatible ifdefs for Qt Version

parent 655ba178
......@@ -316,9 +316,12 @@ void Core::loadPlugins()
* Remove static plugins from dynamically loaded list.
*/
{
QStringList list = QString::fromUtf8(cmake::static_plugins).split("\n");
// This warning couöld be fixed when the minimal Qt Version is >= 5.14
QSet<QString> staticPlugins = QSet<QString>::fromList(list);
QStringList list = QString::fromUtf8(cmake::static_plugins).split("\n");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
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(); ) {
const QString bn = QFileInfo(pluginlist[i]).fileName();
if (staticPlugins.contains(bn)) {
......
......@@ -504,11 +504,14 @@ void CoreWidget::applicationSnapshotDialog() {
OpenFlipperSettings().setValue("Core/CurrentDir", QFileInfo(newName).absolutePath() );
snapshotName_ = newName;
dialog.hide();
QScreen* screen = window()->screen();
QPixmap pic = screen->grabWindow( winId() );
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QScreen* screen = window()->screen();
QPixmap pic = screen->grabWindow( winId() );
#else
QPixmap pic = QPixmap::grabWindow( winId() );
#endif
QPainter painter (&pic);
......@@ -535,8 +538,13 @@ void CoreWidget::applicationSnapshotDialog() {
///Take a snapshot of the whole application
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
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