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


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

Submitted by:  Rik <rik5>
Submitted on:  Tue Sep 3 23:32:28 2013  
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Fri Nov 18 16:16:01 2016, 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>
Project Administrator
Wed Sep 4 15:04:52 2013, 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>
Project Administrator
Wed Sep 4 12:11:56 2013, 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>
Project Administrator
Wed Sep 4 11:19:22 2013, comment #8:

Torsten: yes, I mean the window theme.

Michael Goffioul <goffioul>
Project Member
Wed Sep 4 07:51:14 2013, comment #7:

Maybe this might be a hint:

Torsten <ttl>
Project Member
Wed Sep 4 05:27:22 2013, 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>
Project Administrator
Wed Sep 4 04:54:37 2013, 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 <ttl>
Project Member
Wed Sep 4 03:53:23 2013, comment #4:

Any good way to test the qt-style theory?

Rik <rik5>
Project Administrator
Wed Sep 4 02:36:19 2013, comment #3:

Might it be qt-style dependent?

Michael Goffioul <goffioul>
Project Member
Wed Sep 4 01:44:04 2013, 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)

Rik <rik5>
Project Administrator
Wed Sep 4 00:48:07 2013, 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)

Mike Miller <mtmiller>
Project Administrator
Tue Sep 3 23:32:28 2013, 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.

Rik <rik5>
Project Administrator


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

Attach File(s):

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


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Nov 18 16:16:01 2016rik5StatusConfirmed=>Invalid
    Wed Sep 4 12:11:55 2013mtmillerStatusNeed Info=>Confirmed
    Wed Sep 4 01:44:04 2013rik5Attached File-=>Added GUI.questdlg1.png, #29001
      Attached File-=>Added CLI.questdlg.png, #29002
    Wed Sep 4 00:48:07 2013mtmillerAttached File-=>Added questdlg.png, #28999
      StatusNone=>Need Info
    Tue Sep 3 23:32:41 2013rik5Summarydialog 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.1-cleanup1