diff --git src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication.cpp
index 22da34e0154a5b37566f38c514648a9125ee5771..3efa5433eb2801bed7e2a5f1bcf8ae609ed88d86 100644
|
|
void QApplicationPrivate::construct( |
818 | 818 | |
819 | 819 | qt_is_gui_used = (qt_appType != QApplication::Tty); |
820 | 820 | process_cmdline(); |
821 | | // the environment variable has the lowest precedence of runtime graphicssystem switches |
| 821 | // the environment variable has almost the lowest precedence of runtime graphicssystem switches |
822 | 822 | if (graphics_system_name.isEmpty()) |
823 | 823 | graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM")); |
| 824 | if (graphics_system_name.isEmpty()) { |
| 825 | // Fetch the default graphics system from the settings store if no other setting has been made |
| 826 | QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); |
| 827 | settings.beginGroup(QLatin1String("Qt")); |
| 828 | const QString defaultGraphicsSystem = settings.value(QLatin1String("DefaultGraphicsSystem")).toString(); |
| 829 | if (! defaultGraphicsSystem.isNull() && ! defaultGraphicsSystem.isEmpty()) { |
| 830 | graphics_system_name = defaultGraphicsSystem; |
| 831 | } |
| 832 | } |
| 833 | |
824 | 834 | |
825 | 835 | #if defined(Q_WS_X11) && !defined(QT_NO_EGL) |
826 | 836 | if (graphics_system_name.isEmpty()) { |
diff --git tools/qtconfig/mainwindow.cpp tools/qtconfig/mainwindow.cpp
index 1bb6e4eae01fd43d9de41d627677abc8521908d8..e1726fb174c406311bf132d4f6c70ba3016a4c41 100644
|
|
MainWindow::MainWindow() |
227 | 238 | connect(ui->rtlExtensionsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); |
228 | 239 | connect(ui->inputStyleCombo, SIGNAL(activated(int)), SLOT(somethingModified())); |
229 | 240 | connect(ui->inputMethodCombo, SIGNAL(activated(int)), SLOT(somethingModified())); |
| 241 | connect(ui->graphicsSystemCombo, SIGNAL(activated(int)), SLOT(somethingModified())); |
230 | 242 | connect(ui->guiStyleCombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString))); |
231 | 243 | connect(ui->familySubstitutionCombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString))); |
232 | 244 | connect(ui->tunePaletteButton, SIGNAL(clicked()), SLOT(tunePalette())); |
… |
… |
MainWindow::MainWindow() |
416 | 463 | ui->inputMethodCombo->hide(); |
417 | 464 | ui->inputMethodLabel->hide(); |
418 | 465 | #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("Raster")).toString(); |
| 475 | |
| 476 | graphicsSystems << tr("(unset)") << tr("Native") << tr("Raster") << tr("OpenGL"); |
| 477 | ui->graphicsSystemCombo->addItems(graphicsSystems); |
| 478 | if (!defaultGraphicsSystem.isNull() && !defaultGraphicsSystem.isEmpty()) { |
| 479 | ui->graphicsSystemCombo->setCurrentIndex(graphicsSystems.indexOf(QRegExp(defaultGraphicsSystem, Qt::CaseInsensitive))); |
| 480 | } |
| 481 | #else |
| 482 | ui->graphicsSystemLabel->hide(); |
| 483 | ui->graphicsSystemCombo->hide(); |
| 484 | #endif |
420 | 485 | ui->fontEmbeddingCheckBox->setChecked(settings.value(QLatin1String("embedFonts"), true) |
421 | 486 | .toBool()); |
422 | 487 | fontpaths = settings.value(QLatin1String("fontPath")).toStringList(); |
… |
… |
void MainWindow::fileSave() |
573 | 638 | #if defined(Q_WS_X11) && !defined(QT_NO_XIM) |
574 | 639 | settings.setValue(QLatin1String("DefaultInputMethod"), ui->inputMethodCombo->currentText()); |
575 | 640 | #endif |
| 641 | #ifdef Q_OS_MAC |
| 642 | if (ui->graphicsSystemCombo->currentIndex() > 0) { |
| 643 | settings.setValue(QLatin1String("DefaultGraphicsSystem"), ui->graphicsSystemCombo->currentText()); |
| 644 | } else { |
| 645 | settings.remove(QLatin1String("DefaultGraphicsSystem")); |
| 646 | } |
| 647 | #endif |
576 | 648 | |
577 | 649 | QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString(); |
578 | 650 | QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString(); |
diff --git tools/qtconfig/mainwindow.ui tools/qtconfig/mainwindow.ui
index 454021ecdf2c00b29b9f2b86a2a68893da57b572..7593f7140b8ad73b1c615439dd4b473e37b3e9a7 100644
|
|
|
901 | 901 | </property> |
902 | 902 | </widget> |
903 | 903 | </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> |
904 | 918 | <item> |
905 | 919 | <spacer> |
906 | 920 | <property name="orientation"> |