I am using Qt 5.0.1. I want to use the style sheet syntax to customize the functions of the widget and its elements.
but some syntaxes like QLineEdit { color: red } or
QPushButton#evilButton:pressed { background-color: rgb(224, 0, 0); border-style: inset; }
do not work, and the compiler gives an error.
I changed some syntaxes and got an answer. For instance:
QPushButton#evilButton { background-color: red; border-style: outset; border-width: 2px; border-radius: 10px; border-color: beige; font: bold 14px; min-width: 10em; padding: 6px;
}
converted to:
mypushbutton->setStyleSheet("background-color:purple;" "border-style:inset;" "border-width: 4px;" "border-color: green;" "border-radius: 10px;" "font: bold 14px;" "min-width: 10em;" "padding: 6px;" );
I actually used a different function for this. But I could not change the first codes and I do not know what to do ... what should I do? Should I include something or something else a problem? I used this page to find out the syntax of the stylesheet. Even the example of my own Qt does not work and just an error occurs ... !!! ???
source share