[Kst] branches/work/kst/portto4/kst/src/widgets
Adam Treat
treat at kde.org
Wed Feb 28 01:21:11 CET 2007
SVN commit 637861 by treat:
* And the various selectors build now too. I renamed
a class to make it more consistent.
M +15 -14 CMakeLists.txt
A comboboxselection.cpp comboboxselection_i.cpp#637782 [License: GPL (v2+)]
A comboboxselection.h comboboxselection_i.h#637782 [License: GPL (v2+)]
D comboboxselection_i.cpp
D comboboxselection_i.h
M +13 -12 kstcombobox.cpp
M +2 -2 kstcombobox.h
M +5 -0 matrixselector.h
A scalareditor.cpp [License: GPL (v2+)]
A scalareditor.h [License: GPL (v2+)]
M +8 -7 scalarselector.cpp
M +5 -0 scalarselector.h
M +1 -1 scalarselector4.ui
A stringeditor.cpp [License: GPL (v2+)]
A stringeditor.h [License: GPL (v2+)]
M +7 -6 stringselector.cpp
M +5 -0 stringselector.h
M +1 -1 stringselector4.ui
M +5 -0 vectorselector.h
--- branches/work/kst/portto4/kst/src/widgets/CMakeLists.txt #637860:637861
@@ -8,42 +8,43 @@
kstwidgets.cpp
colorpalettewidget.cpp
+ comboboxselection.cpp
curveappearancewidget.cpp
curveplacementwidget.cpp
datarangewidget.cpp
editmultiplewidget.cpp
fftoptionswidget.cpp
-# matrixselector.cpp
-# scalarselector.cpp
-# stringselector.cpp
-# vectorselector.cpp
+ matrixselector.cpp
+ scalareditor.cpp
+ scalarselector.cpp
+ stringeditor.cpp
+ stringselector.cpp
+ vectorselector.cpp
# kstbackbuffer.cpp
-# comboboxselection_i.cpp
# draggablelistbox.cpp
# draggablelistview.cpp
# plotlistbox.cpp
# vectorlistview.cpp
-# kstcombobox.cpp
+ kstcombobox.cpp
)
kde4_automoc(${kstwidgets_LIB_SRCS})
kde4_add_ui_files(kstwidgets_LIB_SRCS
colorpalettewidget4.ui
+ comboboxselection4.ui
curveappearancewidget4.ui
curveplacementwidget4.ui
datarangewidget4.ui
editmultiplewidget4.ui
fftoptionswidget4.ui
-# matrixselector4.ui
-# scalarselector4.ui
-# stringselector4.ui
-# vectorselector4.ui
-
-# comboboxselection4.ui
-# stringeditor4.ui
-# scalareditor4.ui
+ matrixselector4.ui
+ scalareditor4.ui
+ scalarselector4.ui
+ stringeditor4.ui
+ stringselector4.ui
+ vectorselector4.ui
)
kde4_add_library(kstwidgets SHARED ${kstwidgets_LIB_SRCS})
--- branches/work/kst/portto4/kst/src/widgets/kstcombobox.cpp #637860:637861
@@ -16,18 +16,19 @@
***************************************************************************/
#include "kstcombobox.h"
-//Added by qt3to4:
+
+#include <QLineEdit>
#include <QFocusEvent>
-KstComboBox::KstComboBox(QWidget *parent, const char *name)
- : KComboBox(parent, name), _trueRW(false) {
+KstComboBox::KstComboBox(QWidget *parent)
+ : KComboBox(parent), _trueRW(false) {
commonConstructor();
}
-KstComboBox::KstComboBox(bool rw, QWidget *parent, const char *name)
- : KComboBox(false, parent, name), _trueRW(rw) {
+KstComboBox::KstComboBox(bool rw, QWidget *parent)
+ : KComboBox(false, parent), _trueRW(rw) {
commonConstructor();
}
@@ -45,7 +46,7 @@
QComboBox::setEditable( true );
if (!_trueRW) { //if not truly read write then go into psuedo mode for read only
- setInsertionPolicy( NoInsertion );
+ setInsertPolicy( NoInsert );
setCompletionMode( KGlobalSettings::CompletionPopupAuto );
//DON'T HANDLE THE EDIT'S RETURNPRESSED IN qcombobox.cpp... RATHER HANDLE HERE!
@@ -64,7 +65,7 @@
if (KCompletion *comp = completionObject()) {
comp->clear();
for (int i = 0; i < count(); ++i) {
- comp->addItem(text(i));
+ comp->addItem(itemText(i));
}
}
}
@@ -88,19 +89,19 @@
if (!_trueRW) {
int match = -1;
for (int i = 0; i < count(); ++i) {
- match = currentText() == text(i) ? i : match;
+ match = currentText() == itemText(i) ? i : match;
}
if (match < 0 && count()) {
lineEdit()->blockSignals(true);
- lineEdit()->setText( text(currentItem()) );
+ lineEdit()->setText( itemText(currentIndex()) );
lineEdit()->blockSignals(false);
- } else if (match != currentItem() || rp) {
- setCurrentItem(match);
+ } else if (match != currentIndex() || rp) {
+ setCurrentIndex(match);
emit activated(match);
- emit activated(text(match));
+ emit activated(itemText(match));
}
}
}
--- branches/work/kst/portto4/kst/src/widgets/kstcombobox.h #637860:637861
@@ -34,8 +34,8 @@
class KstComboBox : public KComboBox {
Q_OBJECT
public:
- KstComboBox(QWidget *parent=0, const char *name=0);
- KstComboBox(bool rw, QWidget *parent=0, const char *name=0);
+ KstComboBox(QWidget *parent=0);
+ KstComboBox(bool rw, QWidget *parent=0);
void setEditable(bool rw);
virtual ~KstComboBox();
--- branches/work/kst/portto4/kst/src/widgets/matrixselector.h #637860:637861
@@ -42,6 +42,11 @@
void editMatrix();
void setEdit(const QString &tag);
+signals:
+ void newMatrixCreated(const QString &);
+ void selectionChanged(const QString &);
+ void selectionChangedLabel(const QString &label);
+
private:
void init();
--- branches/work/kst/portto4/kst/src/widgets/scalarselector.cpp #637860:637861
@@ -17,6 +17,10 @@
#include "scalarselector.h"
+#include "kstcombobox.h"
+#include "scalareditor.h"
+#include "comboboxselection.h"
+
#include <QTimer>
#include <QLineEdit>
#include <QValidator>
@@ -26,10 +30,7 @@
#include <kmessagebox.h>
#include <kiconloader.h>
-#include <comboboxselection_i.h>
#include <kstdatacollection.h>
-#include <kstcombobox.h>
-#include <scalareditor.h>
#include <enodes.h>
#include <kst_export.h>
@@ -95,7 +96,7 @@
_scalar->setItemText(_scalar->currentIndex(), prev);
} else {
_scalar->addItem("0");
- _scalar->setItemText(_scalar->currentIndex(), ("0");
+ _scalar->setItemText(_scalar->currentIndex(), "0");
_editScalar->setEnabled(false);
}
@@ -104,7 +105,7 @@
void ScalarSelector::createNewScalar() {
- ScalarEditor *se = new ScalarEditor(this, "scalar editor");
+ ScalarEditor *se = new ScalarEditor(this);
int rc = se->exec();
if (rc == QDialog::Accepted) {
@@ -134,7 +135,7 @@
void ScalarSelector::selectScalar() {
- ComboBoxSelectionI *selection = new ComboBoxSelectionI(this, "scalar selector");
+ ComboBoxSelection *selection = new ComboBoxSelection(this);
int i;
selection->reset();
@@ -152,7 +153,7 @@
void ScalarSelector::editScalar() {
- ScalarEditor *se = new ScalarEditor(this, "scalar editor");
+ ScalarEditor *se = new ScalarEditor(this);
KstScalarPtr pold = *KST::scalarList.findTag(_scalar->currentText());
if (pold && pold->editable()) {
--- branches/work/kst/portto4/kst/src/widgets/scalarselector.h #637860:637861
@@ -41,6 +41,11 @@
void setSelection(KstScalarPtr s);
void allowDirectEntry(bool allowed);
+signals:
+ void newScalarCreated();
+ void selectionChanged(const QString &);
+ void selectionChangedLabel(const QString &);
+
private:
void init();
};
--- branches/work/kst/portto4/kst/src/widgets/scalarselector4.ui #637860:637861
@@ -100,7 +100,7 @@
<tabstop>_editScalar</tabstop>
</tabstops>
<includes>
- <include location="local" >comboboxselection_i.h</include>
+ <include location="local" >comboboxselection.h</include>
<include location="local" >kstdatacollection.h</include>
<include location="local" >kstcombobox.h</include>
<include location="global" >kst_export.h</include>
--- branches/work/kst/portto4/kst/src/widgets/stringselector.cpp #637860:637861
@@ -17,6 +17,10 @@
#include "stringselector.h"
+#include "kstcombobox.h"
+#include "stringeditor.h"
+#include "comboboxselection.h"
+
#include <QTimer>
#include <QLineEdit>
#include <QValidator>
@@ -26,10 +30,7 @@
#include <kmessagebox.h>
#include <kiconloader.h>
-#include <comboboxselection_i.h>
#include <kstdatacollection.h>
-#include <kstcombobox.h>
-#include <stringeditor.h>
#include <enodes.h>
#include <kst_export.h>
@@ -99,7 +100,7 @@
void StringSelector::createNewString() {
- StringEditor *se = new StringEditor(this, "string editor");
+ StringEditor *se = new StringEditor(this);
int rc = se->exec();
if (rc == QDialog::Accepted) {
@@ -129,7 +130,7 @@
void StringSelector::selectString() {
- ComboBoxSelectionI *selection = new ComboBoxSelectionI(this, "string selector");
+ ComboBoxSelection *selection = new ComboBoxSelection(this);
int i;
selection->reset();
@@ -147,7 +148,7 @@
void StringSelector::editString() {
- StringEditor *se = new StringEditor(this, "string editor");
+ StringEditor *se = new StringEditor(this);
KstStringPtr pold = *KST::stringList.findTag(_string->currentText());
if (pold && pold->editable()) {
--- branches/work/kst/portto4/kst/src/widgets/stringselector.h #637860:637861
@@ -41,6 +41,11 @@
void setSelection(KstStringPtr s);
void allowDirectEntry(bool allowed);
+signals:
+ void newStringCreated();
+ void selectionChanged(const QString &);
+ void selectionChangedLabel(const QString &);
+
private:
void init();
};
--- branches/work/kst/portto4/kst/src/widgets/stringselector4.ui #637860:637861
@@ -100,7 +100,7 @@
<tabstop>_editString</tabstop>
</tabstops>
<includes>
- <include location="local" >comboboxselection_i.h</include>
+ <include location="local" >comboboxselection.h</include>
<include location="local" >kstdatacollection.h</include>
<include location="local" >kstcombobox.h</include>
<include location="global" >kst_export.h</include>
--- branches/work/kst/portto4/kst/src/widgets/vectorselector.h #637860:637861
@@ -42,6 +42,11 @@
void editVector();
void setEdit(const QString &tag);
+signals:
+ void newVectorCreated(const QString &);
+ void selectionChanged(const QString &);
+ void selectionChangedLabel(const QString &);
+
private:
void init();
More information about the Kst
mailing list