title: How to change the styleSheet properties at runtime?
body: <p>I'm using Qt, 5.9, Windows.
  I'm trying to change the styleSheet properties after my program started, so the user can customize the appearance of the program.</p>
  <p>I have not created a styleSheet file. Instead, in Qt's Design mode, I go to the properties of the element I'm trying to change, click the &quot;styleSheet&quot; property, and add properties I want to change in the window displayed by Qt.
  Check the image 1* for the example. The red box shows where I add the styleSheet property and the green box shows where I click to get to the popup window that lets me add a styleSheet property.</p>
  <p>Image 2* shows how the .ui code is written when I add styleSheet properties this way. The red box here shows how the code is written automatically in the .ui file.</p>
  <p>In the Edit menu of the menuBar, I placed a submenu called &quot;Appearance&quot;, with a few pre-set options of colors of the program and an option to customize the program yourself.
  In image 3*, you can see the menu.</p>
  <p><img src="https://i.stack.imgur.com/iooug.jpg" alt="Images 1, 2 and 3, respectively." /></p>
  <p>When the user clicks one of the color options, it should change the styleSheet properties of the program, so the colors match the color chosen. The problem happens here.
  Image 4 shows the code for clicking in these color options:</p>
  <p><img src="https://i.stack.imgur.com/XISVy.jpg" alt="Color options commands" /></p>
  <p>In the red square, the errors I have been getting, and the respective lines that produced them.
  In the yellow square, two of many trials I have made.
  In the blue square, the most seemingly effective tries. The one in line 21 wasn't compiled when I took the screenshot, but it only complained after compilation (but it did complained!). It says &quot;notr&quot; is not defined in this scope. So I tried declaring it.
  The one in line 22 is gave me an error when I tried &quot;string notr&quot;, saying that the string was not defined in this scope. I included the &lt;stdlib.h&gt;, and changed it to &quot;std::string notr&quot;, but it is still complaining. Like you can see in the red box, it says &quot;expected primary-expression before 'notr'&quot;.</p>
  <p>What does it mean? How do I fix this, so I can change the styleSheet properties of my elements?
  I thought of using styleSheet files for the pre-set colors, but I would like to avoid, if possible, using more files than needed. Also, how would the user be able o set a custom styleSheet, if the options are pre-set?</p>
  <p>Thanks for the attention and help.</p>
  <p>P.S.: Just as a bonus question. I'm trying changing basic colors first, then start advancing.
  Ultimately, I want to be able to reproduce something like Substance Look and Feel, its way of handling colors, making gradients, or giving the titleBar more than one color. Does anyone know what route to take? I believe styleSheets are too weak to reproduce those effects, so I would like to know how else could I change a program to look even more like Susbtance's skins.
  Thanks again.</p>
  <p>*Images 1, 2 and 3 appear in the same image file, because StackOverflow wouldn't let me post more than 2 images.</p>