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
|
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
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
//! [0]
|
//! [0]
|
||||||
|
@ -48,7 +48,3 @@ QString EchoPlugin::echo(const QString &message)
|
|||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
//! [0]
|
//! [0]
|
||||||
|
|
||||||
//! [1]
|
|
||||||
Q_EXPORT_PLUGIN2(echoplugin, EchoPlugin);
|
|
||||||
//! [1]
|
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#define ECHOPLUGIN_H
|
#define ECHOPLUGIN_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QtPlugin>
|
||||||
#include "echoplugin.h"
|
#include "echoplugin.h"
|
||||||
#include "echointerface.h"
|
#include "echointerface.h"
|
||||||
|
|
||||||
@ -49,6 +50,7 @@
|
|||||||
class EchoPlugin : public QObject, EchoInterface
|
class EchoPlugin : public QObject, EchoInterface
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.EchoInterface" FILE "echoplugin.json")
|
||||||
Q_INTERFACES(EchoInterface)
|
Q_INTERFACES(EchoInterface)
|
||||||
|
|
||||||
public:
|
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
|
INCLUDEPATH += ../echowindow
|
||||||
HEADERS = echoplugin.h
|
HEADERS = echoplugin.h
|
||||||
SOURCES = echoplugin.cpp
|
SOURCES = echoplugin.cpp
|
||||||
|
OTHER_FILES += echoplugin.json
|
||||||
TARGET = $$qtLibraryTarget(echoplugin)
|
TARGET = $$qtLibraryTarget(echoplugin)
|
||||||
DESTDIR = ../plugins
|
DESTDIR = ../plugins
|
||||||
#! [0]
|
#! [0]
|
||||||
|
@ -96,14 +96,18 @@ public:
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
//! [3] //! [4]
|
//! [3] //! [4]
|
||||||
Q_DECLARE_INTERFACE(BrushInterface,
|
#define BrushInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface"
|
||||||
"com.trolltech.PlugAndPaint.BrushInterface/1.0")
|
|
||||||
|
Q_DECLARE_INTERFACE(BrushInterface, BrushInterface_iid)
|
||||||
//! [3]
|
//! [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]
|
//! [5]
|
||||||
Q_DECLARE_INTERFACE(FilterInterface,
|
#define FilterInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface"
|
||||||
"com.trolltech.PlugAndPaint.FilterInterface/1.0")
|
|
||||||
|
Q_DECLARE_INTERFACE(FilterInterface, FilterInterface_iid)
|
||||||
//! [4] //! [5]
|
//! [4] //! [5]
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -43,9 +43,7 @@
|
|||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
Q_IMPORT_PLUGIN(BasicToolsPlugin)
|
||||||
Q_IMPORT_PLUGIN(pnp_basictools)
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
{}
|
@ -4,6 +4,7 @@ CONFIG += plugin static
|
|||||||
INCLUDEPATH += ../..
|
INCLUDEPATH += ../..
|
||||||
HEADERS = basictoolsplugin.h
|
HEADERS = basictoolsplugin.h
|
||||||
SOURCES = basictoolsplugin.cpp
|
SOURCES = basictoolsplugin.cpp
|
||||||
|
OTHER_FILES += basictools.json
|
||||||
TARGET = $$qtLibraryTarget(pnp_basictools)
|
TARGET = $$qtLibraryTarget(pnp_basictools)
|
||||||
DESTDIR = ../../plugandpaint/plugins
|
DESTDIR = ../../plugandpaint/plugins
|
||||||
#! [0]
|
#! [0]
|
||||||
|
@ -189,9 +189,3 @@ QImage BasicToolsPlugin::filterImage(const QString &filter, const QImage &image,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//! [8]
|
//! [8]
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
//! [9]
|
|
||||||
Q_EXPORT_PLUGIN2(pnp_basictools, BasicToolsPlugin)
|
|
||||||
//! [9]
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QtPlugin>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
@ -57,6 +58,7 @@ class BasicToolsPlugin : public QObject,
|
|||||||
public FilterInterface
|
public FilterInterface
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface" FILE "basictools.json")
|
||||||
Q_INTERFACES(BrushInterface ShapeInterface FilterInterface)
|
Q_INTERFACES(BrushInterface ShapeInterface FilterInterface)
|
||||||
//! [0]
|
//! [0]
|
||||||
|
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
{}
|
@ -4,6 +4,7 @@ CONFIG += plugin
|
|||||||
INCLUDEPATH += ../..
|
INCLUDEPATH += ../..
|
||||||
HEADERS = extrafiltersplugin.h
|
HEADERS = extrafiltersplugin.h
|
||||||
SOURCES = extrafiltersplugin.cpp
|
SOURCES = extrafiltersplugin.cpp
|
||||||
|
OTHER_FILES += extrafilters.json
|
||||||
TARGET = $$qtLibraryTarget(pnp_extrafilters)
|
TARGET = $$qtLibraryTarget(pnp_extrafilters)
|
||||||
DESTDIR = ../../plugandpaint/plugins
|
DESTDIR = ../../plugandpaint/plugins
|
||||||
|
|
||||||
|
@ -120,5 +120,3 @@ QImage ExtraFiltersPlugin::filterImage(const QString &filter,
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(pnp_extrafilters, ExtraFiltersPlugin)
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
//! [0]
|
//! [0]
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QtPlugin>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
|
|
||||||
@ -51,6 +52,7 @@
|
|||||||
class ExtraFiltersPlugin : public QObject, public FilterInterface
|
class ExtraFiltersPlugin : public QObject, public FilterInterface
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface" FILE "extrafilters.json")
|
||||||
Q_INTERFACES(FilterInterface)
|
Q_INTERFACES(FilterInterface)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -5,6 +5,7 @@ HEADERS = simplestyle.h \
|
|||||||
simplestyleplugin.h
|
simplestyleplugin.h
|
||||||
SOURCES = simplestyle.cpp \
|
SOURCES = simplestyle.cpp \
|
||||||
simplestyleplugin.cpp
|
simplestyleplugin.cpp
|
||||||
|
OTHER_FILES += simplestyle.json
|
||||||
TARGET = simplestyleplugin
|
TARGET = simplestyleplugin
|
||||||
#! [0]
|
#! [0]
|
||||||
win32 {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
//! [1]
|
//! [1]
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
Q_EXPORT_PLUGIN2(simplestyleplugin, SimpleStylePlugin)
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
@ -52,9 +52,10 @@ QT_END_NAMESPACE
|
|||||||
class SimpleStylePlugin : public QStylePlugin
|
class SimpleStylePlugin : public QStylePlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "simplestyle.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SimpleStylePlugin() {};
|
SimpleStylePlugin() {}
|
||||||
|
|
||||||
QStringList keys() const;
|
QStringList keys() const;
|
||||||
QStyle *create(const QString &key);
|
QStyle *create(const QString &key);
|
||||||
|
@ -61,6 +61,9 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class AccessibleFactory : public QAccessiblePlugin
|
class AccessibleFactory : public QAccessiblePlugin
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QAccessibleFactoryInterface" FILE "widgets.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AccessibleFactory();
|
AccessibleFactory();
|
||||||
|
|
||||||
@ -109,7 +112,6 @@ QStringList AccessibleFactory::keys() const
|
|||||||
list << QLatin1String("QStatusBar");
|
list << QLatin1String("QStatusBar");
|
||||||
list << QLatin1String("QProgressBar");
|
list << QLatin1String("QProgressBar");
|
||||||
list << QLatin1String("QMenuBar");
|
list << QLatin1String("QMenuBar");
|
||||||
list << QLatin1String("Q3PopupMenu");
|
|
||||||
list << QLatin1String("QMenu");
|
list << QLatin1String("QMenu");
|
||||||
list << QLatin1String("QHeaderView");
|
list << QLatin1String("QHeaderView");
|
||||||
list << QLatin1String("QTabBar");
|
list << QLatin1String("QTabBar");
|
||||||
@ -251,8 +253,6 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
|
|||||||
#ifndef QT_NO_MENU
|
#ifndef QT_NO_MENU
|
||||||
} else if (classname == QLatin1String("QMenu")) {
|
} else if (classname == QLatin1String("QMenu")) {
|
||||||
iface = new QAccessibleMenu(widget);
|
iface = new QAccessibleMenu(widget);
|
||||||
} else if (classname == QLatin1String("Q3PopupMenu")) {
|
|
||||||
iface = new QAccessibleMenu(widget);
|
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_ITEMVIEWS
|
#ifndef QT_NO_ITEMVIEWS
|
||||||
} else if (classname == QLatin1String("QAbstractItemView")) {
|
} else if (classname == QLatin1String("QAbstractItemView")) {
|
||||||
@ -345,9 +345,9 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
|
|||||||
return iface;
|
return iface;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_STATIC_PLUGIN(AccessibleFactory)
|
|
||||||
Q_EXPORT_PLUGIN2(qtaccessiblewidgets, AccessibleFactory)
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#include "main.moc"
|
||||||
|
|
||||||
#endif // QT_NO_ACCESSIBILITY
|
#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
|
class QWindowsPrinterSupportPlugin : public QPlatformPrinterSupportPlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.QPlatformPrinterSupportFactoryInterface" FILE "windows.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QStringList keys() const;
|
QStringList keys() const;
|
||||||
QPlatformPrinterSupport *create(const QString &);
|
QPlatformPrinterSupport *create(const QString &);
|
||||||
@ -67,8 +69,6 @@ QPlatformPrinterSupport *QWindowsPrinterSupportPlugin::create(const QString &key
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2(windowsprint, QWindowsPrinterSupportPlugin)
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#include "main.moc"
|
#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 += \
|
HEADERS += \
|
||||||
qwindowsprintersupport.h
|
qwindowsprintersupport.h
|
||||||
|
|
||||||
|
OTHER_FILES += windows.json
|
||||||
|
|
||||||
target.path += $$[QT_INSTALL_PLUGINS]/printsupport
|
target.path += $$[QT_INSTALL_PLUGINS]/printsupport
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
LIBS += -lWinspool -lComdlg32
|
LIBS += -lWinspool -lComdlg32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user