summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp')
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp55
1 files changed, 28 insertions, 27 deletions
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index f832ebfee0..809fa56a61 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -623,6 +618,11 @@ void tst_QMdiArea::showWindows()
//#define USE_SHOW
+static inline QString windowTitle(const QString &t, const QString &f)
+{
+ return t + QLatin1String(" - [") + f + QLatin1Char(']');
+}
+
void tst_QMdiArea::changeWindowTitle()
{
const QString mwc = QString::fromLatin1("MainWindow's Caption");
@@ -634,7 +634,7 @@ void tst_QMdiArea::changeWindowTitle()
mw->setWindowTitle( mwc );
QMdiArea *ws = new QMdiArea( mw );
mw->setCentralWidget( ws );
- mw->menuBar();
+ mw->menuBar()->setNativeMenuBar(false);
mw->show();
QVERIFY(QTest::qWaitForWindowExposed(mw));
@@ -650,7 +650,7 @@ void tst_QMdiArea::changeWindowTitle()
widget->setWindowState(Qt::WindowMaximized);
#endif
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
- QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
+ QTRY_COMPARE( mw->windowTitle(), windowTitle(mwc, wc) );
#endif
mw->hide();
@@ -659,7 +659,7 @@ void tst_QMdiArea::changeWindowTitle()
QVERIFY(QTest::qWaitForWindowExposed(mw));
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
- QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
+ QTRY_COMPARE( mw->windowTitle(), windowTitle(mwc, wc) );
#endif
#ifdef USE_SHOW
@@ -677,11 +677,11 @@ void tst_QMdiArea::changeWindowTitle()
#endif
qApp->processEvents();
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
- QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
+ QTRY_COMPARE( mw->windowTitle(), windowTitle(mwc, wc) );
widget->setWindowTitle( wc2 );
- QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc2) );
+ QCOMPARE( mw->windowTitle(), windowTitle(mwc, wc2) );
mw->setWindowTitle( mwc2 );
- QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc2).arg(wc2) );
+ QCOMPARE( mw->windowTitle(), windowTitle(mwc2, wc2) );
#endif
mw->show();
@@ -695,7 +695,7 @@ void tst_QMdiArea::changeWindowTitle()
qApp->processEvents();
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
- QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc2).arg(wc2) );
+ QCOMPARE( mw->windowTitle(), windowTitle(mwc2, wc2) );
#endif
#ifdef USE_SHOW
widget->showNormal();
@@ -716,7 +716,7 @@ void tst_QMdiArea::changeWindowTitle()
#endif
qApp->processEvents();
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
- QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc2).arg(wc2) );
+ QCOMPARE( mw->windowTitle(), windowTitle(mwc2, wc2) );
#endif
#ifdef USE_SHOW
@@ -743,7 +743,7 @@ void tst_QMdiArea::changeModified()
mw->setWindowTitle( mwc );
QMdiArea *ws = new QMdiArea( mw );
mw->setCentralWidget( ws );
- mw->menuBar();
+ mw->menuBar()->setNativeMenuBar(false);
mw->show();
QWidget *widget = new QWidget( ws );
@@ -2008,6 +2008,7 @@ void tst_QMdiArea::iconGeometryInMenuBar()
#if !defined (Q_OS_MAC) && !defined(Q_OS_WINCE)
QMainWindow mainWindow;
QMenuBar *menuBar = mainWindow.menuBar();
+ menuBar->setNativeMenuBar(false);
QMdiArea *mdiArea = new QMdiArea;
QMdiSubWindow *subWindow = mdiArea->addSubWindow(new QWidget);
mainWindow.setCentralWidget(mdiArea);
@@ -2323,7 +2324,7 @@ void tst_QMdiArea::setViewMode()
iconPixmap.fill(Qt::red);
for (int i = 0; i < 5; ++i) {
QMdiSubWindow *subWindow = mdiArea.addSubWindow(new QWidget);
- subWindow->setWindowTitle(QString(QLatin1String("Title %1")).arg(i));
+ subWindow->setWindowTitle(QLatin1String("Title ") + QString::number(i));
subWindow->setWindowIcon(iconPixmap);
}