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"
|
||||
|
||||
// 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)
|
||||
|
Loading…
Reference in New Issue
Block a user