diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-22 16:44:51 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-22 17:49:10 +0200 |
commit | 39236c01ae6c9bc99ee3a02d8294679e12d9b734 (patch) | |
tree | 7ae55d4e33d5d34109ca7d014db791e73cddbcb5 /sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance | |
parent | 315a9ce2e7b443fa7485ed8c21189e62fe2e2165 (diff) |
move everying into sources/pyside2
in preparation for a subtree merge.
this should not be necessary to do in a separate commit, but git is a
tad stupid about following history correctly without it.
Diffstat (limited to 'sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance')
4 files changed, 583 insertions, 0 deletions
diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.cpp new file mode 100644 index 000000000..f2e861f40 --- /dev/null +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of PySide2. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtWidgets> + +#include "imagedialog.h" + +ImageDialog::ImageDialog(QWidget *parent) + : QDialog(parent) +{ + setupUi(this); + + 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(okButton, SIGNAL(clicked()), this, SLOT(accept())); + connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); +} diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h b/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h new file mode 100644 index 000000000..b9cf4492e --- /dev/null +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of PySide2. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef IMAGEDIALOG_H +#define IMAGEDIALOG_H + +#include "ui_imagedialog.h" + +class ImageDialog : public QDialog, private Ui::ImageDialog +{ + Q_OBJECT + +public: + ImageDialog(QWidget *parent = 0); +}; + +#endif diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.ui b/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.ui new file mode 100644 index 000000000..1c5e546f2 --- /dev/null +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/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/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/main.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/main.cpp new file mode 100644 index 000000000..98ed0b868 --- /dev/null +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/designer/multipleinheritance/main.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of PySide2. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $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(); +} |