summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/doc/images/qtifw-examples-stylesheet.pngbin0 -> 14796 bytes
-rw-r--r--examples/doc/stylesheet.qdoc51
-rw-r--r--examples/examples.pro3
-rw-r--r--examples/stylesheet/README6
-rw-r--r--examples/stylesheet/config/config.xml12
-rw-r--r--examples/stylesheet/config/style.qss25
-rw-r--r--examples/stylesheet/packages/org.qtproject.ifw.example.stylesheet/meta/installscript.qs39
-rw-r--r--examples/stylesheet/packages/org.qtproject.ifw.example.stylesheet/meta/package.xml8
-rw-r--r--examples/stylesheet/stylesheet.pro13
9 files changed, 156 insertions, 1 deletions
diff --git a/examples/doc/images/qtifw-examples-stylesheet.png b/examples/doc/images/qtifw-examples-stylesheet.png
new file mode 100644
index 000000000..eaa42b8b8
--- /dev/null
+++ b/examples/doc/images/qtifw-examples-stylesheet.png
Binary files differ
diff --git a/examples/doc/stylesheet.qdoc b/examples/doc/stylesheet.qdoc
new file mode 100644
index 000000000..cc408df33
--- /dev/null
+++ b/examples/doc/stylesheet.qdoc
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 http://qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example stylesheet
+ \ingroup qtifwexamples
+ \title Stylesheet Example
+
+ \brief Using a stylesheet to customize a UI.
+
+ \image qtifw-examples-stylesheet.png
+
+ \e {Stylesheet} demonstrates how to use a stylesheet to customize
+ a wizard UI.
+
+ \include installerfw-examples-configuring.qdocinc
+
+ \list
+ \li The \c <WizardStyle> element sets the wizard style to be used.
+ \li The \c <StyleSheet> element sets the stylesheet file.
+ \li The \c <TitleColor> element sets the color of the titles and subtitles.
+ \endlist
+
+ \quotefile stylesheet/config/config.xml
+
+ \include installerfw-examples-generating.qdocinc
+*/
diff --git a/examples/examples.pro b/examples/examples.pro
index 92a976ff2..377632b9c 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -12,4 +12,5 @@ SUBDIRS += \
quitinstaller \
registerfileextension \
startmenu \
- systeminfo
+ systeminfo \
+ stylesheet
diff --git a/examples/stylesheet/README b/examples/stylesheet/README
new file mode 100644
index 000000000..ee0d445db
--- /dev/null
+++ b/examples/stylesheet/README
@@ -0,0 +1,6 @@
+Shows how to customize a UI using stylesheet.
+
+Generate installer with
+
+binarycreator --offline-only -c config/config.xml -p packages installer
+
diff --git a/examples/stylesheet/config/config.xml b/examples/stylesheet/config/config.xml
new file mode 100644
index 000000000..3cd8e6060
--- /dev/null
+++ b/examples/stylesheet/config/config.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Installer>
+ <Name>Stylesheet Example</Name>
+ <Version>1.0.0</Version>
+ <Title>Stylesheet Example</Title>
+ <Publisher>Qt-Project</Publisher>
+ <StartMenuDir>Qt IFW Examples</StartMenuDir>
+ <TargetDir>@HomeDir@/IfwExamples/stylesheet</TargetDir>
+ <WizardStyle>Classic</WizardStyle>
+ <StyleSheet>style.qss</StyleSheet>
+ <TitleColor>#FFFFFF</TitleColor>
+</Installer>
diff --git a/examples/stylesheet/config/style.qss b/examples/stylesheet/config/style.qss
new file mode 100644
index 000000000..8d4f75d65
--- /dev/null
+++ b/examples/stylesheet/config/style.qss
@@ -0,0 +1,25 @@
+QWidget
+{
+ color: white;
+ background-color: rgb(65, 65, 65);
+}
+
+QPushButton
+{
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(150, 150, 150, 60%), stop:1 rgba(50, 50, 50, 60%));
+ border-color: rgb(60, 60, 60);
+ border-style: solid;
+ border-width: 2px;
+ border-radius: 9px;
+ min-height: 20px;
+ max-height: 20px;
+ min-width: 60px;
+ max-width: 60px;
+ padding-left: 15px;
+ padding-right: 15px;
+}
+
+QPushButton:pressed, QPushButton:checked
+{
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(50, 50, 50, 60%), stop:1 rgba(150, 150, 150, 60%));
+}
diff --git a/examples/stylesheet/packages/org.qtproject.ifw.example.stylesheet/meta/installscript.qs b/examples/stylesheet/packages/org.qtproject.ifw.example.stylesheet/meta/installscript.qs
new file mode 100644
index 000000000..e99733ff3
--- /dev/null
+++ b/examples/stylesheet/packages/org.qtproject.ifw.example.stylesheet/meta/installscript.qs
@@ -0,0 +1,39 @@
+/**************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Installer Framework.
+**
+** $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 The Qt Company. For licensing terms
+** and conditions see http://qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
+function Component()
+{
+ // constructor
+ installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
+}
diff --git a/examples/stylesheet/packages/org.qtproject.ifw.example.stylesheet/meta/package.xml b/examples/stylesheet/packages/org.qtproject.ifw.example.stylesheet/meta/package.xml
new file mode 100644
index 000000000..c0698a4e4
--- /dev/null
+++ b/examples/stylesheet/packages/org.qtproject.ifw.example.stylesheet/meta/package.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <DisplayName>Dummy</DisplayName>
+ <ReleaseDate>2015-09-09</ReleaseDate>
+ <Version>1.0.1</Version>
+ <Default>true</Default>
+ <Script>installscript.qs</Script>
+</Package>
diff --git a/examples/stylesheet/stylesheet.pro b/examples/stylesheet/stylesheet.pro
new file mode 100644
index 000000000..415df49d5
--- /dev/null
+++ b/examples/stylesheet/stylesheet.pro
@@ -0,0 +1,13 @@
+TEMPLATE = aux
+
+INSTALLER = installer
+
+INPUT = $$PWD/config/config.xml $$PWD/packages
+example.input = INPUT
+example.output = $$INSTALLER
+example.commands = ../../bin/binarycreator -c $$PWD/config/config.xml -p $$PWD/packages ${QMAKE_FILE_OUT}
+example.CONFIG += target_predeps no_link combine
+
+QMAKE_EXTRA_COMPILERS += example
+
+OTHER_FILES = README