[Kst] branches/work/kst/portto4/kst/src/widgets
Adam Treat
treat at kde.org
Thu Sep 27 22:49:46 CEST 2007
SVN commit 717983 by treat:
* Style, namespace fixes
M +5 -2 curveappearancewidget.cpp
M +9 -6 curveappearancewidget.h
M +6 -3 curveplacementwidget.cpp
M +9 -6 curveplacementwidget.h
M +34 -1 vectorselector.cpp
M +10 -0 vectorselector.h
--- branches/work/kst/portto4/kst/src/widgets/curveappearancewidget.cpp #717982:717983
@@ -11,14 +11,17 @@
#include "curveappearancewidget.h"
+namespace Kst {
CurveAppearanceWidget::CurveAppearanceWidget(QWidget *parent)
- : QWidget(parent) {
+ : QWidget(parent) {
setupUi(this);
}
-CurveAppearanceWidget::~CurveAppearanceWidget() {}
+CurveAppearanceWidget::~CurveAppearanceWidget() {
+}
+}
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/widgets/curveappearancewidget.h #717982:717983
@@ -17,14 +17,17 @@
#include "kst_export.h"
-class CurveAppearanceWidget : public QWidget, public Ui::CurveAppearanceWidget {
+namespace Kst {
+
+class KST_EXPORT CurveAppearanceWidget : public QWidget, public Ui::CurveAppearanceWidget {
Q_OBJECT
+ public:
+ CurveAppearanceWidget(QWidget *parent = 0);
+ virtual ~CurveAppearanceWidget();
+};
-public:
- CurveAppearanceWidget(QWidget *parent = 0);
- ~CurveAppearanceWidget();
+}
-} KST_EXPORT;
+#endif
-#endif
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/widgets/curveplacementwidget.cpp #717982:717983
@@ -11,14 +11,17 @@
#include "curveplacementwidget.h"
+namespace Kst {
+
CurvePlacementWidget::CurvePlacementWidget(QWidget *parent)
- : QWidget(parent) {
+ : QWidget(parent) {
setupUi(this);
-
}
-CurvePlacementWidget::~CurvePlacementWidget() {}
+CurvePlacementWidget::~CurvePlacementWidget() {
+}
+}
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/widgets/curveplacementwidget.h #717982:717983
@@ -17,14 +17,17 @@
#include "kst_export.h"
-class CurvePlacementWidget : public QWidget, public Ui::CurvePlacementWidget {
+namespace Kst {
+
+class KST_EXPORT CurvePlacementWidget : public QWidget, public Ui::CurvePlacementWidget {
Q_OBJECT
+ public:
+ CurvePlacementWidget(QWidget *parent = 0);
+ virtual ~CurvePlacementWidget();
+};
-public:
- CurvePlacementWidget(QWidget *parent = 0);
- ~CurvePlacementWidget();
+}
-} KST_EXPORT;
+#endif
-#endif
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/widgets/vectorselector.cpp #717982:717983
@@ -11,10 +11,12 @@
#include "vectorselector.h"
+#include "kstdatacollection.h"
+
namespace Kst {
VectorSelector::VectorSelector(QWidget *parent)
- : QWidget(parent) {
+ : QWidget(parent), _allowEmptySelection(true) {
setupUi(this);
@@ -25,6 +27,8 @@
_newVector->setFixedSize(size + 8, size + 8);
_editVector->setFixedSize(size + 8, size + 8);
+
+ fillVectors();
}
@@ -41,6 +45,35 @@
Q_UNUSED(selectedVector);
}
+
+void VectorSelector::fillVectors() {
+ QStringList vectors;
+
+ KST::vectorList.lock().readLock();
+
+ KstVectorList::ConstIterator it = KST::vectorList.begin();
+ for (; it != KST::vectorList.end(); ++it) {
+ KstVectorPtr vector = (*it);
+ if (vector->isScalarList())
+ continue;
+
+ vector->readLock();
+ vectors << vector->tag().displayString();
+ vector->unlock();
+ }
+
+ KST::vectorList.lock().unlock();
+
+ qSort(vectors);
+
+ if (allowEmptySelection()) {
+ vectors.prepend(tr("<None>"));
+ }
+
+ _vector->clear();
+ _vector->addItems(vectors);
}
+}
+
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/widgets/vectorselector.h #717982:717983
@@ -30,8 +30,18 @@
KstVectorPtr selectedVector() const;
void setSelectedVector(KstVectorPtr selectedVector);
+ bool allowEmptySelection() const { return _allowEmptySelection; }
+ void setAllowEmptySelection(bool allowEmptySelection)
+ { _allowEmptySelection = allowEmptySelection; }
+
Q_SIGNALS:
void selectionChanged();
+
+ private:
+ void fillVectors();
+
+ private:
+ bool _allowEmptySelection;
};
}
More information about the Kst
mailing list