Re: ContextMenu
Although I haven't tried this, and I am not at a comp w/ Qt installed right now and won't be for several hours, but as far as I understand the docs, you can also do the following:
1. Create all the actions you want in the menu.
2. Add these actions to the widget, using QWidget::addAction(...)
3. Set the widgets contextPolicy to Qt::ActionsContextMenu
If I understand correctly, this way, when your widget receives the context menu event, it will display its QWidget::actions() as context menu.
Bojan
The march of progress:
C:
printf("%10.2f", x);
C++:
cout << setw(10) << setprecision(2) << showpoint << x;
Java:
java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++) System.out.print(' ');
System.out.print(s);
Bookmarks