diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 79a71599c0a..c08a034d9e3 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -134,6 +134,7 @@ public: signals: void selected(int row, int col); + void currentChanged(int row, int col); protected: virtual void paintCell(QPainter *, int row, int col, const QRect&); @@ -309,6 +310,8 @@ void QWellArray::setCurrent(int row, int col) updateCell(oldRow, oldCol); updateCell(curRow, curCol); + + emit currentChanged(curRow, curCol); } /* @@ -342,6 +345,7 @@ void QWellArray::setSelected(int row, int col) void QWellArray::focusInEvent(QFocusEvent*) { updateCell(curRow, curCol); + emit currentChanged(curRow, curCol); } void QWellArray::setCellBrush(int row, int col, const QBrush &b) @@ -1426,11 +1430,15 @@ void QColorDialogPrivate::_q_newColorTypedIn(QRgb rgb) lp->setCol(h, s, v); } +void QColorDialogPrivate::_q_nextCustom(int r, int c) +{ + nextCust = r + 2 * c; +} + void QColorDialogPrivate::_q_newCustom(int r, int c) { const int i = r + 2 * c; setCurrentColor(QColorDialogOptions::customColor(i)); - nextCust = i; if (standard) standard->setSelected(-1,-1); } @@ -1494,6 +1502,7 @@ void QColorDialogPrivate::init(const QColor &initial) custom->setAcceptDrops(true); q->connect(custom, SIGNAL(selected(int,int)), SLOT(_q_newCustom(int,int))); + q->connect(custom, SIGNAL(currentChanged(int,int)), SLOT(_q_nextCustom(int,int))); lblCustomColors = new QLabel(q); #ifndef QT_NO_SHORTCUT lblCustomColors->setBuddy(custom); diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h index 80a31c42680..f6dc627a055 100644 --- a/src/widgets/dialogs/qcolordialog.h +++ b/src/widgets/dialogs/qcolordialog.h @@ -120,6 +120,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_addCustom()) Q_PRIVATE_SLOT(d_func(), void _q_newHsv(int h, int s, int v)) Q_PRIVATE_SLOT(d_func(), void _q_newColorTypedIn(QRgb rgb)) + Q_PRIVATE_SLOT(d_func(), void _q_nextCustom(int, int)) Q_PRIVATE_SLOT(d_func(), void _q_newCustom(int, int)) Q_PRIVATE_SLOT(d_func(), void _q_newStandard(int, int)) friend class QColorShower; diff --git a/src/widgets/dialogs/qcolordialog_p.h b/src/widgets/dialogs/qcolordialog_p.h index 900b38fc61c..695e95d26c8 100644 --- a/src/widgets/dialogs/qcolordialog_p.h +++ b/src/widgets/dialogs/qcolordialog_p.h @@ -98,6 +98,7 @@ public: void _q_newHsv(int h, int s, int v); void _q_newColorTypedIn(QRgb rgb); + void _q_nextCustom(int, int); void _q_newCustom(int, int); void _q_newStandard(int, int);