Ticket #57577: patch-graphicssystem-via-qtconfig.diff

File patch-graphicssystem-via-qtconfig.diff, 4.4 KB (added by RJVB (René Bertin), 6 years ago)
  • src/gui/kernel/qapplication_mac.mm

    diff --git src/gui/kernel/qapplication_mac.mm src/gui/kernel/qapplication_mac.mm
    index 2a0aad49e1015e1edd3c891ee013e56e5ae44e05..3f40c1dcdc3d307f01ca8dfdee1ef37dee3192c6 100644
    bool QApplicationPrivate::qt_mac_apply_settings() 
    29412941            QTextCodec::setCodecForTr(codec);
    29422942    }
    29432943
     2944    // this can probrably just as well go into the qt_is_gui_used if:
     2945    // Fetch the default graphics system from the settings store.
     2946    const QString defaultGraphicsSystem = settings.value(QLatin1String("DefaultGraphicsSystem")).toString();
     2947    if (! defaultGraphicsSystem.isNull() && ! defaultGraphicsSystem.isEmpty()) {
     2948        QApplication::setGraphicsSystem(defaultGraphicsSystem);
     2949    }
     2950
    29442951    if (qt_is_gui_used) {
    29452952        QString str;
    29462953        QStringList strlist;
  • tools/qtconfig/mainwindow.cpp

    diff --git tools/qtconfig/mainwindow.cpp tools/qtconfig/mainwindow.cpp
    index 1bb6e4eae01fd43d9de41d627677abc8521908d8..e1726fb174c406311bf132d4f6c70ba3016a4c41 100644
    MainWindow::MainWindow() 
    227238    connect(ui->rtlExtensionsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified()));
    228239    connect(ui->inputStyleCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
    229240    connect(ui->inputMethodCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
     241    connect(ui->graphicsSystemCombo, SIGNAL(activated(int)), SLOT(somethingModified()));
    230242    connect(ui->guiStyleCombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString)));
    231243    connect(ui->familySubstitutionCombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString)));
    232244    connect(ui->tunePaletteButton, SIGNAL(clicked()), SLOT(tunePalette()));
    MainWindow::MainWindow() 
    416463    ui->inputMethodCombo->hide();
    417464    ui->inputMethodLabel->hide();
    418465#endif
    419 
     466#ifdef Q_OS_MAC
     467    ui->graphicsSystemCombo->setToolTip(tr("Select the graphicsssystem to be used by default.\n"
     468        "Native: use native CoreGraphics rendering\n"
     469        "Raster: use raster graphics\n"
     470        "OpenGL: use OpenGL (experimental!)\n"
     471        "Raster mode is the preferred default except on Mac OS 10.14 and newer where it causes flickering.\n"
     472        "Use Native rendering on those newer OS versions (or if you experience other graphics glitches)."));
     473    QStringList graphicsSystems;
     474    QString defaultGraphicsSystem = settings.value(QLatin1String("DefaultGraphicsSystem"), QLatin1String("Native")).toString();
     475
     476    graphicsSystems << tr("Native") << tr("Raster") << tr("OpenGL");
     477    ui->graphicsSystemCombo->addItems(graphicsSystems);
     478    ui->graphicsSystemCombo->setCurrentIndex(graphicsSystems.indexOf(QRegExp(defaultGraphicsSystem, Qt::CaseInsensitive)));
     479#else
     480    ui->graphicsSystemLabel->hide();
     481    ui->graphicsSystemCombo->hide();
     482#endif
    420483    ui->fontEmbeddingCheckBox->setChecked(settings.value(QLatin1String("embedFonts"), true)
    421484                                          .toBool());
    422485    fontpaths = settings.value(QLatin1String("fontPath")).toStringList();
    void MainWindow::fileSave() 
    573636#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
    574637        settings.setValue(QLatin1String("DefaultInputMethod"), ui->inputMethodCombo->currentText());
    575638#endif
     639#ifdef Q_OS_MAC
     640        settings.setValue(QLatin1String("DefaultGraphicsSystem"), ui->graphicsSystemCombo->currentText());
     641#endif
    576642
    577643        QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString();
    578644        QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString();
  • tools/qtconfig/mainwindow.ui

    diff --git tools/qtconfig/mainwindow.ui tools/qtconfig/mainwindow.ui
    index 454021ecdf2c00b29b9f2b86a2a68893da57b572..7593f7140b8ad73b1c615439dd4b473e37b3e9a7 100644
     
    901901          </property>
    902902         </widget>
    903903        </item>
     904        <item>
     905         <widget class="QLabel" name="graphicsSystemLabel">
     906          <property name="text">
     907           <string>Default Graphics System:</string>
     908          </property>
     909         </widget>
     910        </item>
     911        <item>
     912         <widget class="QComboBox" name="graphicsSystemCombo">
     913          <property name="currentIndex">
     914           <number>-1</number>
     915          </property>
     916         </widget>
     917        </item>
    904918        <item>
    905919         <spacer>
    906920          <property name="orientation">