Changeset 556 for branches/vendor/nokia/qt/current/demos/arthurplugin
- Timestamp:
- Feb 10, 2010, 12:52:55 AM (16 years ago)
- Location:
- branches/vendor/nokia/qt/current/demos/arthurplugin
- Files:
-
- 2 edited
-
arthurplugin.pro (modified) (1 diff)
-
plugin.cpp (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/vendor/nokia/qt/current/demos/arthurplugin/arthurplugin.pro
r2 r556 45 45 INSTALLS += target sources 46 46 47 48 47 49 win32-msvc* { 48 50 QMAKE_CFLAGS += /Zm500 -
branches/vendor/nokia/qt/current/demos/arthurplugin/plugin.cpp
r2 r556 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the demonstration applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 56 56 QT_FORWARD_DECLARE_CLASS(QDesignerFormEditorInterface) 57 57 58 static inline QString customWidgetDomXml(const QString &className) 58 // Specify "text" to be a singleline property (no richtext) 59 static inline QString textSingleLinePropertyDeclaration(const QString &className) 60 { 61 QString rc = QLatin1String( 62 "<customwidgets>\n" 63 " <customwidget>\n" 64 " <class>"); 65 rc += className; 66 rc += QLatin1String("</class>\n" 67 " <propertyspecifications>\n" 68 " <stringpropertyspecification name=\"text\" type=\"singleline\"/>\n" 69 " </propertyspecifications>\n" 70 " </customwidget>\n" 71 "</customwidgets>\n"); 72 return rc; 73 } 74 75 // Plain XML for a custom widget 76 static inline QString customWidgetDomXml(const QString &className, 77 const QString &customSection = QString()) 59 78 { 60 79 QString rc = QLatin1String("<ui language=\"c++\"><widget class=\""); … … 64 83 objectName[0] = objectName.at(0).toLower(); 65 84 rc += objectName; 66 rc += QLatin1String("\"/></ui>"); 85 rc += QLatin1String("\"/>"); 86 rc += customSection; 87 rc += QLatin1String("</ui>"); 67 88 return rc; 68 89 } … … 81 102 82 103 protected: 83 DemoPlugin(const QString &className);104 ); 84 105 85 106 public: … … 106 127 }; 107 128 108 DemoPlugin::DemoPlugin(const QString &className ) :129 DemoPlugin::DemoPlugin(const QString &className) : 109 130 m_className(className), 110 m_domXml(customWidgetDomXml(className )),131 m_domXml(customWidgetDomXml(className)), 111 132 m_initialized(false) 112 133 { … … 118 139 119 140 public: 120 DeformPlugin(QObject *parent = 0) : QObject(parent), DemoPlugin(QLatin1String("PathDeformRendererEx")) { }121 QString includeFile() const { return "deform.h"; }141 142 QString includeFile() const { return ; } 122 143 123 144 QWidget *createWidget(QWidget *parent) … … 127 148 deform->setAnimated(false); 128 149 deform->setFontSize(20); 129 deform->setText( "Arthur Widgets Demo");150 deform->setText(); 130 151 131 152 return deform; … … 133 154 }; 134 155 156 157 158 159 160 161 162 135 163 class XFormRendererEx : public XFormView 136 164 { … … 145 173 Q_OBJECT 146 174 public: 147 XFormPlugin(QObject *parent = 0) : QObject(parent), DemoPlugin(QLatin1String("XFormRendererEx")) { }148 QString includeFile() const { return "xform.h"; }175 176 QString includeFile() const { return ; } 149 177 150 178 QWidget *createWidget(QWidget *parent) 151 179 { 152 180 XFormRendererEx *xform = new XFormRendererEx(parent); 153 xform->setText( "Qt - Hello World!!");154 xform->setPixmap(QPixmap( ":/trolltech/arthurplugin/bg1.jpg"));181 xform->setText(); 182 xform->setPixmap(QPixmap()); 155 183 return xform; 156 184 } 157 185 }; 158 186 187 188 189 190 191 192 159 193 160 194 class GradientEditorPlugin : public QObject, public DemoPlugin … … 162 196 Q_OBJECT 163 197 public: 164 GradientEditorPlugin(QObject *parent = 0) : QObject(parent), DemoPlugin(QLatin1String("GradientEditor")) { }198 GradientEditorPlugin(QObject *parent = 0) : QObject(parent), DemoPlugin(QLatin1String("GradientEditor")) { } 165 199 QString includeFile() const { return "gradients.h"; } 166 200 … … 185 219 public: 186 220 GradientRendererPlugin(QObject *parent = 0) : QObject(parent), DemoPlugin(QLatin1String("GradientRendererEx")) { } 187 QString includeFile() const { return "gradients.h"; }221 QString includeFile() const { return ; } 188 222 189 223 QWidget *createWidget(QWidget *parent) … … 199 233 Q_OBJECT 200 234 public: 201 PathStrokeRendererEx(QWidget *p) : PathStrokeRenderer(p) { }235 PathStrokeRendererEx(QWidget *p) : PathStrokeRenderer(p) { } 202 236 QSize sizeHint() const { return QSize(300, 200); } 203 237 }; … … 207 241 Q_OBJECT 208 242 public: 209 StrokeRenderPlugin(QObject *parent = 0) : QObject(parent), DemoPlugin(QLatin1String("PathStrokeRendererEx")) { }210 QString includeFile() const { return "pathstroke.h"; }243 StrokeRenderPlugin(QObject *parent = 0) : QObject(parent), DemoPlugin(QLatin1String("PathStrokeRendererEx")) { } 244 QString includeFile() const { return ; } 211 245 212 246 QWidget *createWidget(QWidget *parent) … … 222 256 Q_OBJECT 223 257 public: 224 CompositionModePlugin(QObject *parent = 0) : QObject(parent), DemoPlugin(QLatin1String("CompositionRenderer")) { }225 QString includeFile() const { return "composition.h"; }258 CompositionModePlugin(QObject *parent = 0) : QObject(parent), DemoPlugin(QLatin1String("CompositionRenderer")) { } 259 QString includeFile() const { return ; } 226 260 227 261 QWidget *createWidget(QWidget *parent) … … 240 274 241 275 public: 242 ArthurPlugins(QObject *parent = 0);276 ArthurPlugins(QObject *parent = 0); 243 277 QList<QDesignerCustomWidgetInterface*> customWidgets() const { return m_plugins; } 244 278
Note:
See TracChangeset
for help on using the changeset viewer.
