aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-01-03 09:54:37 +0100
committerMorten Johan Sørvig <morten.sorvig@digia.com>2013-01-31 08:23:27 +0100
commit2f604147e4cc1ab5926368e80a0e5586b918bbab (patch)
tree3c983b8df4dd776419a301d9e44855dc4c162a6a /examples
parent014f00c11f69a60fa33509bf11b9ebda986f6dc0 (diff)
Add qt_mac_set_dock_menu(QMenu *)
Change-Id: I75c6c20e0c9e94ff1ddc336083953a9a2f472fe5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/macfunctions/macfunctions.pro10
-rw-r--r--examples/macfunctions/main.cpp56
2 files changed, 66 insertions, 0 deletions
diff --git a/examples/macfunctions/macfunctions.pro b/examples/macfunctions/macfunctions.pro
new file mode 100644
index 0000000..c4a4ad1
--- /dev/null
+++ b/examples/macfunctions/macfunctions.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+TARGET = macfunctions
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += widgets
+
+include (../../src/qtmacextras.pri)
+
+# Input
+SOURCES += main.cpp
diff --git a/examples/macfunctions/main.cpp b/examples/macfunctions/main.cpp
new file mode 100644
index 0000000..d049b76
--- /dev/null
+++ b/examples/macfunctions/main.cpp
@@ -0,0 +1,56 @@
+/** Contact: http://www.qt-project.org/legal
+**
+** This file is part of QtMacExtras in 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 <QtWidgets/QtWidgets>
+#include <qtmacfunctions.h>
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ QWidget widget;
+ widget.show();
+
+ QMenu menu;
+ menu.addAction("Item 1");
+ menu.addAction("Item 2");
+ qt_mac_set_dock_menu(&menu);
+
+ return app.exec();
+}