Utils: Centralize style-related property names as constants

This introduces string constants in Utils::StyleHelper. They are used by
code all over in Qt Creator to tell ManhattanStyle how to paint certain
widgets.

Change-Id: Iecca36103f80084cd5fe93fcb6b18b8fbb3a32bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Alessandro Portale
2023-05-09 13:20:04 +02:00
parent 6865635442
commit 5975657e77
30 changed files with 112 additions and 67 deletions

View File

@@ -25,6 +25,8 @@
#include <texteditor/textdocument.h>
#include <texteditor/texteditoractionhandler.h>
#include <utils/stylehelper.h>
#include <QAction>
#include <QActionGroup>
#include <QComboBox>
@@ -120,7 +122,7 @@ private:
PythonEditorWidget::PythonEditorWidget(QWidget *parent) : TextEditorWidget(parent)
{
auto replButton = new QToolButton(this);
replButton->setProperty("noArrow", true);
replButton->setProperty(StyleHelper::C_NO_ARROW, true);
replButton->setText(Tr::tr("REPL"));
replButton->setPopupMode(QToolButton::InstantPopup);
replButton->setToolTip(Tr::tr("Open interactive Python. Either importing nothing, "
@@ -175,7 +177,7 @@ void PythonEditorWidget::updateInterpretersSelector()
m_interpreters->setMenu(new QMenu(m_interpreters));
m_interpreters->setPopupMode(QToolButton::InstantPopup);
m_interpreters->setToolButtonStyle(Qt::ToolButtonTextOnly);
m_interpreters->setProperty("noArrow", true);
m_interpreters->setProperty(StyleHelper::C_NO_ARROW, true);
}
QMenu *menu = m_interpreters->menu();