title: Qt Custom User Theming
body: <p>I am trying to set up a method for theming with external files. Currently, I have a file being read and put into a QString, then being placed inside of "qApp->setStyleSheet(string);, this seems to work,however, when i color the background of a button it doesn't seem to work. The same css works directly inside of qt designer too. </p>
  
  <p>Function:</p>
  
  <pre><code>void SeniorProject::themer(QString theme_name)
  {
      qDebug() &lt;&lt; theme_name;
      QString file = QCoreApplication::applicationDirPath()
              + "/themes/" + "default" + "/theme.style";
      qDebug() &lt;&lt; "file = " + file;
      QFile themeFile(file);
      QString themeStyle;
      if (themeFile.open(QIODevice::ReadOnly))
      {
          QTextStream in (&amp;themeFile);
          themeStyle = in.readAll();
          themeFile.close();
      }
      else
      {
          qDebug() &lt;&lt; "error";
      }
      qApp-&gt;setStyleSheet(themeStyle);
      update();
  }
  </code></pre>
  
  <p>CSS File</p>
  
  <pre><code>QPushButton#exit {
      color: rgb(220, 0, 0);
      border: none;
      outline: none;
  }
  QPushButton#exit:hover {
      color: rgb(255, 8, 0);
  }
  QPushButton#exit:Pressed {
      color: rgb(150, 0, 0);
  }
  
  
  QFrame#mainbox QPushButton {
      background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgba(122,188,255,1), stop: 0.44 rgba(96,171,248,1), stop: 1 rgba(64,150,238,1));
      border: .1px outset rgb(122, 188, 255);
      border-radius:4px;
  }
  QFrame#mainbox QPushButton:hover {
      background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgba(147,201,255,1), stop: 0.44 rgba(133,190,247,1), stop: 1 rgba(90,163,237,1));
      border: .1px outset rgb(122, 188, 255);
      border-radius:4px;
  }
  QFrame#mainbox QPushButton:pressed {
      background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgba(84,169,255,1), stop: 0.44 rgba(66,155,244,1), stop: 1 rgba(45,141,237,1));
      border: .1px outset  rgb(122, 188, 255);
      border-radius:4px;
  }
  </code></pre>
  
  <p>The background in the QPushButtons is my currently problem, the stylesheet loads correctly and updates (I can tell because the borders on the buttons actually change to what I want), but the background does not seem to be working. Can anyone help me? Thanks.</p>