History

kconfig qconf: add namespace for use of Key_ enum values

They are defined in the 'Qt' namespace. Fixes the following compiler errors after a quick conversion with 'qt3to4', which occured with g++ 3.4.6 and 4.1.2, but not anymore with 4.3.2. scripts/kconfig/qconf.cc: In member function 'virtual void ConfigLineEdit::keyPressEvent(QKeyEvent*)': scripts/kconfig/qconf.cc:311: error: 'Key_Escape' was not declared in this scope scripts/kconfig/qconf.cc:313: error: 'Key_Return' was not declared in this scope scripts/kconfig/qconf.cc:314: error: 'Key_Enter' was not declared in this scope scripts/kconfig/qconf.cc: In member function 'virtual void ConfigList::keyPressEvent(QKeyEvent*)': scripts/kconfig/qconf.cc:653: error: 'Key_Escape' was not declared in this scope scripts/kconfig/qconf.cc:666: error: 'Key_Return' was not declared in this scope scripts/kconfig/qconf.cc:667: error: 'Key_Enter' was not declared in this scope scripts/kconfig/qconf.cc:681: error: 'Key_Space' was not declared in this scope scripts/kconfig/qconf.cc:684: error: 'Key_N' was not declared in this scope scripts/kconfig/qconf.cc:687: error: 'Key_M' was not declared in this scope scripts/kconfig/qconf.cc:690: error: 'Key_Y' was not declared in this scope scripts/kconfig/qconf.cc: In constructor 'ConfigMainWindow::ConfigMainWindow()': scripts/kconfig/qconf.cc:1329: error: 'CTRL' was not declared in this scope scripts/kconfig/qconf.cc:1329: error: 'Key_Q' was not declared in this scope scripts/kconfig/qconf.cc:1331: error: 'Key_L' was not declared in this scope scripts/kconfig/qconf.cc:1333: error: 'Key_S' was not declared in this scope scripts/kconfig/qconf.cc:1340: error: 'Key_F' was not declared in this scope

Markus Heidelberg committed 17 years ago

Commit fbb86371 parent 7298b931 file · +14 −14Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/qconf.cc+14−14
@@ -297,10 +297,10 @@ void ConfigLineEdit::show(ConfigItem* i) · 296 unmodified lines
297297 void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
298298 {
299299 switch (e->key()) {
300− case Key_Escape:
300+ case Qt::Key_Escape:
301301 break;
302− case Key_Return:
303− case Key_Enter:
302+ case Qt::Key_Return:
303+ case Qt::Key_Enter:
304304 sym_set_string_value(item->menu->sym, text().latin1());
305305 parent()->updateList(item);
306306 break;
@@ -639,7 +639,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) · 332 unmodified lines
639639 struct menu *menu;
640640 enum prop_type type;
641641
642− if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) {
642+ if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) {
643643 emit parentSelected();
644644 ev->accept();
645645 return;
@@ -652,8 +652,8 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) · 6 unmodified lines
652652 item = (ConfigItem*)i;
653653
654654 switch (ev->key()) {
655− case Key_Return:
656− case Key_Enter:
655+ case Qt::Key_Return:
656+ case Qt::Key_Enter:
657657 if (item->goParent) {
658658 emit parentSelected();
659659 break;
@@ -667,16 +667,16 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) · 7 unmodified lines
667667 emit menuSelected(menu);
668668 break;
669669 }
670− case Key_Space:
670+ case Qt::Key_Space:
671671 changeValue(item);
672672 break;
673− case Key_N:
673+ case Qt::Key_N:
674674 setValue(item, no);
675675 break;
676− case Key_M:
676+ case Qt::Key_M:
677677 setValue(item, mod);
678678 break;
679− case Key_Y:
679+ case Qt::Key_Y:
680680 setValue(item, yes);
681681 break;
682682 default:
@@ -1315,18 +1315,18 @@ ConfigMainWindow::ConfigMainWindow(void) · 632 unmodified lines
13151315 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this);
13161316 connect(backAction, SIGNAL(activated()), SLOT(goBack()));
13171317 backAction->setEnabled(FALSE);
1318− QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this);
1318+ QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
13191319 connect(quitAction, SIGNAL(activated()), SLOT(close()));
1320− QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this);
1320+ QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
13211321 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1322− saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this);
1322+ saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
13231323 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
13241324 conf_set_changed_callback(conf_changed);
13251325 // Set saveAction's initial state
13261326 conf_changed();
13271327 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this);
13281328 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1329− QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this);
1329+ QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
13301330 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
13311331 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
13321332 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t