bugGNU Octave - Bugs: bug #49643, questdlg returns incorrect string...

 
 

bug #49643: questdlg returns incorrect string with ampersand embedded in it (Qt5.4 only)

Submitter:  Rik <rik5>
Submitted:  Fri 18 Nov 2016 02:27:12 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.2.0 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 11:28:01 PM UTC, comment #8: 

I'm running 5.4.2.  I'm willing to say this is a Qt bug.  The report I mentioned says that they were having trouble with both 5.4.1 and 5.4.2 which coincides with my experience.  I'm going to mark this as invalid and close.

Rik <rik5>
Group administrator
Fri 18 Nov 2016 11:00:29 PM UTC, comment #7: 

Also, I am building with Qt 5.6.1, and I don't see these extraneous ampersand characters in the example you posted here. Maybe it was a regression in an earlier version of Qt 5?

Mike Miller <mtmiller>
Group Member
Fri 18 Nov 2016 10:57:59 PM UTC, comment #6: 

Currently, if you pass in a string containing a double ampersand, e.g. "This && That", Qt represents it as a single ampersand instead of as an escape designating the shortcut key for the button.

I guess if we want to be Matlab compatible we have to escape ampersands before passing the string to Qt, and unescape on the way back. The Matlab help pages do not mention any special behavior for ampersands that I can see.

Mike Miller <mtmiller>
Group Member
Fri 18 Nov 2016 10:46:47 PM UTC, comment #5: 

Apparently it was Qt that changed.  Someone running the PyQt bindings ran into exactly the same issue (http://python.6.x6.nabble.com/QPushButton-text-ampersand-issue-td5173745.html).  They took the simple option of removing any ampersand in the return text, which might work, but what if someone wants an '&' on their button?

Rik <rik5>
Group administrator
Fri 18 Nov 2016 04:31:03 PM UTC, comment #4: 

Okay, I re-compiled and this works fine with Qt4.  I've added the fact that this is a problem only with Qt5 to the title of the bug report.

Rik <rik5>
Group administrator
Fri 18 Nov 2016 04:28:38 PM UTC, comment #3: 

I am using Qt 4.8.6. I open another bug report concerning the button order.

Guillaume <gyom>
Fri 18 Nov 2016 04:16:59 PM UTC, comment #2: 

I am testing with Qt5.  I will try reverting to Qt4 and see if that fixes the problem.

As for button order, could you file a "Matlab compatibility" bug report about that?  It should be easy to fix.

Rik <rik5>
Group administrator
Fri 18 Nov 2016 03:04:42 PM UTC, comment #1: 

I don't reproduce what you are describing: which version of Qt are you using? Do you think it might relate to bug #48214 ?

Also, it displays the buttons in reverse order, ie BTN3 then BTN2 then BTN1, which is different than Matlab's behavior.

I also tried to add '&' as keyboard shortcuts:


choice = questdlg ("Question?", "questdlg", "BTN1", "&BTN2", "BT&N3", "BTN1")


and they work in Octave (the next letter is underlined and the corresponding button responds to alt-) but Matlab disregards them and displays '&' in the buttons' name.

Guillaume <gyom>
Fri 18 Nov 2016 02:27:12 PM UTC, original submission:  

The questdlg function doesn't return the name of the button pressed.  Rather, it returns the name of the button with an ampersand embedded in it.  This is a regression from 4.0

Sample code:


choice = questdlg ("Question?", "questdlg", "BTN1", "BTN2", "BTN3", "BTN1")
## Click BTN3
choice = &BTN3
## Try again and Click BTN1
choice = questdlg ("Question?", "questdlg", "BTN1", "BTN2", "BTN3", "BTN1")
choice = BT&N1


The '&' is likely there to represent the keyboard shortcut in Qt.  I haven't checked but other dialogs are probably affected.

Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by gyom (Posted a comment)
  • -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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-18 rik5 StatusConfirmed Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
        Summaryquestdlg returns incorrect string with ampersand embedded in it (Qt5 only) questdlg returns incorrect string with ampersand embedded in it (Qt5.4 only)
    2016-11-18 rik5 StatusNone Confirmed
        Summaryquestdlg returns incorrect string with ampersand embedded in it questdlg returns incorrect string with ampersand embedded in it (Qt5 only)

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code