PDA

View Full Version : Problem with QPushButton text



ScabrusMantra
3rd November 2009, 21:46
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:


m_exportButton = new QPushButton(tr("Export..."));
m_exportButton->setDefault(false);
ui.buttonBox->addButton(m_exportButton, QDialogButtonBox::ActionRole);

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.

wysota
3rd November 2009, 23:16
Did you set the widget (or the whole application) to right-to-left mode? Because the outcome suggests you did.

ScabrusMantra
4th November 2009, 02:42
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.

wysota
4th November 2009, 08:26
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.

ScabrusMantra
4th November 2009, 15:48
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?

been_1990
5th November 2009, 16:07
If you ever write in Hebrew, you will definetly have to use it...

wysota
5th November 2009, 21:20
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).