Results 1 to 7 of 7

Thread: Problem with QPushButton text

  1. #1
    Join Date
    Oct 2009
    Location
    NJ, USA
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem with QPushButton text

    I have a QDialogButtonBox in one of my panels with few standard buttons like 'Cancel' and 'Help'. I am adding an extra button in my code:

    Qt Code:
    1. m_exportButton = new QPushButton(tr("Export..."));
    2. m_exportButton->setDefault(false);
    3. ui.buttonBox->addButton(m_exportButton, QDialogButtonBox::ActionRole);
    To copy to clipboard, switch view to plain text mode 

    When I open this panel the text of my export button appears like '...Export'. If I set the button text as just 'Export' no extra dots appear. Is this a bug or is there a way to control this behavior. I want period added to my button text to indicate that another dialog will be opened.

    Any help with this issue will be greatly appreciated.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with QPushButton text

    Did you set the widget (or the whole application) to right-to-left mode? Because the outcome suggests you did.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2009
    Location
    NJ, USA
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QPushButton text

    I've set QDialogButtonBox to right-to-left mode. Is there any way to have buttons arranged this way, but keep text still aligned left-to-right? It looks like except for '...' the text remains aligned left-to-right.

    Now that we are on the subject, is the left-to-right button order standard? I've seen many applications where the right-to-left order is used instead, but button text itself does not change.

    Thanks for your help.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with QPushButton text

    Quote Originally Posted by ScabrusMantra View Post
    I've set QDialogButtonBox to right-to-left mode.
    What for? QDialogButtonBox is meant to be used when you want to follow the platform order or buttons. If you reverse the layout just for the button box it doesn't make sense as you are breaking the order of buttons. If you want that, place the buttons manually on the form, without using the button box.

    Now that we are on the subject, is the left-to-right button order standard?
    Yes, it is.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Oct 2009
    Location
    NJ, USA
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem with QPushButton text

    Ok, thanks for your comments. One last question then. What is the intended purpose of right-to-left layout orientation and what is the appropriate use for it?

  6. #6
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problem with QPushButton text

    If you ever write in Hebrew, you will definetly have to use it...

  7. The following user says thank you to been_1990 for this useful post:

    ScabrusMantra (7th November 2009)

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with QPushButton text

    Quote Originally Posted by ScabrusMantra View Post
    What is the intended purpose of right-to-left layout orientation and what is the appropriate use for it?
    There are languages that are written from right to left (as the aforementioned Hebrew or Arabic languages).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. The following user says thank you to wysota for this useful post:

    ScabrusMantra (7th November 2009)

Similar Threads

  1. Replies: 2
    Last Post: 20th September 2009, 03:59
  2. qtcreator text editor color scheme problem
    By elflord in forum Qt Tools
    Replies: 1
    Last Post: 5th March 2009, 18:42
  3. Changing QPushButton text colour with mouseMoveEvent
    By Misenko in forum Qt Programming
    Replies: 1
    Last Post: 10th June 2008, 17:53
  4. Replies: 1
    Last Post: 30th November 2007, 11:03
  5. Problem with inserting text into QTextEdit
    By xorrr in forum Qt Programming
    Replies: 0
    Last Post: 6th February 2006, 12:45

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.