Use new plugin system in qtbase.
- AccessibleWidgets - Windows printer support - Examples Change-Id: Icc162bd7fc284b3c76d9966210f983728085c743 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
parent
6df396286a
commit
efde205586
@ -53,8 +53,10 @@ public:
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
Q_DECLARE_INTERFACE(EchoInterface,
|
||||
"com.trolltech.Plugin.EchoInterface/1.0");
|
||||
|
||||
#define EchoInterface_iid "org.qt-project.Qt.Examples.EchoInterface"
|
||||
|
||||
Q_DECLARE_INTERFACE(EchoInterface, EchoInterface_iid)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
//! [0]
|
||||
|
@ -48,7 +48,3 @@ QString EchoPlugin::echo(const QString &message)
|
||||
return message;
|
||||
}
|
||||
//! [0]
|
||||
|
||||
//! [1]
|
||||
Q_EXPORT_PLUGIN2(echoplugin, EchoPlugin);
|
||||
//! [1]
|
||||
|
@ -42,6 +42,7 @@
|
||||
#define ECHOPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtPlugin>
|
||||
#include "echoplugin.h"
|
||||
#include "echointerface.h"
|
||||
|
||||
@ -49,6 +50,7 @@
|
||||
class EchoPlugin : public QObject, EchoInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.EchoInterface" FILE "echoplugin.json")
|
||||
Q_INTERFACES(EchoInterface)
|
||||
|
||||
public:
|
||||
|
1
examples/tools/echoplugin/plugin/echoplugin.json
Normal file
1
examples/tools/echoplugin/plugin/echoplugin.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
@ -4,6 +4,7 @@ CONFIG += plugin
|
||||
INCLUDEPATH += ../echowindow
|
||||
HEADERS = echoplugin.h
|
||||
SOURCES = echoplugin.cpp
|
||||
OTHER_FILES += echoplugin.json
|
||||
TARGET = $$qtLibraryTarget(echoplugin)
|
||||
DESTDIR = ../plugins
|
||||
#! [0]
|
||||
|
@ -96,14 +96,18 @@ public:
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
//! [3] //! [4]
|
||||
Q_DECLARE_INTERFACE(BrushInterface,
|
||||
"com.trolltech.PlugAndPaint.BrushInterface/1.0")
|
||||
#define BrushInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface"
|
||||
|
||||
Q_DECLARE_INTERFACE(BrushInterface, BrushInterface_iid)
|
||||
//! [3]
|
||||
Q_DECLARE_INTERFACE(ShapeInterface,
|
||||
"com.trolltech.PlugAndPaint.ShapeInterface/1.0")
|
||||
|
||||
#define ShapeInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.ShapeInterface"
|
||||
|
||||
Q_DECLARE_INTERFACE(ShapeInterface, ShapeInterface_iid)
|
||||
//! [5]
|
||||
Q_DECLARE_INTERFACE(FilterInterface,
|
||||
"com.trolltech.PlugAndPaint.FilterInterface/1.0")
|
||||
#define FilterInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface"
|
||||
|
||||
Q_DECLARE_INTERFACE(FilterInterface, FilterInterface_iid)
|
||||
//! [4] //! [5]
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
@ -43,9 +43,7 @@
|
||||
#include <QtPlugin>
|
||||
#include <QApplication>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
Q_IMPORT_PLUGIN(pnp_basictools)
|
||||
QT_END_NAMESPACE
|
||||
Q_IMPORT_PLUGIN(BasicToolsPlugin)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -0,0 +1 @@
|
||||
{}
|
@ -4,6 +4,7 @@ CONFIG += plugin static
|
||||
INCLUDEPATH += ../..
|
||||
HEADERS = basictoolsplugin.h
|
||||
SOURCES = basictoolsplugin.cpp
|
||||
OTHER_FILES += basictools.json
|
||||
TARGET = $$qtLibraryTarget(pnp_basictools)
|
||||
DESTDIR = ../../plugandpaint/plugins
|
||||
#! [0]
|
||||
|
@ -189,9 +189,3 @@ QImage BasicToolsPlugin::filterImage(const QString &filter, const QImage &image,
|
||||
return result;
|
||||
}
|
||||
//! [8]
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
//! [9]
|
||||
Q_EXPORT_PLUGIN2(pnp_basictools, BasicToolsPlugin)
|
||||
//! [9]
|
||||
QT_END_NAMESPACE
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
#include <QRect>
|
||||
#include <QObject>
|
||||
#include <QtPlugin>
|
||||
#include <QStringList>
|
||||
#include <QPainterPath>
|
||||
#include <QImage>
|
||||
@ -57,6 +58,7 @@ class BasicToolsPlugin : public QObject,
|
||||
public FilterInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface" FILE "basictools.json")
|
||||
Q_INTERFACES(BrushInterface ShapeInterface FilterInterface)
|
||||
//! [0]
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
{}
|
@ -4,6 +4,7 @@ CONFIG += plugin
|
||||
INCLUDEPATH += ../..
|
||||
HEADERS = extrafiltersplugin.h
|
||||
SOURCES = extrafiltersplugin.cpp
|
||||
OTHER_FILES += extrafilters.json
|
||||
TARGET = $$qtLibraryTarget(pnp_extrafilters)
|
||||
DESTDIR = ../../plugandpaint/plugins
|
||||
|
||||
|
@ -120,5 +120,3 @@ QImage ExtraFiltersPlugin::filterImage(const QString &filter,
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2(pnp_extrafilters, ExtraFiltersPlugin)
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
//! [0]
|
||||
#include <QObject>
|
||||
#include <QtPlugin>
|
||||
#include <QStringList>
|
||||
#include <QImage>
|
||||
|
||||
@ -51,6 +52,7 @@
|
||||
class ExtraFiltersPlugin : public QObject, public FilterInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface" FILE "extrafilters.json")
|
||||
Q_INTERFACES(FilterInterface)
|
||||
|
||||
public:
|
||||
|
@ -5,6 +5,7 @@ HEADERS = simplestyle.h \
|
||||
simplestyleplugin.h
|
||||
SOURCES = simplestyle.cpp \
|
||||
simplestyleplugin.cpp
|
||||
OTHER_FILES += simplestyle.json
|
||||
TARGET = simplestyleplugin
|
||||
#! [0]
|
||||
win32 {
|
||||
|
3
examples/tools/styleplugin/plugin/simplestyle.json
Normal file
3
examples/tools/styleplugin/plugin/simplestyle.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"Keys": [ "simplestyle" ]
|
||||
}
|
@ -58,7 +58,3 @@ QStyle *SimpleStylePlugin::create(const QString &key)
|
||||
return 0;
|
||||
}
|
||||
//! [1]
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
Q_EXPORT_PLUGIN2(simplestyleplugin, SimpleStylePlugin)
|
||||
QT_END_NAMESPACE
|
||||
|
@ -52,9 +52,10 @@ QT_END_NAMESPACE
|
||||
class SimpleStylePlugin : public QStylePlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "simplestyle.json")
|
||||
|
||||
public:
|
||||
SimpleStylePlugin() {};
|
||||
SimpleStylePlugin() {}
|
||||
|
||||
QStringList keys() const;
|
||||
QStyle *create(const QString &key);
|
||||
|
@ -61,6 +61,9 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
class AccessibleFactory : public QAccessiblePlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QAccessibleFactoryInterface" FILE "widgets.json")
|
||||
|
||||
public:
|
||||
AccessibleFactory();
|
||||
|
||||
@ -109,7 +112,6 @@ QStringList AccessibleFactory::keys() const
|
||||
list << QLatin1String("QStatusBar");
|
||||
list << QLatin1String("QProgressBar");
|
||||
list << QLatin1String("QMenuBar");
|
||||
list << QLatin1String("Q3PopupMenu");
|
||||
list << QLatin1String("QMenu");
|
||||
list << QLatin1String("QHeaderView");
|
||||
list << QLatin1String("QTabBar");
|
||||
@ -251,8 +253,6 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
|
||||
#ifndef QT_NO_MENU
|
||||
} else if (classname == QLatin1String("QMenu")) {
|
||||
iface = new QAccessibleMenu(widget);
|
||||
} else if (classname == QLatin1String("Q3PopupMenu")) {
|
||||
iface = new QAccessibleMenu(widget);
|
||||
#endif
|
||||
#ifndef QT_NO_ITEMVIEWS
|
||||
} else if (classname == QLatin1String("QAbstractItemView")) {
|
||||
@ -345,9 +345,9 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
|
||||
return iface;
|
||||
}
|
||||
|
||||
Q_EXPORT_STATIC_PLUGIN(AccessibleFactory)
|
||||
Q_EXPORT_PLUGIN2(qtaccessiblewidgets, AccessibleFactory)
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "main.moc"
|
||||
|
||||
#endif // QT_NO_ACCESSIBILITY
|
||||
|
52
src/plugins/accessible/widgets/widgets.json
Normal file
52
src/plugins/accessible/widgets/widgets.json
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"Keys": [
|
||||
"QLineEdit",
|
||||
"QComboBox",
|
||||
"QAbstractSpinBox",
|
||||
"QSpinBox",
|
||||
"QDoubleSpinBox",
|
||||
"QScrollBar",
|
||||
"QSlider",
|
||||
"QAbstractSlider",
|
||||
"QToolButton",
|
||||
"QCheckBox",
|
||||
"QRadioButton",
|
||||
"QPushButton",
|
||||
"QAbstractButton",
|
||||
"QDialog",
|
||||
"QMessageBox",
|
||||
"QMainWindow",
|
||||
"QLabel",
|
||||
"QLCDNumber",
|
||||
"QGroupBox",
|
||||
"QStatusBar",
|
||||
"QProgressBar",
|
||||
"QMenuBar",
|
||||
"QMenu",
|
||||
"QHeaderView",
|
||||
"QTabBar",
|
||||
"QToolBar",
|
||||
"QWorkspaceChild",
|
||||
"QSizeGrip",
|
||||
"QAbstractItemView",
|
||||
"QWidget",
|
||||
"QSplitter",
|
||||
"QSplitterHandle",
|
||||
"QTextEdit",
|
||||
"QTipLabel",
|
||||
"QFrame",
|
||||
"QStackedWidget",
|
||||
"QToolBox",
|
||||
"QMdiArea",
|
||||
"QMdiSubWindow",
|
||||
"QWorkspace",
|
||||
"QDialogButtonBox",
|
||||
"QDial",
|
||||
"QRubberBand",
|
||||
"QTextBrowser",
|
||||
"QAbstractScrollArea",
|
||||
"QScrollArea",
|
||||
"QCalendarWidget",
|
||||
"QDockWidget",
|
||||
"QAccessibleWidget" ]
|
||||
}
|
@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE
|
||||
class QWindowsPrinterSupportPlugin : public QPlatformPrinterSupportPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.QPlatformPrinterSupportFactoryInterface" FILE "windows.json")
|
||||
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformPrinterSupport *create(const QString &);
|
||||
@ -67,8 +69,6 @@ QPlatformPrinterSupport *QWindowsPrinterSupportPlugin::create(const QString &key
|
||||
return 0;
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2(windowsprint, QWindowsPrinterSupportPlugin)
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "main.moc"
|
||||
|
3
src/plugins/printsupport/windows/windows.json
Normal file
3
src/plugins/printsupport/windows/windows.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"Keys": [ "windowsprintsupport" ]
|
||||
}
|
@ -15,6 +15,8 @@ SOURCES += \
|
||||
HEADERS += \
|
||||
qwindowsprintersupport.h
|
||||
|
||||
OTHER_FILES += windows.json
|
||||
|
||||
target.path += $$[QT_INSTALL_PLUGINS]/printsupport
|
||||
INSTALLS += target
|
||||
LIBS += -lWinspool -lComdlg32
|
||||
|
Loading…
x
Reference in New Issue
Block a user