summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-11-12 18:03:55 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-11-12 18:03:55 (GMT)
commitbc992fd8381697f57c6abb13b5fa17167d98867a (patch)
tree3097634913b46ae0cdd2603e8650d95d489bfea4
parentfbdde19e169975693bd179f3e493f0b588ed39f4 (diff)
parentdf819cfe17f6dfd089096063524932fc4975804f (diff)
downloadQt-bc992fd8381697f57c6abb13b5fa17167d98867a.zip
Qt-bc992fd8381697f57c6abb13b5fa17167d98867a.tar.gz
Qt-bc992fd8381697f57c6abb13b5fa17167d98867a.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fixed wrong QGroupBox check state Added base 10 to be used with QIntValidator. Mac: Fix the color of check marks in menus with stylesheet Russian translation update Don't directly access QList contents Fix QPlainTextEdit when using Qt::TextSelectableByKeyboard flag
-rw-r--r--src/dbus/qdbuspendingcall.cpp9
-rw-r--r--src/gui/styles/qmacstyle_mac.mm10
-rw-r--r--src/gui/text/qtextcontrol.cpp7
-rw-r--r--src/gui/widgets/qgroupbox.cpp4
-rw-r--r--src/gui/widgets/qplaintextedit.cpp2
-rw-r--r--src/gui/widgets/qvalidator.cpp3
-rw-r--r--tests/auto/qgroupbox/tst_qgroupbox.cpp23
-rw-r--r--tests/auto/qintvalidator/tst_qintvalidator.cpp9
-rw-r--r--translations/qt_ru.ts18
9 files changed, 61 insertions, 24 deletions
diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp
index ea84742..2278db4 100644
--- a/src/dbus/qdbuspendingcall.cpp
+++ b/src/dbus/qdbuspendingcall.cpp
@@ -180,9 +180,12 @@ bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *memb
if (metaTypes.at(count) == QDBusMetaTypeId::message)
--count;
- // QList<int> is actually a vector
- // kids, don't try this at home
- setMetaTypes(count, count ? &metaTypes.at(1) : 0);
+ if (count == 0) {
+ setMetaTypes(count, 0);
+ } else {
+ QVector<int> types = QVector<int>::fromList(metaTypes);
+ setMetaTypes(count, types.constData() + 1);
+ }
return true;
}
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 1c1713c..8f0e602 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -2920,10 +2920,14 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
QVector<QLineF> a(2);
a << QLineF(x1, y1, x2, y2);
a << QLineF(x2, y2, x3, y3);
- if (opt->palette.currentColorGroup() == QPalette::Active)
- p->setPen(QPen(Qt::white, 3));
- else
+ if (opt->palette.currentColorGroup() == QPalette::Active) {
+ if (opt->state & State_On)
+ p->setPen(QPen(opt->palette.highlightedText().color(), 3));
+ else
+ p->setPen(QPen(opt->palette.text().color(), 3));
+ } else {
p->setPen(QPen(QColor(100, 100, 100), 3));
+ }
p->save();
p->setRenderHint(QPainter::Antialiasing);
p->drawLines(a);
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 5babbc2..ffcd90b 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -2029,10 +2029,7 @@ void QTextControlPrivate::focusEvent(QFocusEvent *e)
#endif
))) {
#endif
- cursorOn = (interactionFlags & Qt::TextSelectableByKeyboard);
- if (interactionFlags & Qt::TextEditable) {
- setBlinkingCursorEnabled(true);
- }
+ setBlinkingCursorEnabled(interactionFlags & (Qt::TextEditable | Qt::TextSelectableByKeyboard));
#ifdef QT_KEYPAD_NAVIGATION
}
#endif
@@ -2808,7 +2805,7 @@ void QTextControl::setTextInteractionFlags(Qt::TextInteractionFlags flags)
d->interactionFlags = flags;
if (d->hasFocus)
- d->setBlinkingCursorEnabled(flags & Qt::TextEditable);
+ d->setBlinkingCursorEnabled(flags & (Qt::TextEditable | Qt::TextSelectableByKeyboard));
}
Qt::TextInteractionFlags QTextControl::textInteractionFlags() const
diff --git a/src/gui/widgets/qgroupbox.cpp b/src/gui/widgets/qgroupbox.cpp
index 56fb2dd..db068cf 100644
--- a/src/gui/widgets/qgroupbox.cpp
+++ b/src/gui/widgets/qgroupbox.cpp
@@ -733,6 +733,10 @@ void QGroupBox::mouseReleaseEvent(QMouseEvent *event)
}
Q_D(QGroupBox);
+ if (!d->overCheckBox) {
+ event->ignore();
+ return;
+ }
QStyleOptionGroupBox box;
initStyleOption(&box);
QStyle::SubControl released = style()->hitTestComplexControl(QStyle::CC_GroupBox, &box,
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index f2fca8f..3b2c8fd 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -1900,7 +1900,7 @@ void QPlainTextEdit::paintEvent(QPaintEvent *e)
}
}
- bool drawCursor = (editable
+ bool drawCursor = ((editable || (textInteractionFlags() & Qt::TextSelectableByKeyboard))
&& context.cursorPosition >= blpos
&& context.cursorPosition < blpos + bllen);
diff --git a/src/gui/widgets/qvalidator.cpp b/src/gui/widgets/qvalidator.cpp
index b32bea8..4362f2b 100644
--- a/src/gui/widgets/qvalidator.cpp
+++ b/src/gui/widgets/qvalidator.cpp
@@ -400,8 +400,9 @@ QValidator::State QIntValidator::validate(QString & input, int&) const
qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow);
if (overflow || !ok)
return Invalid;
+
if (entered >= b && entered <= t) {
- locale().toInt(input, &ok);
+ locale().toInt(input, &ok, 10);
return ok ? Acceptable : Intermediate;
}
diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp
index f1388bc..f3d26ef 100644
--- a/tests/auto/qgroupbox/tst_qgroupbox.cpp
+++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp
@@ -83,6 +83,7 @@ private slots:
void toggledVsClicked();
void childrenAreDisabled();
void propagateFocus();
+ void task_QTBUG_19170_ignoreMouseReleseEvent();
private:
bool checked;
@@ -473,5 +474,27 @@ void tst_QGroupBox::propagateFocus()
QTRY_COMPARE(qApp->focusWidget(), static_cast<QWidget*>(&lineEdit));
}
+void tst_QGroupBox::task_QTBUG_19170_ignoreMouseReleseEvent()
+{
+ QGroupBox box;
+ box.setCheckable(true);
+ box.setChecked(false);
+ box.setTitle("This is a test for QTBUG-19170");
+ box.show();
+
+ QStyleOptionGroupBox option;
+ option.initFrom(&box);
+ option.subControls = QStyle::SubControls(QStyle::SC_All);
+ QRect rect = box.style()->subControlRect(QStyle::CC_GroupBox, &option,
+ QStyle::SC_GroupBoxCheckBox, &box);
+
+ QTest::mouseClick(&box, Qt::LeftButton, 0, rect.center());
+ QCOMPARE(box.isChecked(), true);
+
+ box.setChecked(false);
+ QTest::mouseRelease(&box, Qt::LeftButton, 0, rect.center());
+ QCOMPARE(box.isChecked(), false);
+}
+
QTEST_MAIN(tst_QGroupBox)
#include "tst_qgroupbox.moc"
diff --git a/tests/auto/qintvalidator/tst_qintvalidator.cpp b/tests/auto/qintvalidator/tst_qintvalidator.cpp
index d537635..7e36093 100644
--- a/tests/auto/qintvalidator/tst_qintvalidator.cpp
+++ b/tests/auto/qintvalidator/tst_qintvalidator.cpp
@@ -168,6 +168,15 @@ void tst_QIntValidator::validate_data()
QTest::newRow("8.9") << -1 << 100 << QString("5") << ACC;
QTest::newRow("8.10") << -1 << 100 << QString("+") << INT;
QTest::newRow("8.11") << -1 << 100 << QString("+50") << ACC;
+
+ QTest::newRow("9.0") << -10 << 10 << QString("000") << ACC;
+ QTest::newRow("9.1") << -10 << 10 << QString("008") << ACC;
+ QTest::newRow("9.2") << -10 << 10 << QString("-008") << ACC;
+ QTest::newRow("9.3") << -10 << 10 << QString("00010") << ACC;
+ QTest::newRow("9.4") << -10 << 10 << QString("-00010") << ACC;
+ QTest::newRow("9.5") << -10 << 10 << QString("00020") << INV;
+ QTest::newRow("9.6") << -10 << 10 << QString("-00020") << INV;
+
}
void tst_QIntValidator::validateArabic()
diff --git a/translations/qt_ru.ts b/translations/qt_ru.ts
index 348b1ce..aebbac2 100644
--- a/translations/qt_ru.ts
+++ b/translations/qt_ru.ts
@@ -1816,14 +1816,6 @@ to
<context>
<name>QDeclarativeImportDatabase</name>
<message>
- <source>cannot load module &quot;%1&quot;: File name case mismatch for &quot;%2&quot;</source>
- <translation>невозможно загрузить модуль «%1»: Регистр имени файла не соответствует «%2»</translation>
- </message>
- <message>
- <source>module &quot;%1&quot; definition &quot;%2&quot; not readable</source>
- <translation>невозможно прочитать определение «%2» модуля «%1»</translation>
- </message>
- <message>
<source>plugin cannot be loaded for module &quot;%1&quot;: %2</source>
<translation>не удалось загрузить плагин для модуля «%1»: %2</translation>
</message>
@@ -1876,8 +1868,8 @@ to
<translation>не является типом</translation>
</message>
<message>
- <source>File name case mismatch for &quot;%2&quot;</source>
- <translation>Регистр имени файла не соответствует «%2»</translation>
+ <source>File name case mismatch for &quot;%1&quot;</source>
+ <translation>Регистр имени файла не соответствует «%1»</translation>
</message>
</context>
<context>
@@ -4977,7 +4969,11 @@ Please choose a different file name.</source>
</message>
<message>
<source>bad lookahead syntax</source>
- <translation>неправильный предварительный синтаксис</translation>
+ <translation>неправильный синтаксис lookahead</translation>
+ </message>
+ <message>
+ <source>lookbehinds not supported, see QTBUG-2371</source>
+ <translation>lookbehind не поддерживается, см. QTBUG-2371</translation>
</message>
<message>
<source>bad repetition syntax</source>