summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-05 13:42:11 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-05 13:42:11 +0100
commit5e8ae03578ecd0538a774505f2f7e2fc626b0ab7 (patch)
tree3b6f704df4d55d0ed2a5a706acf785541a74a45e /tests/manual
parent7a5fea113ec6088135b0b6a0fc4297e0ef362bc5 (diff)
parentbe3fb9afe50361e4b35d02d28ef30851335b17b6 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: configure qmake/generators/mac/pbuilder_pbx.cpp src/corelib/kernel/qtimerinfo_unix.cpp src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/transientwindow/main.cpp51
-rw-r--r--tests/manual/transientwindow/mainwindow.cpp66
-rw-r--r--tests/manual/transientwindow/mainwindow.h64
-rw-r--r--tests/manual/transientwindow/transientwindow.pro6
4 files changed, 187 insertions, 0 deletions
diff --git a/tests/manual/transientwindow/main.cpp b/tests/manual/transientwindow/main.cpp
new file mode 100644
index 0000000000..aebb051688
--- /dev/null
+++ b/tests/manual/transientwindow/main.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt 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.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "mainwindow.h"
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ MainWindow w;
+ w.show();
+
+ return a.exec();
+}
diff --git a/tests/manual/transientwindow/mainwindow.cpp b/tests/manual/transientwindow/mainwindow.cpp
new file mode 100644
index 0000000000..25123c4936
--- /dev/null
+++ b/tests/manual/transientwindow/mainwindow.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt 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.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "mainwindow.h"
+#include <QDebug>
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent), m_showButton("Toggle visible", this), m_window(0)
+{
+ connect(&m_showButton, SIGNAL(clicked()), this, SLOT(toggleVisible()));
+ setWindowTitle(QString::fromLatin1("Main Window"));
+ m_showButton.setVisible(true);
+ setMinimumSize(300, 200);
+}
+
+MainWindow::~MainWindow()
+{
+}
+
+void MainWindow::toggleVisible()
+{
+ if (!m_window) {
+ m_window = new QWindow();
+ m_window->setTransientParent(windowHandle());
+ m_window->setMinimumSize(QSize(200, 100));
+ m_window->setTitle("Transient Window");
+ }
+ m_window->setVisible(!m_window->isVisible());
+}
diff --git a/tests/manual/transientwindow/mainwindow.h b/tests/manual/transientwindow/mainwindow.h
new file mode 100644
index 0000000000..352fc961e1
--- /dev/null
+++ b/tests/manual/transientwindow/mainwindow.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt 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.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include <QPushButton>
+#include <QWindow>
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+public slots:
+ void toggleVisible();
+
+private:
+ QPushButton m_showButton;
+ QWindow* m_window;
+};
+
+#endif // MAINWINDOW_H
diff --git a/tests/manual/transientwindow/transientwindow.pro b/tests/manual/transientwindow/transientwindow.pro
new file mode 100644
index 0000000000..a07ee09dbc
--- /dev/null
+++ b/tests/manual/transientwindow/transientwindow.pro
@@ -0,0 +1,6 @@
+QT += core gui widgets
+TARGET = transientwindow
+TEMPLATE = app
+SOURCES += main.cpp\
+ mainwindow.cpp
+HEADERS += mainwindow.h