diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-03-23 09:18:55 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-23 09:18:55 (GMT) |
commit | e5fcad302d86d316390c6b0f62759a067313e8a9 (patch) | |
tree | c2afbf6f1066b6ce261f14341cf6d310e5595bc1 /doc/src/snippets/designer/noautoconnection | |
download | Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.zip Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.gz Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.bz2 |
Long live Qt 4.5!
Diffstat (limited to 'doc/src/snippets/designer/noautoconnection')
5 files changed, 583 insertions, 0 deletions
diff --git a/doc/src/snippets/designer/noautoconnection/imagedialog.cpp b/doc/src/snippets/designer/noautoconnection/imagedialog.cpp new file mode 100644 index 0000000..1529377 --- /dev/null +++ b/doc/src/snippets/designer/noautoconnection/imagedialog.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation 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$ +** +****************************************************************************/ + +#include <QtGui> + +#include "imagedialog.h" + +//! [0] +ImageDialog::ImageDialog(QWidget *parent) + : QDialog(parent) +{ + setupUi(this); + okButton->setAutoDefault(false); + cancelButton->setAutoDefault(false); +//! [0] + + colorDepthCombo->addItem(tr("2 colors (1 bit per pixel)")); + colorDepthCombo->addItem(tr("4 colors (2 bits per pixel)")); + colorDepthCombo->addItem(tr("16 colors (4 bits per pixel)")); + colorDepthCombo->addItem(tr("256 colors (8 bits per pixel)")); + colorDepthCombo->addItem(tr("65536 colors (16 bits per pixel)")); + colorDepthCombo->addItem(tr("16 million colors (24 bits per pixel)")); + + connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); +//! [1] + connect(okButton, SIGNAL(clicked()), this, SLOT(checkValues())); +} +//! [1] + +//! [2] +void ImageDialog::checkValues() +{ + if (nameLineEdit->text().isEmpty()) + (void) QMessageBox::information(this, tr("No Image Name"), + tr("Please supply a name for the image."), QMessageBox::Cancel); + else + accept(); +} +//! [2] diff --git a/doc/src/snippets/designer/noautoconnection/imagedialog.h b/doc/src/snippets/designer/noautoconnection/imagedialog.h new file mode 100644 index 0000000..c67b01e --- /dev/null +++ b/doc/src/snippets/designer/noautoconnection/imagedialog.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation 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$ +** +****************************************************************************/ + +#ifndef IMAGEDIALOG_H +#define IMAGEDIALOG_H + +#include "ui_imagedialog.h" + +//! [0] +class ImageDialog : public QDialog, private Ui::ImageDialog +{ + Q_OBJECT + +public: + ImageDialog(QWidget *parent = 0); + +private slots: + void checkValues(); +}; +//! [0] + +#endif diff --git a/doc/src/snippets/designer/noautoconnection/imagedialog.ui b/doc/src/snippets/designer/noautoconnection/imagedialog.ui new file mode 100644 index 0000000..1c5e546 --- /dev/null +++ b/doc/src/snippets/designer/noautoconnection/imagedialog.ui @@ -0,0 +1,389 @@ +<ui version="4.0" > + <comment></comment> + <class>ImageDialog</class> + <widget class="QDialog" > + <property name="objectName" > + <string notr="true" >ImageDialog</string> + </property> + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>320</width> + <height>180</height> + </rect> + </property> + <property name="windowTitle" > + <string>Create Image</string> + </property> + <layout class="QVBoxLayout" > + <property name="objectName" > + <string notr="true" /> + </property> + <property name="margin" > + <number>9</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <layout class="QGridLayout" > + <property name="objectName" > + <string notr="true" /> + </property> + <property name="margin" > + <number>1</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item row="1" column="0" > + <widget class="QLabel" name="widthLabel" > + <property name="objectName" > + <string notr="true" >widthLabel</string> + </property> + <property name="geometry" > + <rect> + <x>1</x> + <y>27</y> + <width>67</width> + <height>22</height> + </rect> + </property> + <property name="frameShape" > + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Plain</enum> + </property> + <property name="text" > + <string>Width:</string> + </property> + <property name="textFormat" > + <enum>Qt::AutoText</enum> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="heightLabel" > + <property name="objectName" > + <string notr="true" >heightLabel</string> + </property> + <property name="geometry" > + <rect> + <x>1</x> + <y>55</y> + <width>67</width> + <height>22</height> + </rect> + </property> + <property name="frameShape" > + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Plain</enum> + </property> + <property name="text" > + <string>Height:</string> + </property> + <property name="textFormat" > + <enum>Qt::AutoText</enum> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QComboBox" name="colorDepthCombo" > + <property name="objectName" > + <string notr="true" >colorDepthCombo</string> + </property> + <property name="geometry" > + <rect> + <x>74</x> + <y>83</y> + <width>227</width> + <height>22</height> + </rect> + </property> + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="insertPolicy" > + <enum>QComboBox::InsertAtBottom</enum> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QLineEdit" name="nameLineEdit" > + <property name="objectName" > + <string notr="true" >nameLineEdit</string> + </property> + <property name="geometry" > + <rect> + <x>74</x> + <y>83</y> + <width>227</width> + <height>22</height> + </rect> + </property> + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Untitled image</string> + </property> + <property name="echoMode" > + <enum>QLineEdit::Normal</enum> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QSpinBox" name="spinBox" > + <property name="objectName" > + <string notr="true" >spinBox</string> + </property> + <property name="geometry" > + <rect> + <x>74</x> + <y>1</y> + <width>227</width> + <height>20</height> + </rect> + </property> + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::UpDownArrows</enum> + </property> + <property name="value" > + <number>32</number> + </property> + <property name="maximum" > + <number>1024</number> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QSpinBox" name="spinBox_2" > + <property name="objectName" > + <string notr="true" >spinBox_2</string> + </property> + <property name="geometry" > + <rect> + <x>74</x> + <y>27</y> + <width>227</width> + <height>22</height> + </rect> + </property> + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::UpDownArrows</enum> + </property> + <property name="value" > + <number>32</number> + </property> + <property name="maximum" > + <number>1024</number> + </property> + <property name="minimum" > + <number>1</number> + </property> + </widget> + </item> + <item row="0" column="0" > + <widget class="QLabel" name="nameLabel" > + <property name="objectName" > + <string notr="true" >nameLabel</string> + </property> + <property name="geometry" > + <rect> + <x>1</x> + <y>1</y> + <width>67</width> + <height>20</height> + </rect> + </property> + <property name="frameShape" > + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Plain</enum> + </property> + <property name="text" > + <string>Name:</string> + </property> + <property name="textFormat" > + <enum>Qt::AutoText</enum> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="colorDepthLabel" > + <property name="objectName" > + <string notr="true" >colorDepthLabel</string> + </property> + <property name="geometry" > + <rect> + <x>1</x> + <y>83</y> + <width>67</width> + <height>22</height> + </rect> + </property> + <property name="frameShape" > + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Plain</enum> + </property> + <property name="text" > + <string>Color depth:</string> + </property> + <property name="textFormat" > + <enum>Qt::AutoText</enum> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer> + <property name="objectName" > + <string notr="true" /> + </property> + <property name="geometry" > + <rect> + <x>9</x> + <y>121</y> + <width>302</width> + <height>18</height> + </rect> + </property> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + </spacer> + </item> + <item> + <layout class="QHBoxLayout" > + <property name="objectName" > + <string notr="true" /> + </property> + <property name="margin" > + <number>1</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <spacer> + <property name="objectName" > + <string notr="true" /> + </property> + <property name="geometry" > + <rect> + <x>1</x> + <y>1</y> + <width>128</width> + <height>24</height> + </rect> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="okButton" > + <property name="objectName" > + <string notr="true" >okButton</string> + </property> + <property name="geometry" > + <rect> + <x>135</x> + <y>1</y> + <width>80</width> + <height>24</height> + </rect> + </property> + <property name="text" > + <string>OK</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="cancelButton" > + <property name="objectName" > + <string notr="true" >cancelButton</string> + </property> + <property name="geometry" > + <rect> + <x>221</x> + <y>1</y> + <width>80</width> + <height>24</height> + </rect> + </property> + <property name="text" > + <string>Cancel</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <pixmapfunction></pixmapfunction> + <tabstops> + <tabstop>nameLineEdit</tabstop> + <tabstop>spinBox</tabstop> + <tabstop>spinBox_2</tabstop> + <tabstop>colorDepthCombo</tabstop> + <tabstop>okButton</tabstop> + <tabstop>cancelButton</tabstop> + </tabstops> + <connections> + <connection> + <sender>nameLineEdit</sender> + <signal>returnPressed()</signal> + <receiver>okButton</receiver> + <slot>animateClick()</slot> + <hints> + <hint type="sourcelabel" > + <x>-1</x> + <y>7</y> + </hint> + <hint type="destinationlabel" > + <x>-1</x> + <y>7</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/doc/src/snippets/designer/noautoconnection/main.cpp b/doc/src/snippets/designer/noautoconnection/main.cpp new file mode 100644 index 0000000..f5c762c --- /dev/null +++ b/doc/src/snippets/designer/noautoconnection/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation 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$ +** +****************************************************************************/ + +#include "imagedialog.h" + +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + ImageDialog *dialog = new ImageDialog; + dialog->show(); + return app.exec(); +} diff --git a/doc/src/snippets/designer/noautoconnection/noautoconnection.pro b/doc/src/snippets/designer/noautoconnection/noautoconnection.pro new file mode 100644 index 0000000..fba94de --- /dev/null +++ b/doc/src/snippets/designer/noautoconnection/noautoconnection.pro @@ -0,0 +1,5 @@ +TEMPLATE = app +FORMS = imagedialog.ui +HEADERS = imagedialog.h +SOURCES = imagedialog.cpp \ + main.cpp |