title: Style sheet is appliped to the cells in QGridLayout instead of the parent container
body: <p>I have inherited QWidget to make a class called (lets say..) TaskBox.<br>
  I've applied a QGridLayout to my TaskBox.<br>
  The layout consists of several QLabels.</p>
  
  <p>I've changed the background color of the TaskBox by setting a style sheet for it.<br>
  Now it looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/ZAcg9.png" alt="enter image description here"></p>
  
  <p>This is what I want, and I'm happy with it.</p>
  
  <p>The problem is, I want to add Q_OBJECT macro to TaskBox class. (because I need to use signals and slots)</p>
  
  <p>After adding Q_OBJECT macro, my TaskBox objects becomes like this:</p>
  
  <p><img src="https://i.stack.imgur.com/s3xK7.png" alt="enter image description here"></p>
  
  <p>It looks like the style sheet is broken into cells in QGridLayout.</p>
  
  <p>Here is my TaskBox class:</p>
  
  <pre><code>class TaskBox : public QWidget{
  
  Q_OBJECT
  
  public:
  
  
      QLabel * title;
      QLabel * description;
      QGridLayout * layout;
  
  
     TaskBox(){
  
         layout = new QGridLayout();
  
         setRandomColor();   //Function is available below
  
  
         title = new QLabel("Something");
         title-&gt;setStyleSheet("color:white;");
  
  
         description = new QLabel("Something again");
         description-&gt;setStyleSheet("color:white;");
  
  
         layout-&gt;addWidget(title, 0,0);
         layout-&gt;addWidget(description,1,0);
  
  
         layout-&gt;setColumnStretch(0,2);
         layout-&gt;setColumnStretch(1,1);
  
         setLayout(layout);
  
  
     }
  
  
     void setRandomColor(){
  
          setStyleSheet("border-radius: 5px;background-color:rgb(" + QString::number((rand() % 255)) + "," + QString::number((rand() % 255)) + "," + QString::number((rand() % 255)) + ");");
     }
  
  
  };
  </code></pre>
  
  <p>I can't understand what's going on.<br>
  Thanks for any of your helps! </p>