PDA

View Full Version : Style Sheets & Pros and Cons on Qt.



BingoMaster
25th September 2009, 18:28
I want to switch over to Qt because of the cross platform support. I am looking for pros and cons on Qt. I have been a Delphi programmer since Delphi 1, and written many custom components within Delphi for our products.

I have played around with the Style Sheet for the QPushButton and gotten close to what we have, but not really.

Q. When working with Style Sheets how do you save them as a resource so all the QPushButton would use the same style? Also what if you have two or three styles of QPushButton on a page.

I do apologize for the lack of understanding in this envorinment.

wysota
26th September 2009, 09:13
You don't have to save the stylesheet in a dedicated resource. It's just a string - you can load it from anywhere you want or set on the application permanently. If you want all widgets in the application make use of the stylesheet, apply it on the application object (QApplication::setStyleSheet()). If you want different styles for some of the buttons, use one of selectors available for stylesheets to choose appropriate widgets.

The selectors are described here: Selector Types.