Forum
Sign Up

how to access to QToolButton in a ribbongroup ?

13 years 3 months ago - 13 years 3 months ago #1 by
Hi,
i want let the user change the language without restart the program. So i define actions and set the text for the actions in a seperate function. When the user now change the language then i add the translator for that language and set the text for the actions again. The tooltip text for the ribbon button will be changed, but not the text of the button itself. I attach one screenshot before and one after changing the language.
Attachments:
Last edit: 13 years 3 months ago by .

Please Log in or Create an account to join the conversation.

  • 's Avatar Topic Author
13 years 3 months ago #2 by Christoph (Andritz)
I had the same problem!
You have to use QAction::setIconText() instead of QAction::setText().
The following user(s) said Thank You:

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #3 by Christoph (Andritz)
Now i have a problem changing Menu Text.

Qtitan::RibbonGroup* pGroup = pageDeviceProject->addGroup("_Projekt");
QMenu* pMenu = pGroup->addMenu(QIcon(":/Resources/protocol.png"), "_Protokollprojektierung");
pMenu ->setTitle ("test");

The text did not change!

Any Ideas?

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #4 by Developer Machines
For this purpose please use the setIconText(...) function too.

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #5 by Developer Machines
This is full example:

Qtitan::RibbonGroup* pGroup = pageDeviceProject->addGroup("_Projekt");
QMenu* pMenu = pGroup->addMenu(QIcon(":/Resources/protocol.png"), "_Protokollprojektierung");
QAction* act = pMenu->menuAction();
act->setIconText("test");

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #6 by Christoph (Andritz)
Thanks you!

Now i have only one problem:
When a add a Button to QuickAccessbar i can not Change the Menu-Text for Show/Hide the Button.

QAction* pAct = m_pQuickAccessBar->addAction(QIcon(":/Resources/cpu_flash.png"), "_Laden");
But when i change the Action text, nothing happens!
pAct->setText("test");

Any Ideas?
Attachments:

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.157 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )