-rw-r--r-- | microkde/keditlistbox.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/microkde/keditlistbox.cpp b/microkde/keditlistbox.cpp index 55b7784..257a44a 100644 --- a/microkde/keditlistbox.cpp +++ b/microkde/keditlistbox.cpp | |||
@@ -21,10 +21,13 @@ | |||
21 | #include <qstringlist.h> | 21 | #include <qstringlist.h> |
22 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
23 | #include <qlayout.h> | 23 | #include <qlayout.h> |
24 | #include <qgroupbox.h> | 24 | #include <q3groupbox.h> |
25 | #include <qlistbox.h> | 25 | #include <q3listbox.h> |
26 | #include <qwhatsthis.h> | 26 | #include <q3whatsthis.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | //Added by qt3to4: | ||
29 | #include <Q3GridLayout> | ||
30 | #include <Q3StrList> | ||
28 | 31 | ||
29 | #include <kcombobox.h> | 32 | #include <kcombobox.h> |
30 | #include <kdebug.h> | 33 | #include <kdebug.h> |
@@ -47,14 +50,14 @@ public: | |||
47 | 50 | ||
48 | KEditListBox::KEditListBox(QWidget *parent, const char *name, | 51 | KEditListBox::KEditListBox(QWidget *parent, const char *name, |
49 | bool checkAtEntering, int buttons ) | 52 | bool checkAtEntering, int buttons ) |
50 | :QGroupBox(parent, name ) | 53 | :Q3GroupBox(parent, name ) |
51 | { | 54 | { |
52 | init( checkAtEntering, buttons ); | 55 | init( checkAtEntering, buttons ); |
53 | } | 56 | } |
54 | 57 | ||
55 | KEditListBox::KEditListBox(const QString& title, QWidget *parent, | 58 | KEditListBox::KEditListBox(const QString& title, QWidget *parent, |
56 | const char *name, bool checkAtEntering, int buttons) | 59 | const char *name, bool checkAtEntering, int buttons) |
57 | :QGroupBox(title, parent, name ) | 60 | :Q3GroupBox(title, parent, name ) |
58 | { | 61 | { |
59 | init( checkAtEntering, buttons ); | 62 | init( checkAtEntering, buttons ); |
60 | } | 63 | } |
@@ -62,7 +65,7 @@ KEditListBox::KEditListBox(const QString& title, QWidget *parent, | |||
62 | KEditListBox::KEditListBox(const QString& title, const CustomEditor& custom, | 65 | KEditListBox::KEditListBox(const QString& title, const CustomEditor& custom, |
63 | QWidget *parent, const char *name, | 66 | QWidget *parent, const char *name, |
64 | bool checkAtEntering, int buttons) | 67 | bool checkAtEntering, int buttons) |
65 | :QGroupBox(title, parent, name ) | 68 | :Q3GroupBox(title, parent, name ) |
66 | { | 69 | { |
67 | m_lineEdit = custom.lineEdit(); | 70 | m_lineEdit = custom.lineEdit(); |
68 | init( checkAtEntering, buttons, custom.representationWidget() ); | 71 | init( checkAtEntering, buttons, custom.representationWidget() ); |
@@ -95,7 +98,7 @@ void KEditListBox::init( bool checkAtEntering, int buttons, | |||
95 | QSizePolicy::MinimumExpanding)); | 98 | QSizePolicy::MinimumExpanding)); |
96 | 99 | ||
97 | QWidget * gb = this; | 100 | QWidget * gb = this; |
98 | QGridLayout * grid = new QGridLayout(gb, 7 - lostButtons, 2, | 101 | Q3GridLayout * grid = new Q3GridLayout(gb, 7 - lostButtons, 2, |
99 | KDialog::marginHint(), | 102 | KDialog::marginHint(), |
100 | KDialog::spacingHint()); | 103 | KDialog::spacingHint()); |
101 | grid->addRowSpacing(0, fontMetrics().lineSpacing()); | 104 | grid->addRowSpacing(0, fontMetrics().lineSpacing()); |
@@ -109,7 +112,7 @@ void KEditListBox::init( bool checkAtEntering, int buttons, | |||
109 | else | 112 | else |
110 | m_lineEdit=new KLineEdit(gb); | 113 | m_lineEdit=new KLineEdit(gb); |
111 | 114 | ||
112 | m_listBox = new QListBox(gb); | 115 | m_listBox = new Q3ListBox(gb); |
113 | 116 | ||
114 | QWidget *editingWidget = representationWidget ? | 117 | QWidget *editingWidget = representationWidget ? |
115 | representationWidget : m_lineEdit; | 118 | representationWidget : m_lineEdit; |
@@ -204,7 +207,7 @@ void KEditListBox::moveItemUp() | |||
204 | return; | 207 | return; |
205 | } | 208 | } |
206 | 209 | ||
207 | QListBoxItem *selItem = m_listBox->item(selIndex); | 210 | Q3ListBoxItem *selItem = m_listBox->item(selIndex); |
208 | m_listBox->takeItem(selItem); | 211 | m_listBox->takeItem(selItem); |
209 | m_listBox->insertItem(selItem, selIndex-1); | 212 | m_listBox->insertItem(selItem, selIndex-1); |
210 | m_listBox->setCurrentItem(selIndex - 1); | 213 | m_listBox->setCurrentItem(selIndex - 1); |
@@ -227,7 +230,7 @@ void KEditListBox::moveItemDown() | |||
227 | return; | 230 | return; |
228 | } | 231 | } |
229 | 232 | ||
230 | QListBoxItem *selItem = m_listBox->item(selIndex); | 233 | Q3ListBoxItem *selItem = m_listBox->item(selIndex); |
231 | m_listBox->takeItem(selItem); | 234 | m_listBox->takeItem(selItem); |
232 | m_listBox->insertItem(selItem, selIndex+1); | 235 | m_listBox->insertItem(selItem, selIndex+1); |
233 | m_listBox->setCurrentItem(selIndex + 1); | 236 | m_listBox->setCurrentItem(selIndex + 1); |
@@ -349,14 +352,16 @@ void KEditListBox::insertStringList(const QStringList& list, int index) | |||
349 | m_listBox->insertStringList(list,index); | 352 | m_listBox->insertStringList(list,index); |
350 | } | 353 | } |
351 | 354 | ||
352 | void KEditListBox::insertStrList(const QStrList* list, int index) | 355 | void KEditListBox::insertStrList(const Q3StrList* list, int index) |
353 | { | 356 | { |
354 | m_listBox->insertStrList(list,index); | 357 | for(Q3StrList::const_iterator i=list->begin();i!=list->end();++i) |
358 | m_listBox->insertItem(*i,index++); | ||
355 | } | 359 | } |
356 | 360 | ||
357 | void KEditListBox::insertStrList(const QStrList& list, int index) | 361 | void KEditListBox::insertStrList(const Q3StrList& list, int index) |
358 | { | 362 | { |
359 | m_listBox->insertStrList(list,index); | 363 | for(Q3StrList::const_iterator i=list.begin();i!=list.end();++i) |
364 | m_listBox->insertItem(*i,index++); | ||
360 | } | 365 | } |
361 | 366 | ||
362 | void KEditListBox::insertStrList(const char ** list, int numStrings, int index) | 367 | void KEditListBox::insertStrList(const char ** list, int numStrings, int index) |