Forum
Sign Up

How to set RibbonStyle only to main window

11 years 10 months ago #1 by Ludek
Hello there,

my last question is about setting RibbonStyle only to main window.

I tried to set style by using
setStyle(new Qtitan::RibbonStyle());

but after that Ribbon window isn't displayed correctly:



When I set style by using following way:
new Qtitan::RibbonStyle(this);

the Ribbon is displayed correctly:



but also all child windows are style by using RibbonStyle, because style is set to QApplication.

I need to have child windows displayed by using default theme. How to do that?


Thank you for reply
Ludek
Attachments:

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

More
11 years 10 months ago #2 by Ludek
Hello there,

any update about this question?

I will be grateful for any advice how to apply the Ribbon style only to one window. Or how to apply default skin to other window without skinning every widget in the window one-by-one.

Thank you
Ludek

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

More
11 years 10 months ago #3 by Ben
I have the same problem and solved it with this inside the constructor of my main window:

m_ribbonStyle = qobject_cast<Qtitan::RibbonStyle*>(this->style());
m_ribbonStyle->setDialogsIgnored(true);

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

More
11 years 10 months ago #4 by Ludek
Thanks for tip. This solution works perfectly, when application doesn't use custom stylesheet.
If app have custom stylesheet, this method only disable stylesheet on dialog, but not on all his children.



Only solution I found is set default style with any non-empty stylesheet to child dialog:
		QStyle * pBaseStyle = QStyleFactory::create(m_defaultStyleName);
		pDialog->setStyle(pBaseStyle);
		pDialog->setStyleSheet("QDialog#NeverHappen{ color: #AABBCC;}");
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.146 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 )