diff options
Diffstat (limited to 'src/libs/qmleditorwidgets')
-rw-r--r-- | src/libs/qmleditorwidgets/CMakeLists.txt | 22 | ||||
-rw-r--r-- | src/libs/qmleditorwidgets/colorbox.cpp | 6 | ||||
-rw-r--r-- | src/libs/qmleditorwidgets/contextpanetextwidget.cpp | 5 | ||||
-rw-r--r-- | src/libs/qmleditorwidgets/customcolordialog.cpp | 12 |
4 files changed, 30 insertions, 15 deletions
diff --git a/src/libs/qmleditorwidgets/CMakeLists.txt b/src/libs/qmleditorwidgets/CMakeLists.txt new file mode 100644 index 0000000000..b235601754 --- /dev/null +++ b/src/libs/qmleditorwidgets/CMakeLists.txt @@ -0,0 +1,22 @@ +add_qtc_library(QmlEditorWidgets + DEPENDS qmljs Utils Qt5::Widgets + SOURCES + colorbox.cpp colorbox.h + colorbutton.cpp colorbutton.h + contextpanetext.ui + contextpanetextwidget.cpp contextpanetextwidget.h + contextpanewidget.cpp contextpanewidget.h + contextpanewidgetborderimage.ui + contextpanewidgetimage.cpp contextpanewidgetimage.h contextpanewidgetimage.ui + contextpanewidgetrectangle.cpp contextpanewidgetrectangle.h contextpanewidgetrectangle.ui + customcolordialog.cpp customcolordialog.h + easingpane/easingcontextpane.cpp easingpane/easingcontextpane.h easingpane/easingcontextpane.ui + easingpane/easinggraph.cpp easingpane/easinggraph.h + easingpane/easingpane.qrc + filewidget.cpp filewidget.h + fontsizespinbox.cpp fontsizespinbox.h + gradientline.cpp gradientline.h + huecontrol.cpp huecontrol.h + qmleditorwidgets_global.h + resources.qrc +) diff --git a/src/libs/qmleditorwidgets/colorbox.cpp b/src/libs/qmleditorwidgets/colorbox.cpp index ad8109c27d..b0da2642e2 100644 --- a/src/libs/qmleditorwidgets/colorbox.cpp +++ b/src/libs/qmleditorwidgets/colorbox.cpp @@ -29,12 +29,10 @@ static inline QString properName(const QColor &color) { - QString s; if (color.alpha() == 255) - s.sprintf("#%02x%02x%02x", color.red(), color.green(), color.blue()); + return QString::asprintf("#%02x%02x%02x", color.red(), color.green(), color.blue()); else - s.sprintf("#%02x%02x%02x%02x", color.alpha(), color.red(), color.green(), color.blue()); - return s; + return QString::asprintf("#%02x%02x%02x%02x", color.alpha(), color.red(), color.green(), color.blue()); } static inline QColor properColor(const QString &str) diff --git a/src/libs/qmleditorwidgets/contextpanetextwidget.cpp b/src/libs/qmleditorwidgets/contextpanetextwidget.cpp index bba9bf4d95..70b6c700db 100644 --- a/src/libs/qmleditorwidgets/contextpanetextwidget.cpp +++ b/src/libs/qmleditorwidgets/contextpanetextwidget.cpp @@ -73,8 +73,7 @@ ContextPaneTextWidget::ContextPaneTextWidget(QWidget *parent) : connect(parentContextWidget->colorDialog(), &CustomColorDialog::rejected, this, &ContextPaneTextWidget::onColorDialogCancled); - connect(ui->fontSizeSpinBox, - static_cast<void (QmlEditorWidgets::FontSizeSpinBox::*)(int)>(&QmlEditorWidgets::FontSizeSpinBox::valueChanged), + connect(ui->fontSizeSpinBox, QOverload<int>::of(&QmlEditorWidgets::FontSizeSpinBox::valueChanged), this, &ContextPaneTextWidget::onFontSizeChanged); connect(ui->fontSizeSpinBox, &QmlEditorWidgets::FontSizeSpinBox::formatChanged, this, &ContextPaneTextWidget::onFontFormatChanged); @@ -104,7 +103,7 @@ ContextPaneTextWidget::ContextPaneTextWidget(QWidget *parent) : connect(ui->bottomAlignmentButton, &QToolButton::toggled, this, &ContextPaneTextWidget::onVerticalAlignmentChanged); - connect(ui->styleComboBox, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), + connect(ui->styleComboBox, QOverload<const QString &>::of(&QComboBox::currentIndexChanged), this, &ContextPaneTextWidget::onStyleComboBoxChanged); } diff --git a/src/libs/qmleditorwidgets/customcolordialog.cpp b/src/libs/qmleditorwidgets/customcolordialog.cpp index a99410467f..de603e0ea9 100644 --- a/src/libs/qmleditorwidgets/customcolordialog.cpp +++ b/src/libs/qmleditorwidgets/customcolordialog.cpp @@ -113,17 +113,13 @@ CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent ) resize(sizeHint()); connect(m_colorBox, &ColorBox::colorChanged, this, &CustomColorDialog::onColorBoxChanged); - connect(m_alphaSpinBox, - static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), + connect(m_alphaSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &CustomColorDialog::spinBoxChanged); - connect(m_rSpinBox, - static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), + connect(m_rSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &CustomColorDialog::spinBoxChanged); - connect(m_gSpinBox, - static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), + connect(m_gSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &CustomColorDialog::spinBoxChanged); - connect(m_bSpinBox, - static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), + connect(m_bSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &CustomColorDialog::spinBoxChanged); connect(m_hueControl, &HueControl::hueChanged, this, &CustomColorDialog::onHueChanged); |