bugGNU Octave - Bugs: bug #39935, dialog button order incorrectly...


bug #39935: dialog button order incorrectly changes depending on CLI or GUI

Submitter:  Rik <rik5>
Submitted:  Tue 03 Sep 2013 11:32:28 PM UTC
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

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.

Rik <rik5>
Group administrator
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.

Rik <rik5>
Group administrator
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:


Adding buttons in the order specified by the layout:


Mike Miller <mtmiller>
Group Member
Wed 04 Sep 2013 11:19:22 AM UTC, comment #8: 

Torsten: yes, I mean the window theme.

Michael Goffioul <goffioul>
Wed 04 Sep 2013 07:51:14 AM UTC, comment #7: 
Torsten Lilge <ttl>
Group Member
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?

Mike Miller <mtmiller>
Group Member
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?

Torsten Lilge <ttl>
Group Member
Wed 04 Sep 2013 03:53:23 AM UTC, comment #4: 

Any good way to test the qt-style theory?

Rik <rik5>
Group administrator
Wed 04 Sep 2013 02:36:19 AM UTC, comment #3: 

Might it be qt-style dependent?

Michael Goffioul <goffioul>
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.

Rik <rik5>
Group administrator
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?

Mike Miller <mtmiller>
Group Member
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:

choice = questdlg ("Question?", "questdlg", "BTN1", "BTN2", "BTN3", "BTN1")

In this example, the buttons are actually ordered 3->2->1 instead of 1->2->3.

Rik <rik5>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #29001:  GUI.questdlg1.png added by rik5 (13KiB - image/png)
file #29002:  CLI.questdlg.png added by rik5 (7KiB - image/png)
file #28999:  questdlg.png added by mtmiller (28KiB - image/png)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-18 rik5 StatusConfirmed Invalid
        Open/ClosedOpen Closed
    2013-09-04 mtmiller StatusNeed Info Confirmed
    2013-09-04 rik5 Attached File- Added GUI.questdlg1.png, #29001
        Attached File- Added CLI.questdlg.png, #29002
    2013-09-04 mtmiller Attached File- Added questdlg.png, #28999
        StatusNone Need Info
    2013-09-03 rik5 Summarydialog button order incorrectly changes dependin on CLI or GUI dialog button order incorrectly changes depending on CLI or GUI

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code