summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlineedit/tst_qlineedit.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-08-03 10:53:57 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-08-03 10:53:57 (GMT)
commitd5491ecdde14659a913c9f476f18c45f1d9489bb (patch)
tree06cc52249feda9bd9e50ca47abb8ebd676c8a309 /tests/auto/qlineedit/tst_qlineedit.cpp
parent42cdfaf86d34afeb6448723839fef70fe477deed (diff)
parenta41128af5373a0225c3548abd3eb82cd7e8f7a0e (diff)
downloadQt-d5491ecdde14659a913c9f476f18c45f1d9489bb.zip
Qt-d5491ecdde14659a913c9f476f18c45f1d9489bb.tar.gz
Qt-d5491ecdde14659a913c9f476f18c45f1d9489bb.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into lighthouse
Conflicts: configure
Diffstat (limited to 'tests/auto/qlineedit/tst_qlineedit.cpp')
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index b34e559..717b32d 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -66,7 +66,6 @@
#include <qspinbox.h>
#include <qdebug.h>
-
//TESTED_CLASS=
//TESTED_FILES=
@@ -275,6 +274,7 @@ private slots:
void taskQTBUG_7902_contextMenuCrash();
#endif
void taskQTBUG_7395_readOnlyShortcut();
+ void QTBUG697_paletteCurrentColorGroup();
#ifdef QT3_SUPPORT
void validateAndSet_data();
@@ -3714,5 +3714,32 @@ void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut()
QCOMPARE(spy.count(), 1);
}
+void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup()
+{
+#ifndef Q_WS_X11
+ QSKIP("Only tested on X11", SkipAll);
+#endif
+ QLineEdit le;
+ le.setText(" ");
+ QPalette p = le.palette();
+ p.setBrush(QPalette::Active, QPalette::Highlight, Qt::green);
+ p.setBrush(QPalette::Inactive, QPalette::Highlight, Qt::red);
+ le.setPalette(p);
+
+ le.show();
+ QApplication::setActiveWindow(&le);
+ QTest::qWaitForWindowShown(&le);
+ le.setFocus();
+ QTRY_VERIFY(le.hasFocus());
+ le.selectAll();
+
+ QImage img(le.size(),QImage::Format_ARGB32 );
+ le.render(&img);
+ QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::green).rgb());
+ QApplication::setActiveWindow(0);
+ le.render(&img);
+ QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::red).rgb());
+}
+
QTEST_MAIN(tst_QLineEdit)
#include "tst_qlineedit.moc"