diff options
Diffstat (limited to 'examples/designer/worldtimeclockbuilder')
4 files changed, 248 insertions, 0 deletions
diff --git a/examples/designer/worldtimeclockbuilder/form.ui b/examples/designer/worldtimeclockbuilder/form.ui new file mode 100644 index 0000000..e5be1d9 --- /dev/null +++ b/examples/designer/worldtimeclockbuilder/form.ui @@ -0,0 +1,162 @@ +<ui version="4.0" > + <author></author> + <comment></comment> + <exportmacro></exportmacro> + <class>WorldTimeForm</class> + <widget class="QWidget" name="WorldTimeForm" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle" > + <string>World Time Clock</string> + </property> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="WorldTimeClock" name="worldTimeClock" /> + </item> + <item> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>1</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>1</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QLabel" name="label" > + <property name="text" > + <string>Current time:</string> + </property> + </widget> + </item> + <item> + <widget class="QTimeEdit" name="timeEdit" > + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>1</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QLabel" name="label_2" > + <property name="text" > + <string>Set time zone:</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox" > + <property name="maximum" > + <number>12</number> + </property> + <property name="minimum" > + <number>-12</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <pixmapfunction></pixmapfunction> + <customwidgets> + <customwidget> + <class>WorldTimeClock</class> + <extends></extends> + <header>worldtimeclock.h</header> + <container>0</container> + <pixmap></pixmap> + </customwidget> + </customwidgets> + <resources/> + <connections> + <connection> + <sender>spinBox</sender> + <signal>valueChanged(int)</signal> + <receiver>worldTimeClock</receiver> + <slot>setTimeZone(int)</slot> + <hints> + <hint type="sourcelabel" > + <x>339</x> + <y>166</y> + </hint> + <hint type="destinationlabel" > + <x>157</x> + <y>230</y> + </hint> + </hints> + </connection> + <connection> + <sender>worldTimeClock</sender> + <signal>updated(QTime)</signal> + <receiver>timeEdit</receiver> + <slot>setTime(QTime)</slot> + <hints> + <hint type="sourcelabel" > + <x>141</x> + <y>59</y> + </hint> + <hint type="destinationlabel" > + <x>291</x> + <y>133</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/examples/designer/worldtimeclockbuilder/main.cpp b/examples/designer/worldtimeclockbuilder/main.cpp new file mode 100644 index 0000000..35f7dc0 --- /dev/null +++ b/examples/designer/worldtimeclockbuilder/main.cpp @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] +#include <QtUiTools> +//! [0] +#include <QtGui> + +//! [1] +int main(int argc, char *argv[]) +{ + Q_INIT_RESOURCE(worldtimeclockbuilder); + + QApplication app(argc, argv); + + QUiLoader loader; +//! [1] + +//! [2] + QFile file(":/forms/form.ui"); + file.open(QFile::ReadOnly); + + QWidget *widget = loader.load(&file); + + file.close(); + widget->show(); +//! [2] + +//! [3] + return app.exec(); +} +//! [3] diff --git a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro new file mode 100644 index 0000000..2690921 --- /dev/null +++ b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro @@ -0,0 +1,11 @@ +#! [0] +CONFIG += uitools +SOURCES = main.cpp +RESOURCES = worldtimeclockbuilder.qrc +#! [0] + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockbuilder +sources.files = $$SOURCES $$HEADERS $$RESOURCES *.ui *.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/designer/worldtimeclockbuilder +INSTALLS += target sources diff --git a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.qrc b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.qrc new file mode 100644 index 0000000..89d5ac3 --- /dev/null +++ b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/forms"> + <file>form.ui</file> +</qresource> +</RCC> |