summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2012-12-18 15:22:48 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-19 16:36:14 +0100
commita0584f678b20103fe4ccbe482848051acbb00b21 (patch)
treeec37ce547409b2e39c9cf0b6c5be1e6c53920f0c /tests/auto/other
parent234163adb3ceb9a6f2fac04a276724bf8495ca8e (diff)
tst_qaccessibility: Fix warnings about window geometry on Windows.
Make windows frameless so that size constraints for decorated windows do not interfere. Task-number: QTBUG-28696 Change-Id: Ic4410d8a6e8166bdfe013ed2362173f8e02d4b29 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 768217c008..09faa7a3f2 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -69,6 +69,16 @@
#include "QtTest/qtestaccessible.h"
+// Make a widget frameless to prevent size constraints of title bars
+// from interfering (Windows).
+static inline void setFrameless(QWidget *w)
+{
+ Qt::WindowFlags flags = w->windowFlags();
+ flags |= Qt::FramelessWindowHint;
+ flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
+ w->setWindowFlags(flags);
+}
+
#if defined(Q_OS_WINCE)
extern "C" bool SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
#define SPI_GETPLATFORMTYPE 257
@@ -363,6 +373,7 @@ void tst_QAccessibility::eventTest()
{
QPushButton* button = new QPushButton(0);
button->setObjectName(QString("Olaf"));
+ setFrameless(button);
button->show();
QAccessibleEvent showEvent(button, QAccessible::ObjectShow);
@@ -440,6 +451,7 @@ void tst_QAccessibility::sliderTest()
{
{
QSlider *slider = new QSlider(0);
+ setFrameless(slider);
slider->setObjectName(QString("Slidy"));
slider->show();
QAIPtr iface(QAccessible::queryAccessibleInterface(slider));
@@ -667,6 +679,7 @@ void tst_QAccessibility::textAttributes()
void tst_QAccessibility::hideShowTest()
{
QWidget * const window = new QWidget();
+ window->resize(200, 200);
QWidget * const child = new QWidget(window);
QVERIFY(state(window).invisible);
@@ -727,6 +740,7 @@ void tst_QAccessibility::actionTest()
{
QPushButton *button = new QPushButton;
+ setFrameless(button);
button->show();
QVERIFY(QTest::qWaitForWindowExposed(button));
button->clearFocus();
@@ -912,6 +926,7 @@ void tst_QAccessibility::buttonTest()
QMenu *menu = new QMenu();
menu->addAction(foo);
QPushButton menuButton;
+ setFrameless(&menuButton);
menuButton.setMenu(menu);
menuButton.show();
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&menuButton);
@@ -1067,6 +1082,7 @@ void tst_QAccessibility::scrollBarTest()
void tst_QAccessibility::tabTest()
{
QTabBar *tabBar = new QTabBar();
+ setFrameless(tabBar);
tabBar->show();
QAccessibleInterface * const interface = QAccessible::queryAccessibleInterface(tabBar);
@@ -1443,6 +1459,7 @@ void tst_QAccessibility::menuTest()
void tst_QAccessibility::spinBoxTest()
{
QSpinBox * const spinBox = new QSpinBox();
+ setFrameless(spinBox);
spinBox->setValue(3);
spinBox->show();
@@ -1485,6 +1502,7 @@ void tst_QAccessibility::spinBoxTest()
void tst_QAccessibility::doubleSpinBoxTest()
{
QDoubleSpinBox *doubleSpinBox = new QDoubleSpinBox;
+ setFrameless(doubleSpinBox);
doubleSpinBox->show();
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(doubleSpinBox);
@@ -1533,6 +1551,7 @@ void tst_QAccessibility::textEditTest()
for (int pass = 0; pass < 2; ++pass) {
{
QTextEdit edit;
+ setFrameless(&edit);
int startOffset;
int endOffset;
// create two blocks of text. The first block has two lines.
@@ -2131,6 +2150,7 @@ void tst_QAccessibility::dialogButtonBoxTest()
QDialogButtonBox box(QDialogButtonBox::Reset |
QDialogButtonBox::Help |
QDialogButtonBox::Ok, Qt::Horizontal);
+ setFrameless(&box);
// Test up and down navigation
@@ -2172,6 +2192,7 @@ void tst_QAccessibility::dialTest()
{
{
QDial dial;
+ setFrameless(&dial);
dial.setMinimum(23);
dial.setMaximum(121);
dial.setValue(42);
@@ -2895,6 +2916,7 @@ void tst_QAccessibility::labelTest()
{
QString text = "Hello World";
QLabel *label = new QLabel(text);
+ setFrameless(label);
label->show();
#if defined(Q_OS_UNIX)