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>
This commit is contained in:
parent
234163adb3
commit
a0584f678b
@ -69,6 +69,16 @@
|
|||||||
|
|
||||||
#include "QtTest/qtestaccessible.h"
|
#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)
|
#if defined(Q_OS_WINCE)
|
||||||
extern "C" bool SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
|
extern "C" bool SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
|
||||||
#define SPI_GETPLATFORMTYPE 257
|
#define SPI_GETPLATFORMTYPE 257
|
||||||
@ -363,6 +373,7 @@ void tst_QAccessibility::eventTest()
|
|||||||
{
|
{
|
||||||
QPushButton* button = new QPushButton(0);
|
QPushButton* button = new QPushButton(0);
|
||||||
button->setObjectName(QString("Olaf"));
|
button->setObjectName(QString("Olaf"));
|
||||||
|
setFrameless(button);
|
||||||
|
|
||||||
button->show();
|
button->show();
|
||||||
QAccessibleEvent showEvent(button, QAccessible::ObjectShow);
|
QAccessibleEvent showEvent(button, QAccessible::ObjectShow);
|
||||||
@ -440,6 +451,7 @@ void tst_QAccessibility::sliderTest()
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
QSlider *slider = new QSlider(0);
|
QSlider *slider = new QSlider(0);
|
||||||
|
setFrameless(slider);
|
||||||
slider->setObjectName(QString("Slidy"));
|
slider->setObjectName(QString("Slidy"));
|
||||||
slider->show();
|
slider->show();
|
||||||
QAIPtr iface(QAccessible::queryAccessibleInterface(slider));
|
QAIPtr iface(QAccessible::queryAccessibleInterface(slider));
|
||||||
@ -667,6 +679,7 @@ void tst_QAccessibility::textAttributes()
|
|||||||
void tst_QAccessibility::hideShowTest()
|
void tst_QAccessibility::hideShowTest()
|
||||||
{
|
{
|
||||||
QWidget * const window = new QWidget();
|
QWidget * const window = new QWidget();
|
||||||
|
window->resize(200, 200);
|
||||||
QWidget * const child = new QWidget(window);
|
QWidget * const child = new QWidget(window);
|
||||||
|
|
||||||
QVERIFY(state(window).invisible);
|
QVERIFY(state(window).invisible);
|
||||||
@ -727,6 +740,7 @@ void tst_QAccessibility::actionTest()
|
|||||||
|
|
||||||
{
|
{
|
||||||
QPushButton *button = new QPushButton;
|
QPushButton *button = new QPushButton;
|
||||||
|
setFrameless(button);
|
||||||
button->show();
|
button->show();
|
||||||
QVERIFY(QTest::qWaitForWindowExposed(button));
|
QVERIFY(QTest::qWaitForWindowExposed(button));
|
||||||
button->clearFocus();
|
button->clearFocus();
|
||||||
@ -912,6 +926,7 @@ void tst_QAccessibility::buttonTest()
|
|||||||
QMenu *menu = new QMenu();
|
QMenu *menu = new QMenu();
|
||||||
menu->addAction(foo);
|
menu->addAction(foo);
|
||||||
QPushButton menuButton;
|
QPushButton menuButton;
|
||||||
|
setFrameless(&menuButton);
|
||||||
menuButton.setMenu(menu);
|
menuButton.setMenu(menu);
|
||||||
menuButton.show();
|
menuButton.show();
|
||||||
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&menuButton);
|
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&menuButton);
|
||||||
@ -1067,6 +1082,7 @@ void tst_QAccessibility::scrollBarTest()
|
|||||||
void tst_QAccessibility::tabTest()
|
void tst_QAccessibility::tabTest()
|
||||||
{
|
{
|
||||||
QTabBar *tabBar = new QTabBar();
|
QTabBar *tabBar = new QTabBar();
|
||||||
|
setFrameless(tabBar);
|
||||||
tabBar->show();
|
tabBar->show();
|
||||||
|
|
||||||
QAccessibleInterface * const interface = QAccessible::queryAccessibleInterface(tabBar);
|
QAccessibleInterface * const interface = QAccessible::queryAccessibleInterface(tabBar);
|
||||||
@ -1443,6 +1459,7 @@ void tst_QAccessibility::menuTest()
|
|||||||
void tst_QAccessibility::spinBoxTest()
|
void tst_QAccessibility::spinBoxTest()
|
||||||
{
|
{
|
||||||
QSpinBox * const spinBox = new QSpinBox();
|
QSpinBox * const spinBox = new QSpinBox();
|
||||||
|
setFrameless(spinBox);
|
||||||
spinBox->setValue(3);
|
spinBox->setValue(3);
|
||||||
spinBox->show();
|
spinBox->show();
|
||||||
|
|
||||||
@ -1485,6 +1502,7 @@ void tst_QAccessibility::spinBoxTest()
|
|||||||
void tst_QAccessibility::doubleSpinBoxTest()
|
void tst_QAccessibility::doubleSpinBoxTest()
|
||||||
{
|
{
|
||||||
QDoubleSpinBox *doubleSpinBox = new QDoubleSpinBox;
|
QDoubleSpinBox *doubleSpinBox = new QDoubleSpinBox;
|
||||||
|
setFrameless(doubleSpinBox);
|
||||||
doubleSpinBox->show();
|
doubleSpinBox->show();
|
||||||
|
|
||||||
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(doubleSpinBox);
|
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(doubleSpinBox);
|
||||||
@ -1533,6 +1551,7 @@ void tst_QAccessibility::textEditTest()
|
|||||||
for (int pass = 0; pass < 2; ++pass) {
|
for (int pass = 0; pass < 2; ++pass) {
|
||||||
{
|
{
|
||||||
QTextEdit edit;
|
QTextEdit edit;
|
||||||
|
setFrameless(&edit);
|
||||||
int startOffset;
|
int startOffset;
|
||||||
int endOffset;
|
int endOffset;
|
||||||
// create two blocks of text. The first block has two lines.
|
// create two blocks of text. The first block has two lines.
|
||||||
@ -2131,6 +2150,7 @@ void tst_QAccessibility::dialogButtonBoxTest()
|
|||||||
QDialogButtonBox box(QDialogButtonBox::Reset |
|
QDialogButtonBox box(QDialogButtonBox::Reset |
|
||||||
QDialogButtonBox::Help |
|
QDialogButtonBox::Help |
|
||||||
QDialogButtonBox::Ok, Qt::Horizontal);
|
QDialogButtonBox::Ok, Qt::Horizontal);
|
||||||
|
setFrameless(&box);
|
||||||
|
|
||||||
|
|
||||||
// Test up and down navigation
|
// Test up and down navigation
|
||||||
@ -2172,6 +2192,7 @@ void tst_QAccessibility::dialTest()
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
QDial dial;
|
QDial dial;
|
||||||
|
setFrameless(&dial);
|
||||||
dial.setMinimum(23);
|
dial.setMinimum(23);
|
||||||
dial.setMaximum(121);
|
dial.setMaximum(121);
|
||||||
dial.setValue(42);
|
dial.setValue(42);
|
||||||
@ -2895,6 +2916,7 @@ void tst_QAccessibility::labelTest()
|
|||||||
{
|
{
|
||||||
QString text = "Hello World";
|
QString text = "Hello World";
|
||||||
QLabel *label = new QLabel(text);
|
QLabel *label = new QLabel(text);
|
||||||
|
setFrameless(label);
|
||||||
label->show();
|
label->show();
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX)
|
#if defined(Q_OS_UNIX)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user