(
Jump to the original submission)
Fri 18 Nov 2016 04:16:01 PM UTC, comment #11:
This is no longer relevant. The CLI used to use java to produce the dialogs, while the GUI used Qt. Now the CLI just reports that the dialog function is unavailable.
There is a new problem with button order in that it differs from Matlab, but I'll make that a new report.
|
Wed 04 Sep 2013 03:04:52 PM UTC, comment #10:
Further confirmation, I am running the KDE desktop on Ubuntu 12.04 which explains the re-ordering.
It seems like we should set a generic button style that follows the programmer's desire rather than someone else's UI guidelines. It doesn't work well for a developer to write one Octave/Matlab GUI application and then have the buttons re-ordered depending on where it is run.
|
Wed 04 Sep 2013 12:11:56 PM UTC, comment #9:
I've confirmed my theory with a look at the Qt library source. It might be possible to fix this with a simple call to QMessageBox::setStyle, or it might require some more intrusive overriding.
See http://qt-project.org/doc/qt-4.8/qdialogbuttonbox.html#details and the screenshots of different system-specific button layouts.
Pointers into the Qt source if needed:
System-dependent layout definitions:
https://qt.gitorious.org/qt/qt/source/41372579efec1573179ad1eb8e5331723b6567c3:src/gui/widgets/qdialogbuttonbox.cpp#L215
Adding buttons in the order specified by the layout:
https://qt.gitorious.org/qt/qt/source/41372579efec1573179ad1eb8e5331723b6567c3:src/gui/widgets/qdialogbuttonbox.cpp#L410
|
Wed 04 Sep 2013 11:19:22 AM UTC, comment #8:
Torsten: yes, I mean the window theme.
|
Wed 04 Sep 2013 07:51:14 AM UTC, comment #7:
Maybe this might be a hint:
http://askubuntu.com/questions/206023/how-do-i-prevent-kde-from-messing-up-my-qt-dialog-button-order
|
Wed 04 Sep 2013 05:27:22 AM UTC, comment #6:
So we have two (different desktop environments?) Ubuntu 12.04 desktops with the same Qt version with different orderings.
The problem seems likely to be that QMessageBox intentionally changes the order of buttons depending on the platform, which possibly also includes the desktop environment or window manager. The ButtonRole enum is used along with the system environment to determine the button order.
See http://qt-project.org/doc/qt-5.0/qtwidgets/qmessagebox.html#advanced-usage
I see that do_question_dialog sets all three buttons to the same ButtonRole, but perhaps there is a secondary ordering index for buttons with the same role value?
|
Wed 04 Sep 2013 04:54:37 AM UTC, comment #5:
I get BTN1-BTN2-BTN3 on ubuntu 12.04. with qt 4.8.1.
Does the behavior depend on the window theme?
What do you mean by qt-style?
|
Wed 04 Sep 2013 03:53:23 AM UTC, comment #4:
Any good way to test the qt-style theory?
|
Wed 04 Sep 2013 02:36:19 AM UTC, comment #3:
Might it be qt-style dependent?
|
Wed 04 Sep 2013 01:44:04 AM UTC, comment #2:
I'm running Kubuntu 12.04 and the Qt version is 4.8.1. Attached are two pngs with the results I get.
(file #29001, file #29002)
|
Wed 04 Sep 2013 12:48:07 AM UTC, comment #1:
Hmm, I get consistent left-to-right in the GUI. Screenshot attached.
Could be dependent on Qt version or window manager?
(file #28999)
|
Tue 03 Sep 2013 11:32:28 PM UTC, original submission:
The order of buttons when using a dialog function, such as questdlg, differs depending on whether the CLI or the GUI is running. In the CLI case, Java is used to create the dialog boxes. In the GUI case, Qt is used to create the dialog boxes.
In either case the results should be the same. It appears that the results for the GUI are exactly backward, right to left, from the CLI.
Sample code:
In this example, the buttons are actually ordered 3->2->1 instead of 1->2->3.
|
(Note: upload size limit is set to 16384 kB, after insertion of the required
escape characters.)
Attach File(s):
Comment:
Depends on the following items: None found
Items that depend on this one: None found
Follow 8 latest changes.
| Date |
Changed By |
Updated Field |
Previous Value |
=> |
Replaced By |
| Fri 18 Nov 2016 04:16:01 PM UTC | rik5 | Status | Confirmed |  | Invalid |
| | | Open/Closed | Open |  | Closed |
| Wed 04 Sep 2013 12:11:55 PM UTC | mtmiller | Status | Need Info |  | Confirmed |
| Wed 04 Sep 2013 01:44:04 AM UTC | rik5 | Attached File | - |  | Added GUI.questdlg1.png, #29001 |
| | | Attached File | - |  | Added CLI.questdlg.png, #29002 |
| Wed 04 Sep 2013 12:48:07 AM UTC | mtmiller | Attached File | - |  | Added questdlg.png, #28999 |
| | | Status | None |  | Need Info |
| Tue 03 Sep 2013 11:32:41 PM UTC | rik5 | Summary | dialog button order incorrectly changes dependin on CLI or GUI |  | dialog button order incorrectly changes depending on CLI or GUI |