diff options
Diffstat (limited to 'src/widgets/dialogs/qcolordialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qcolordialog.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 4aa680af61..c0bacd553d 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -57,7 +57,9 @@ #include "qpainter.h" #include "qpixmap.h" #include "qpushbutton.h" +#if QT_CONFIG(settings) #include "qsettings.h" +#endif #include "qsharedpointer.h" #include "qstyle.h" #include "qstyleoption.h" @@ -644,7 +646,7 @@ void QColorWell::mouseMoveEvent(QMouseEvent *e) drg->setMimeData(mime); drg->setPixmap(pix); mousePressed = false; - drg->start(); + drg->exec(Qt::CopyAction); } #endif } @@ -840,8 +842,8 @@ void QColorLuminancePicker::paintEvent(QPaintEvent *) p.drawPixmap(1, coff, *pix); const QPalette &g = palette(); qDrawShadePanel(&p, r, g, true); - p.setPen(g.foreground().color()); - p.setBrush(g.foreground()); + p.setPen(g.windowText().color()); + p.setBrush(g.windowText()); QPolygon a; int y = val2y(val); a.setPoints(3, w, y, w+5, y+5, w+5, y-5); @@ -1129,7 +1131,7 @@ void QColorShowLabel::mouseMoveEvent(QMouseEvent *e) drg->setMimeData(mime); drg->setPixmap(pix); mousePressed = false; - drg->start(); + drg->exec(Qt::CopyAction); } #endif } @@ -1177,7 +1179,8 @@ QColorShower::QColorShower(QColorDialog *parent) curQColor = Qt::white; gl = new QGridLayout(this); - gl->setMargin(gl->spacing()); + const int s = gl->spacing(); + gl->setContentsMargins(s, s, s, s); lab = new QColorShowLabel(this); #ifdef QT_SMALL_COLORDIALOG @@ -1805,7 +1808,7 @@ void QColorDialogPrivate::initWidgets() rightLay->addStretch(); cs = new QColorShower(q); - pickLay->setMargin(cs->gl->margin()); + pickLay->setContentsMargins(cs->gl->contentsMargins()); QObject::connect(cs, SIGNAL(newCol(QRgb)), q, SLOT(_q_newColorTypedIn(QRgb))); QObject::connect(cs, SIGNAL(currentColorChanged(QColor)), q, SIGNAL(currentColorChanged(QColor))); @@ -1814,7 +1817,7 @@ void QColorDialogPrivate::initWidgets() #else rightLay->addWidget(cs); if (leftLay) - leftLay->addSpacing(cs->gl->margin()); + leftLay->addSpacing(cs->gl->contentsMargins().right()); #endif buttons = new QDialogButtonBox(q); @@ -1851,7 +1854,7 @@ void QColorDialogPrivate::_q_addCustom() QColorDialogOptions::setCustomColor(nextCust, cs->currentColor()); if (custom) custom->update(); - nextCust = (nextCust+1) % 16; + nextCust = (nextCust+1) % QColorDialogOptions::customColorCount(); } void QColorDialogPrivate::retranslateStrings() @@ -1885,7 +1888,7 @@ bool QColorDialogPrivate::canBeNativeDialog() const } static const Qt::WindowFlags DefaultWindowFlags = - Qt::Dialog | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint + Qt::Dialog | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint; /*! |