forked from qt-creator/qt-creator
Update usages of Qt Quick Controls 2 styles
The Default style was renamed to Basic (9219e86aa571d8b2f5da1ec92a461e5add38f57c) and we now default to a platform-specific style (8b534487044dfb3b464431ecb91ef4e0864af4ed) if available. Task-number: QTBUG-85984 Task-number: QTBUG-86403 Change-Id: I66d2188a0c45605abdbbd8c71396b16407166d75 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -160,17 +160,9 @@
|
||||
"type": "ComboBox",
|
||||
"data":
|
||||
{
|
||||
"index": 1,
|
||||
"index": 0,
|
||||
"items":
|
||||
[
|
||||
{
|
||||
"trKey": "Default",
|
||||
"value":
|
||||
{
|
||||
"QtQuickControlsStyle": "Default",
|
||||
"QtQuickControlsStyleTheme": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"trKey": "Material Light",
|
||||
"value":
|
||||
|
@@ -178,17 +178,9 @@
|
||||
"type": "ComboBox",
|
||||
"data":
|
||||
{
|
||||
"index": 1,
|
||||
"index": 0,
|
||||
"items":
|
||||
[
|
||||
{
|
||||
"trKey": "Default",
|
||||
"value":
|
||||
{
|
||||
"QtQuickControlsStyle": "Default",
|
||||
"QtQuickControlsStyleTheme": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"trKey": "Material Light",
|
||||
"value":
|
||||
|
@@ -178,17 +178,9 @@
|
||||
"type": "ComboBox",
|
||||
"data":
|
||||
{
|
||||
"index": 1,
|
||||
"index": 0,
|
||||
"items":
|
||||
[
|
||||
{
|
||||
"trKey": "Default",
|
||||
"value":
|
||||
{
|
||||
"QtQuickControlsStyle": "Default",
|
||||
"QtQuickControlsStyleTheme": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"trKey": "Material Light",
|
||||
"value":
|
||||
|
@@ -64,11 +64,18 @@ QWidget *ChangeStyleWidgetAction::createWidget(QWidget *parent)
|
||||
{
|
||||
auto comboBox = new QComboBox(parent);
|
||||
comboBox->setToolTip(tr(enabledTooltip));
|
||||
// The Default style was renamed to Basic in Qt 6. In Qt 6, "Default"
|
||||
// will result in a platform-specific style being chosen.
|
||||
comboBox->addItem("Basic");
|
||||
comboBox->addItem("Default");
|
||||
comboBox->addItem("Fusion");
|
||||
comboBox->addItem("Imagine");
|
||||
if (Utils::HostOsInfo::isMacHost())
|
||||
comboBox->addItem("macOS");
|
||||
comboBox->addItem("Material");
|
||||
comboBox->addItem("Universal");
|
||||
if (Utils::HostOsInfo::isWindowsHost())
|
||||
comboBox->addItem("Windows");
|
||||
comboBox->setEditable(true);
|
||||
comboBox->setCurrentIndex(0);
|
||||
|
||||
@@ -132,7 +139,7 @@ void ChangeStyleAction::currentContextChanged(const SelectionContext &selectionC
|
||||
|
||||
if (Utils::FilePath::fromString(confFileName).exists()) {
|
||||
QSettings infiFile(confFileName, QSettings::IniFormat);
|
||||
m_action->handleModelUpdate(infiFile.value("Controls/Style", "Default").toString());
|
||||
m_action->handleModelUpdate(infiFile.value("Controls/Style", "Basic").toString());
|
||||
} else {
|
||||
m_action->handleModelUpdate("");
|
||||
}
|
||||
|
@@ -487,7 +487,7 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
|
||||
#else
|
||||
const QString controlsStyle;
|
||||
#endif
|
||||
if (!controlsStyle.isEmpty() && controlsStyle != "Default") {
|
||||
if (!controlsStyle.isEmpty()) {
|
||||
environment.set("QT_QUICK_CONTROLS_STYLE", controlsStyle);
|
||||
environment.set("QT_LABS_CONTROLS_STYLE", controlsStyle);
|
||||
}
|
||||
@@ -498,13 +498,6 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
|
||||
|
||||
const QString styleConfigFileName = getStyleConfigFileName();
|
||||
|
||||
/* QT_QUICK_CONTROLS_CONF is not supported for Qt Version < 5.8.1,
|
||||
* but we can manually at least set the correct style. */
|
||||
if (!styleConfigFileName.isEmpty()) {
|
||||
QSettings infiFile(styleConfigFileName, QSettings::IniFormat);
|
||||
environment.set("QT_QUICK_CONTROLS_STYLE", infiFile.value("Controls/Style", "Default").toString());
|
||||
}
|
||||
|
||||
if (!m_qrcMapping.isEmpty()) {
|
||||
environment.set("QMLDESIGNER_RC_PATHS", m_qrcMapping);
|
||||
}
|
||||
|
Reference in New Issue
Block a user