[Kst] branches/work/kst/portto4/kst/src
Adam Treat
treat at kde.org
Fri Sep 21 21:57:59 CEST 2007
SVN commit 715309 by treat:
* Add a bunch of new widgets so that we can port
over the vector dialog for creating new vectors.
* ComboxBox ... this is a placeholder for what will
eventually be a completion enabled combo.
* DataRange ... this is a port of the KstDataRange class
* FileRequester ... we no longer have KUrlRequester so
this is a replacement.
A libkstapp/vectordialog.ui
M +15 -15 widgets/colorbutton.h
A widgets/combobox.cpp [License: GPL (v2+)]
A widgets/combobox.h [License: GPL (v2+)]
A widgets/datarange.cpp [License: GPL (v2+)]
A widgets/datarange.h [License: GPL (v2+)]
A widgets/datarange.ui
A widgets/filerequester.cpp [License: GPL (v2+)]
A widgets/filerequester.h [License: GPL (v2+)]
M +3 -0 widgets/kstwidgets.cpp
M +42 -0 widgets/kstwidgets.h
M +12 -0 widgets/widgets.pro
--- branches/work/kst/portto4/kst/src/widgets/colorbutton.h #715308:715309
@@ -21,27 +21,27 @@
class KST_EXPORT ColorButton : public QToolButton {
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor USER true)
-public:
- ColorButton(QWidget *parent = 0);
- ColorButton(const QColor &color, QWidget *parent = 0);
- virtual ~ColorButton();
+ public:
+ ColorButton(QWidget *parent = 0);
+ ColorButton(const QColor &color, QWidget *parent = 0);
+ virtual ~ColorButton();
- QColor color() const;
+ QColor color() const;
-public Q_SLOTS:
- void setColor(const QColor &color);
+ public Q_SLOTS:
+ void setColor(const QColor &color);
-Q_SIGNALS:
- void changed(const QColor &color);
+ Q_SIGNALS:
+ void changed(const QColor &color);
-protected:
- virtual void paintEvent(QPaintEvent *event);
+ protected:
+ virtual void paintEvent(QPaintEvent *event);
-private Q_SLOTS:
- void chooseColor();
+ private Q_SLOTS:
+ void chooseColor();
-private:
- QColor _color;
+ private:
+ QColor _color;
};
}
--- branches/work/kst/portto4/kst/src/widgets/kstwidgets.cpp #715308:715309
@@ -15,6 +15,9 @@
: QObject(parent) {
_plugins.append(new ColorButtonPlugin(this));
_plugins.append(new GradientEditorPlugin(this));
+ _plugins.append(new FileRequesterPlugin(this));
+ _plugins.append(new ComboBoxPlugin(this));
+ _plugins.append(new DataRangePlugin(this));
}
Q_EXPORT_PLUGIN2(kstwidgets, KstWidgets)
--- branches/work/kst/portto4/kst/src/widgets/kstwidgets.h #715308:715309
@@ -96,7 +96,49 @@
}
};
+#include "filerequester.h"
+class FileRequesterPlugin : public KstWidgetPlugin {
+ Q_OBJECT
+ Q_INTERFACES(QDesignerCustomWidgetInterface)
+public:
+ FileRequesterPlugin(QObject *parent = 0) : KstWidgetPlugin(parent) {}
+ QString name() const {
+ return QLatin1String("Kst::FileRequester");
+ } //do not translate
+ QWidget *createWidget(QWidget *parent) {
+ return new Kst::FileRequester(parent);
+ }
+};
+#include "combobox.h"
+class ComboBoxPlugin : public KstWidgetPlugin {
+ Q_OBJECT
+ Q_INTERFACES(QDesignerCustomWidgetInterface)
+public:
+ ComboBoxPlugin(QObject *parent = 0) : KstWidgetPlugin(parent) {}
+ QString name() const {
+ return QLatin1String("Kst::ComboBox");
+ } //do not translate
+ QWidget *createWidget(QWidget *parent) {
+ return new Kst::ComboBox(parent);
+ }
+};
+
+#include "datarange.h"
+class DataRangePlugin : public KstWidgetPlugin {
+ Q_OBJECT
+ Q_INTERFACES(QDesignerCustomWidgetInterface)
+public:
+ DataRangePlugin(QObject *parent = 0) : KstWidgetPlugin(parent) {}
+ QString name() const {
+ return QLatin1String("Kst::DataRange");
+ } //do not translate
+ QWidget *createWidget(QWidget *parent) {
+ return new Kst::DataRange(parent);
+ }
+};
+
+
class KstWidgets : public QObject, public QDesignerCustomWidgetCollectionInterface {
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
--- branches/work/kst/portto4/kst/src/widgets/widgets.pro #715308:715309
@@ -22,9 +22,21 @@
SOURCES += \
kstwidgets.cpp \
colorbutton.cpp \
+ combobox.cpp \
+ datarange.cpp \
+ filerequester.cpp \
gradienteditor.cpp
HEADERS += \
colorbutton.h \
+ combobox.h \
+ datarange.h \
+ filerequester.h \
gradienteditor.h \
kstwidgets.h
+
+FORMS += \
+ datarange.ui
+
+RESOURCES += \
+ $$TOPLEVELDIR/src/images/images.qrc
More information about the Kst
mailing list