Re: [Interest] Howto keep a pushButton style while changing the backgroundcolor
Thanks a lot Tony, yes it works :-) Anton Tony Rietwyk wrote: > Hope that helps, > ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Howto keep a pushButton style while changing the backgroundcolor
Anton said: > Sent: Tuesday, 26 April 2016 2:53 AM > Hi, > > I am experimenting with qt 5.6.0. > > 1. I create a QtWidgts application. > 2. I drop a pushButton in the Main Window 3. I change the styleSheet of the > QMainWindow >to: background-color: rgb(85, 170, 255); > > Now the button has the same background color too. > > How can I leave the style of the pushbutton as it is? > (without inheriting the blue background color from the QMainWindow) > > I didn't find any solution and I do not want to set a background bitmap for > such a simple problem. > > What point did I miss? > > Thanks for a hint. > > Anton You missed some CSS. Without a CSS selector, the background-color recursively applies to all widgets parented by the main window. Try setStyleSheet( "QMainWindow { background-color: rgb(85, 170, 255); }" ); or setStyleSheet( "#mainWindowObjectName { background-color: rgb(85, 170, 255); }" ); Hope that helps, Tony ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] Howto keep a pushButton style while changing the backgroundcolor
Hi, I am experimenting with qt 5.6.0. 1. I create a QtWidgts application. 2. I drop a pushButton in the Main Window 3. I change the styleSheet of the QMainWindow to: background-color: rgb(85, 170, 255); Now the button has the same background color too. How can I leave the style of the pushbutton as it is? (without inheriting the blue background color from the QMainWindow) I didn't find any solution and I do not want to set a background bitmap for such a simple problem. What point did I miss? Thanks for a hint. Anton ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest