[Kst] branches/work/kst/kst1kde4/kst/src/widgets
Andrew Walker
arwalker at sumusltd.com
Thu Mar 11 20:22:24 CET 2010
SVN commit 1102077 by arwalker:
continue kst1kde4
M +3 -1 CMakeLists.txt
D Makefile.am
M +7 -8 kstcombobox.cpp
M +11 -10 kstcombobox.h
A scalareditor.cpp [License: GPL (v2+)]
A scalareditor.h [License: GPL (v2+)]
A scalarselector.cpp [License: GPL (v2+)]
A scalarselector.h [License: GPL (v2+)]
--- branches/work/kst/kst1kde4/kst/src/widgets/CMakeLists.txt #1102076:1102077
@@ -8,6 +8,8 @@
draggablelistbox.cpp
draggablelistview.cpp
plotlistbox.cpp
+ scalareditor.cpp
+ scalarselector.cpp
vectorlistview.cpp
kstcombobox.cpp)
@@ -28,7 +30,7 @@
kde4_add_library(kstwidgets SHARED ${kstwidgets_LIB_SRCS})
-target_link_libraries(kstwidgets kio kstmath ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} ${QT_LIBRARIES})
+target_link_libraries(kstwidgets kio kstbase kstmath ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} ${QT_LIBRARIES})
set_target_properties(kstwidgets PROPERTIES VERSION 1.0.0 SOVERSION 1)
install(TARGETS kstwidgets
--- branches/work/kst/kst1kde4/kst/src/widgets/kstcombobox.cpp #1102076:1102077
@@ -18,15 +18,15 @@
#include "kstcombobox.h"
KstComboBox::KstComboBox(QWidget *parent, const char *name)
- : KComboBox(parent), _trueRW(false) {
+ : QComboBox(parent), _trueRW(false) {
commonConstructor();
}
KstComboBox::KstComboBox(bool rw, QWidget *parent, const char *name)
- : KComboBox(false, parent), _trueRW(rw) {
-
+ : QComboBox(parent), _trueRW(rw) {
+ setEditable(false);
commonConstructor();
}
@@ -39,7 +39,6 @@
}
void KstComboBox::commonConstructor() {
-
QComboBox::setEditable( true );
if (!_trueRW) { //if not truly read write then go into psuedo mode for read only
@@ -57,17 +56,18 @@
//this will bug out!! Unfortunately I see no way to check whether the list of items
//changes programmatically other than to provide my own input methods or poll with a
//timer. Neither is a good idea IMO...
-
+/* xxx
if (!_trueRW) {
if (KCompletion *comp = completionObject()) {
comp->clear();
for (int i = 0; i < count(); ++i) {
-// xxx comp->addItem(text(i));
+ comp->addItem(text(i));
}
}
}
KComboBox::focusInEvent(event);
+*/
}
void KstComboBox::focusOutEvent(QFocusEvent *event) {
@@ -78,7 +78,7 @@
validate(false);
- KComboBox::focusOutEvent(event);
+ QComboBox::focusOutEvent(event);
}
@@ -107,4 +107,3 @@
// xxx #include "kstcombobox.moc"
-
--- branches/work/kst/kst1kde4/kst/src/widgets/kstcombobox.h #1102076:1102077
@@ -18,18 +18,19 @@
#ifndef KSTCOMBOBOX_H
#define KSTCOMBOBOX_H
-#include <kcombobox.h>
+#include <QComboBox>
-/*This class is a wrapper around KComboBox that does something different in read only mode...
- basically, we act like a readwrite combo with one important difference... when the widget
- loses focus or return is pressed we validate and make sure that what is left in the
- edit field either matches one of the combo's real entries, or we set the active item to
- the first in the list...
+//
+// This class is a wrapper around KComboBox that does something different in
+// read only mode... basically, we act like a readwrite combo with one important
+// difference... when the widget loses focus or return is pressed we validate
+// and make sure that what is left in the edit field either matches one of the
+// combo's real entries, or we set the active item to the first in the list...
+// The upshot is that we can have a readonly combo, but with a completion popup
+// for easy searching through large combo lists.
+//
- The upshot is that we can have a readonly combo, but with a completion popup for easy
- searching through large combo lists.
-*/
-class KstComboBox : public KComboBox {
+class KstComboBox : public QComboBox {
Q_OBJECT
public:
KstComboBox(QWidget *parent=0, const char *name=0);
More information about the Kst
mailing list