aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/qconf.h
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@informatik.tu-chemnitz.de>2010-08-31 11:34:37 -0400
committerMichal Marek <mmarek@suse.cz>2010-09-01 10:14:29 -0400
commit133c5f7c10e4552ba41bcf03b9bda6c4e3413804 (patch)
tree06af2cdf01dfa289937537f31c88ce0498e1ac13 /scripts/kconfig/qconf.h
parentc94d3fb01fb6db1899cdf53ea4eb9d38e08a08fe (diff)
kconfig qconf: port to QT4
A straight forward port to QT4 using qt3to4 and compiling against qt3support * Use pkg-config to detect QT4 which is hopefully portable enough * If no QT4, QT3 will by tried instead * Classes renamed using qt3to4 * If build using QT3 renamed to QT3 class names using defines * ConfigInfoView::menu has to be renamed as QT4 moc strips struct from struct menu and creates a name conflict * QT2 support has been dropped * The hidden options inserted in 39a4897c1bb66e8a36043c105d7fd73d8b32b480 are use in native API Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/kconfig/qconf.h')
-rw-r--r--scripts/kconfig/qconf.h76
1 files changed, 36 insertions, 40 deletions
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index 636a74b23bf9..91677d900dbd 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -3,26 +3,25 @@
3 * Released under the terms of the GNU GPL v2.0. 3 * Released under the terms of the GNU GPL v2.0.
4 */ 4 */
5 5
6#if QT_VERSION < 0x040000
6#include <qlistview.h> 7#include <qlistview.h>
7#if QT_VERSION >= 300
8#include <qsettings.h>
9#else 8#else
10class QSettings { 9#include <q3listview.h>
11public: 10#endif
12 void beginGroup(const QString& group) { } 11#include <qsettings.h>
13 void endGroup(void) { } 12
14 bool readBoolEntry(const QString& key, bool def = FALSE, bool* ok = 0) const 13#if QT_VERSION < 0x040000
15 { if (ok) *ok = FALSE; return def; } 14#define Q3ValueList QValueList
16 int readNumEntry(const QString& key, int def = 0, bool* ok = 0) const 15#define Q3PopupMenu QPopupMenu
17 { if (ok) *ok = FALSE; return def; } 16#define Q3ListView QListView
18 QString readEntry(const QString& key, const QString& def = QString::null, bool* ok = 0) const 17#define Q3ListViewItem QListViewItem
19 { if (ok) *ok = FALSE; return def; } 18#define Q3VBox QVBox
20 QStringList readListEntry(const QString& key, bool* ok = 0) const 19#define Q3TextBrowser QTextBrowser
21 { if (ok) *ok = FALSE; return QStringList(); } 20#define Q3MainWindow QMainWindow
22 template <class t> 21#define Q3Action QAction
23 bool writeEntry(const QString& key, t value) 22#define Q3ToolBar QToolBar
24 { return TRUE; } 23#define Q3ListViewItemIterator QListViewItemIterator
25}; 24#define Q3FileDialog QFileDialog
26#endif 25#endif
27 26
28class ConfigView; 27class ConfigView;
@@ -31,11 +30,10 @@ class ConfigItem;
31class ConfigLineEdit; 30class ConfigLineEdit;
32class ConfigMainWindow; 31class ConfigMainWindow;
33 32
34
35class ConfigSettings : public QSettings { 33class ConfigSettings : public QSettings {
36public: 34public:
37 QValueList<int> readSizes(const QString& key, bool *ok); 35 Q3ValueList<int> readSizes(const QString& key, bool *ok);
38 bool writeSizes(const QString& key, const QValueList<int>& value); 36 bool writeSizes(const QString& key, const Q3ValueList<int>& value);
39}; 37};
40 38
41enum colIdx { 39enum colIdx {
@@ -48,9 +46,9 @@ enum optionMode {
48 normalOpt = 0, allOpt, promptOpt 46 normalOpt = 0, allOpt, promptOpt
49}; 47};
50 48
51class ConfigList : public QListView { 49class ConfigList : public Q3ListView {
52 Q_OBJECT 50 Q_OBJECT
53 typedef class QListView Parent; 51 typedef class Q3ListView Parent;
54public: 52public:
55 ConfigList(ConfigView* p, const char *name = 0); 53 ConfigList(ConfigView* p, const char *name = 0);
56 void reinit(void); 54 void reinit(void);
@@ -135,17 +133,17 @@ public:
135 struct menu *rootEntry; 133 struct menu *rootEntry;
136 QColorGroup disabledColorGroup; 134 QColorGroup disabledColorGroup;
137 QColorGroup inactivedColorGroup; 135 QColorGroup inactivedColorGroup;
138 QPopupMenu* headerPopup; 136 Q3PopupMenu* headerPopup;
139 137
140private: 138private:
141 int colMap[colNr]; 139 int colMap[colNr];
142 int colRevMap[colNr]; 140 int colRevMap[colNr];
143}; 141};
144 142
145class ConfigItem : public QListViewItem { 143class ConfigItem : public Q3ListViewItem {
146 typedef class QListViewItem Parent; 144 typedef class Q3ListViewItem Parent;
147public: 145public:
148 ConfigItem(QListView *parent, ConfigItem *after, struct menu *m, bool v) 146 ConfigItem(Q3ListView *parent, ConfigItem *after, struct menu *m, bool v)
149 : Parent(parent, after), menu(m), visible(v), goParent(false) 147 : Parent(parent, after), menu(m), visible(v), goParent(false)
150 { 148 {
151 init(); 149 init();
@@ -155,16 +153,14 @@ public:
155 { 153 {
156 init(); 154 init();
157 } 155 }
158 ConfigItem(QListView *parent, ConfigItem *after, bool v) 156 ConfigItem(Q3ListView *parent, ConfigItem *after, bool v)
159 : Parent(parent, after), menu(0), visible(v), goParent(true) 157 : Parent(parent, after), menu(0), visible(v), goParent(true)
160 { 158 {
161 init(); 159 init();
162 } 160 }
163 ~ConfigItem(void); 161 ~ConfigItem(void);
164 void init(void); 162 void init(void);
165#if QT_VERSION >= 300
166 void okRename(int col); 163 void okRename(int col);
167#endif
168 void updateMenu(void); 164 void updateMenu(void);
169 void testUpdateMenu(bool v); 165 void testUpdateMenu(bool v);
170 ConfigList* listView() const 166 ConfigList* listView() const
@@ -219,9 +215,9 @@ public:
219 ConfigItem *item; 215 ConfigItem *item;
220}; 216};
221 217
222class ConfigView : public QVBox { 218class ConfigView : public Q3VBox {
223 Q_OBJECT 219 Q_OBJECT
224 typedef class QVBox Parent; 220 typedef class Q3VBox Parent;
225public: 221public:
226 ConfigView(QWidget* parent, const char *name = 0); 222 ConfigView(QWidget* parent, const char *name = 0);
227 ~ConfigView(void); 223 ~ConfigView(void);
@@ -252,9 +248,9 @@ public:
252 static QAction *showPromptAction; 248 static QAction *showPromptAction;
253}; 249};
254 250
255class ConfigInfoView : public QTextBrowser { 251class ConfigInfoView : public Q3TextBrowser {
256 Q_OBJECT 252 Q_OBJECT
257 typedef class QTextBrowser Parent; 253 typedef class Q3TextBrowser Parent;
258public: 254public:
259 ConfigInfoView(QWidget* parent, const char *name = 0); 255 ConfigInfoView(QWidget* parent, const char *name = 0);
260 bool showDebug(void) const { return _showDebug; } 256 bool showDebug(void) const { return _showDebug; }
@@ -274,11 +270,11 @@ protected:
274 QString debug_info(struct symbol *sym); 270 QString debug_info(struct symbol *sym);
275 static QString print_filter(const QString &str); 271 static QString print_filter(const QString &str);
276 static void expr_print_help(void *data, struct symbol *sym, const char *str); 272 static void expr_print_help(void *data, struct symbol *sym, const char *str);
277 QPopupMenu* createPopupMenu(const QPoint& pos); 273 Q3PopupMenu* createPopupMenu(const QPoint& pos);
278 void contentsContextMenuEvent(QContextMenuEvent *e); 274 void contentsContextMenuEvent(QContextMenuEvent *e);
279 275
280 struct symbol *sym; 276 struct symbol *sym;
281 struct menu *menu; 277 struct menu *_menu;
282 bool _showDebug; 278 bool _showDebug;
283}; 279};
284 280
@@ -302,10 +298,10 @@ protected:
302 struct symbol **result; 298 struct symbol **result;
303}; 299};
304 300
305class ConfigMainWindow : public QMainWindow { 301class ConfigMainWindow : public Q3MainWindow {
306 Q_OBJECT 302 Q_OBJECT
307 303
308 static QAction *saveAction; 304 static Q3Action *saveAction;
309 static void conf_changed(void); 305 static void conf_changed(void);
310public: 306public:
311 ConfigMainWindow(void); 307 ConfigMainWindow(void);
@@ -334,8 +330,8 @@ protected:
334 ConfigView *configView; 330 ConfigView *configView;
335 ConfigList *configList; 331 ConfigList *configList;
336 ConfigInfoView *helpText; 332 ConfigInfoView *helpText;
337 QToolBar *toolBar; 333 Q3ToolBar *toolBar;
338 QAction *backAction; 334 Q3Action *backAction;
339 QSplitter* split1; 335 QSplitter* split1;
340 QSplitter* split2; 336 QSplitter* split2;
341}; 337};