Insert text box into menu item

this is a proof of concept issue. I am developing a GUI for editing the waypoints of air traffic participants in a flight simulation application. In the current concept, the parameters of the selected waypoint are displayed as a set of text fields. This input mask serves as both a data representation and an editing mask. After editing the fields, the user can:

  • save changes at waypoint
  • create a new waypoint based on input

This design avoids re-entering data if you need to change only some subsets of parameters for a new waypoint.

There is only one problem: where to insert the waypoint? My answer is a drop-down menu on the "Save as new" button, which has the following menu items:

  • as the first point of a flight plan
  • to the selected waypoint
  • after the selected waypoint
  • as the last point of the flight route
  • in index position

The last element is complex. The index position must be entered by the user, and I would like to avoid a popup asking for only one value.

My idea is this: insert a text box into the menu item.

Is this possible in QT or wxWidgets? What do you think of the GUI?

Regards, Arne

PS: note that all this is at the concept stage. The group did not even decide to use the GUI: Qt or wxWidgets.

+3
source share
2 answers

your approach is quite possible in QT. You can have \ widgets controls as QMenu elements using QWidgetAction . The following is an example:

QPushButton *button = new QPushButton("test button", this);
QMenu *menu = new QMenu(button);
QLineEdit *edit = new QLineEdit(menu);
QAction *action0 = new QAction("menu item", this);
QWidgetAction *action1 = new QWidgetAction(menu);

button->setMenu(menu);
action1->setDefaultWidget(edit);

menu->addAction(action0);
menu->addAction(action1);

, ,

+3

API- Mac OS X, , API wxWidgets ( wxFlatMenuBar).

, OSX ( , wx qt), , OSX , , . Windows . , , .

0

Source: https://habr.com/ru/post/1784905/


All Articles