From 040a613d618f326f276560bddf720fb04a6fd571 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Jan 2015 11:14:08 +0300 Subject: [PATCH] Method setCurrentColor fixed See:QTBUG-42988 --- src/widgets/dialogs/qcolordialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index b92e1a2..e0413c4 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -1477,8 +1477,8 @@ bool QColorDialogPrivate::selectColor(const QColor &col) const QRgb *match = std::find(standardColors, standardColorsEnd, color); if (match != standardColorsEnd) { const int index = int(match - standardColors); - const int row = index / standardColorRows; - const int column = index % standardColorRows; + const int row = index % standardColorRows; + const int column = index / standardColorRows; _q_newStandard(row, column); standard->setCurrent(row, column); standard->setSelected(row, column); @@ -1493,8 +1493,8 @@ bool QColorDialogPrivate::selectColor(const QColor &col) const QRgb *match = std::find(customColors, customColorsEnd, color); if (match != customColorsEnd) { const int index = int(match - customColors); - const int row = index / customColorRows; - const int column = index % customColorRows; + const int row = index % customColorRows; + const int column = index / customColorRows; _q_newCustom(row, column); custom->setCurrent(row, column); custom->setSelected(row, column); -- 1.9.4.msysgit.2