summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-07-24 09:45:33 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-07-27 13:04:30 (GMT)
commit3643028959f0b38350e57e60ba4000435b75e592 (patch)
treec129e4dee11487abd437ab8ebd993ba261e06fa6 /tests/auto/qwidget
parentcf66c667a97c0079141eb3f2d9e997b7378ae792 (diff)
parentc36139c665e61866aff4bf8572890a735167a7d0 (diff)
downloadQt-3643028959f0b38350e57e60ba4000435b75e592.zip
Qt-3643028959f0b38350e57e60ba4000435b75e592.tar.gz
Qt-3643028959f0b38350e57e60ba4000435b75e592.tar.bz2
Merge commit 'qt/master-stable'
Conflicts: configure.exe qmake/Makefile.unix qmake/generators/makefile.cpp src/corelib/global/qglobal.h src/corelib/kernel/kernel.pri src/corelib/kernel/qcoreevent.cpp src/corelib/kernel/qsharedmemory_unix.cpp src/gui/graphicsview/qgraphicsscene.cpp src/gui/kernel/qaction.cpp src/gui/kernel/qaction.h src/gui/kernel/qaction_p.h src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication.h src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget.h src/gui/kernel/qwidget_mac.mm src/gui/painting/qgraphicssystemfactory.cpp src/gui/styles/qwindowsstyle.cpp src/gui/text/qfontengine_qpf.cpp src/gui/widgets/qabstractscrollarea_p.h src/network/access/qnetworkaccessdebugpipebackend.cpp src/network/socket/qlocalsocket_unix.cpp src/network/socket/qnativesocketengine_p.h src/network/socket/qnativesocketengine_unix.cpp src/openvg/qpaintengine_vg.cpp tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp tests/auto/qcssparser/qcssparser.pro tests/auto/qdir/tst_qdir.cpp tests/auto/qfile/tst_qfile.cpp tests/auto/qobject/tst_qobject.cpp tests/auto/qpathclipper/qpathclipper.pro tests/auto/qprocess/tst_qprocess.cpp tests/auto/qsettings/tst_qsettings.cpp tests/auto/qsharedpointer/qsharedpointer.pro tests/auto/qsqlquerymodel/qsqlquerymodel.pro tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro tests/auto/qsqltablemodel/qsqltablemodel.pro tests/auto/qsqlthread/qsqlthread.pro tests/auto/qwidget/tst_qwidget.cpp
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp58
1 files changed, 54 insertions, 4 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index e148fdb..0b2da10 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -114,7 +114,7 @@
// taken from qguifunctions_wce.cpp
#define SPI_GETPLATFORMTYPE 257
bool qt_wince_is_platform(const QString &platformString) {
- TCHAR tszPlatform[64];
+ wchar_t tszPlatform[64];
if (SystemParametersInfo(SPI_GETPLATFORMTYPE,
sizeof(tszPlatform)/sizeof(*tszPlatform),tszPlatform,0))
if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
@@ -359,8 +359,10 @@ private slots:
#endif
void updateOnDestroyedSignal();
void toplevelLineEditFocus();
+ void inputFocus_task257832();
void focusWidget_task254563();
+ void rectOutsideCoordinatesLimit_task144779();
void destroyBackingStore();
@@ -3494,9 +3496,9 @@ static QString visibleWindowTitle(QWidget *window, Qt::WindowState state = Qt::W
#ifdef Q_WS_WIN
Q_UNUSED(state);
const size_t maxTitleLength = 256;
- WCHAR title[maxTitleLength];
- GetWindowTextW(window->winId(), title, maxTitleLength);
- vTitle = QString::fromUtf16((ushort *)title);
+ wchar_t title[maxTitleLength];
+ GetWindowText(window->winId(), title, maxTitleLength);
+ vTitle = QString::fromWCharArray(title);
#elif defined(Q_WS_X11)
/*
We can't check what the window manager displays, but we can
@@ -9228,5 +9230,53 @@ void tst_QWidget::destroyBackingStore()
QCOMPARE(w.numPaintEvents, 2);
}
+void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
+{
+ QWidget main;
+ QPalette palette;
+ palette.setColor(QPalette::Window, Qt::red);
+ main.setPalette(palette);
+ main.resize(400, 400);
+
+ QWidget *offsetWidget = new QWidget(&main);
+ offsetWidget->setGeometry(0, -14600, 400, 15000);
+
+ // big widget is too big for the coordinates, it must be limited by wrect
+ // if wrect is not at the right position because of offsetWidget, bigwidget
+ // is not painted correctly
+ QWidget *bigWidget = new QWidget(offsetWidget);
+ bigWidget->setGeometry(0, 0, 400, 50000);
+ palette.setColor(QPalette::Window, Qt::green);
+ bigWidget->setPalette(palette);
+ bigWidget->setAutoFillBackground(true);
+
+ main.show();
+#ifdef Q_WS_X11
+ qt_x11_wait_for_window_manager(&main);
+#endif
+ QTest::qWait(100);
+ QPixmap pixmap = QPixmap::grabWindow(main.winId());
+
+ QPixmap correct(main.size());
+ correct.fill(Qt::green);
+
+ QRect center(100, 100, 200, 200); // to avoid the decorations
+ QCOMPARE(pixmap.toImage().copy(center), correct.toImage().copy(center));
+}
+
+void tst_QWidget::inputFocus_task257832()
+{
+ QLineEdit *widget = new QLineEdit;
+ QInputContext *context = widget->inputContext();
+ if (!context)
+ QSKIP("No input context", SkipSingle);
+ widget->setFocus();
+ context->setFocusWidget(widget);
+ QCOMPARE(context->focusWidget(), widget);
+ widget->setReadOnly(true);
+ QVERIFY(!context->focusWidget());
+ delete widget;
+}
+
QTEST_MAIN(tst_QWidget)
#include "tst_qwidget.moc"