summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/doc_src_plugins-howto.qdoc
blob: 8135c8962c4876914265211ed786420e1671fc55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (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 Technology Preview License Agreement accompanying
** this package.
**
** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

//! [0]
class MyStylePlugin : public QStylePlugin
{
public:
    QStringList keys() const;
    QStyle *create(const QString &key);
};
//! [0]


//! [1]
#include "mystyleplugin.h"

QStringList MyStylePlugin::keys() const
{
    return QStringList() << "MyStyle";
}

QStyle *MyStylePlugin::create(const QString &key)
{
    if (key.toLower() == "mystyle")
        return new MyStyle;
    return 0;
}

Q_EXPORT_PLUGIN2(pnp_mystyleplugin, MyStylePlugin)
//! [1]


//! [2]
QApplication::setStyle(QStyleFactory::create("MyStyle"));
//! [2]


//! [3]
CONFIG += release
//! [3]


//! [4]
#include <QApplication>
#include <QtPlugin>

Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
Q_IMPORT_PLUGIN(qkrcodecs)

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    ...
    return app.exec();
}
//! [4]


//! [5]
QTPLUGIN     += qjpeg \
                qgif \
                qkrcodecs
//! [5]


//! [6]
HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.2.debug
HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.2.false
//! [6]
on> Tk is a free and open-source, cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages.
summaryrefslogtreecommitdiffstats
path: root/unix
Commit message (Collapse)AuthorAgeFilesLines
* Fixed [545f10fcf3] - Poor Xft coloured font performance on X11. Thanks to ↵bug_545f10fcf3fvogel2016-05-101-44/+106
| | | | James Bonfield for the bug report, to Rob Davies for the patch, and to Brian Griffin for the testing
* Update version in tk.specjan.nijtmans2016-03-021-1/+1
|
* Revert part of [032c1ee138449c93dfa885fab07796783945e174|032c1ee138]: Only ↵jan.nijtmans2016-03-021-6/+6
| | | | the patchlevel should have been changed, nothing else.
* Put [wm forget] fix in the 8.6.5 release.core_8_6_5core_8_6_5_rcdgp2016-02-251-0/+5
|\
| * Fixed bug [e9112ef96e] - [wm forget] doesn't completelyfvogel2016-02-241-0/+5
| |
* | Bump to 8.6.5dgp2016-01-282-8/+8
|/
* Improved patch formatting. No functional changefvogel2016-01-111-1/+1
|
* merged trunkfvogel2016-01-1116-330/+156
|\
| * On cygwin, install libtk8.6.dll.a in the {prefix}/lib directory.jan.nijtmans2015-11-262-2/+2
| |\
| | * On cygwin, install libtk8.5.dll.a in the {prefix}/lib directory.jan.nijtmans2015-11-262-2/+2
| | |
| * | Fix [5ee8af61e5ef8e233158a43459624f4ecf58a6fe|5ee8af61e5] on Unix: Window ↵jan.nijtmans2015-11-092-8/+17
| |\ \ | | |/ | | | | | | embedding can not work on 64-bit Unix and Windows
| | * Fix [5ee8af61e5ef8e233158a43459624f4ecf58a6fe|5ee8af61e5] on Unix: Window ↵jan.nijtmans2015-11-092-8/+17
| | | | | | | | | | | | embedding can not work on 64-bit Unix and Windows
| * | re-generate configurejan.nijtmans2015-10-251-6/+6
| |\ \ | | |/
| | * Re-generate "configure"jan.nijtmans2015-10-251-6/+6
| | |
| | * Tk/OpenBSD/Sparc needs -fPIC.stu2015-10-092-8/+8
| | |
| * | Tk/OpenBSD/Sparc needs -fPIC.stu2015-10-092-2/+2
| | |
| * | TIP #437: Tk panedwindow options for proxy windowjan.nijtmans2015-10-081-0/+1
| |\ \ | | |/
| | * Hm, better keep the TIP as it is, not making it more difficult than it ↵jan.nijtmans2015-09-301-0/+1
| | | | | | | | | | | | already is.
| | * Bring panedwindow proxy behavior in line with TIP #437 description.jan.nijtmans2015-09-301-19/+16
| | |
| | * Added -proxyborderwidth optionfvogel2015-09-301-18/+19
| | |
| | * Added -proxybackground optionfvogel2015-09-291-0/+1
| | |
| | * Bug [1247115fff] - Added -proxyrelief optionfvogel2015-07-141-0/+1
| | |
| * | Fix bug in "make dist" when system-encoding is UTF-8: eolFix will then ↵jan.nijtmans2015-06-251-5/+0
| |\ \ | | |/ | | | | | | | | | | | | translate some windows-specific files to UTF-8 too. Solution: commit those files with CRLF line-ending, which eliminates the need for eolFix altgether. See als: [495120] for the reason why eolFix was introduced in the first place. No longer needed with fossil.
| | * Fix bug in "make dist" when system-encoding is UTF-8: eolFix will then ↵jan.nijtmans2015-06-251-5/+0
| | | | | | | | | | | | | | | | | | translate some windows-specific files to UTF-8 too. Solution: commit those files with CRLF line-ending, which eliminates the need for eolFix altgether. See als: [495120] for the reason why eolFix was introduced in the first place. No longer needed with fossil.
| * | Fixed typo in commentfvogel2015-05-301-1/+1
| |\ \ | | |/
| | * Fixed typo in commentfvogel2015-05-301-1/+1
| | |
| | * Partly undo the effect of [46e08e5ab3b742bb], which didn't only update the ↵jan.nijtmans2015-05-201-4387/+7106
| | | | | | | | | | | | release date; it changed the autoconf version as well.
| | * update release datecore_8_5_18core_8_5_18_rcdgp2015-03-062-7130/+4397
| | |
| | * merge 8.5dgp2015-02-121-1/+1
| | |\
| | * | Bump to version 8.5.18.dgp2015-02-053-9/+9
| | | |
| * | | [29044ba23f] Remove RANLIB as part of library installation. At best it's ↵dgp2015-05-203-12/+4
| | | | | | | | | | | | | | | | redundant to the RANLIB already done as part of library build. At worst, it conflicts with needs of cross-compiling. Thanks Erik Leunissen.
| * | | Purge configuration efforts at supporting platforms lacking <limits.h>.dgp2015-03-246-182/+7
| | | |
| * | | merge trunkcore_8_6_4core_8_6_4_rcdgp2015-03-111-18/+4
| |\ \ \
| * | | | Bump to 8.6.4.dgp2015-02-263-9/+9
| |/ / /
| * | | Silence some compiler warnings.dgp2015-02-12