Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-13015

Setting a stylesheet on a QGroupBox causes the focus rect of the title not being painted

    XMLWordPrintable

Details

    • fc9d3d2f476ff3a87fccffe3cfe2544547d2bdc3

    Description

      When you switch focus using TAB, the focus rect of the title will not be painted when it has focus. This is different behavior from the case when the QStyleSheetStyle is not being used.


      Code reproducing the problem
      #include <QtGui>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QDialog w;
      
          QLineEdit* le = new QLineEdit("Temp label");
          QGroupBox* groupBox = new QGroupBox("some group box");
      
          groupBox->setCheckable(true);
          QLabel* labelInGroup = new QLabel("in the group box");
          QVBoxLayout* groupLayout = new QVBoxLayout();
          groupLayout->addWidget(labelInGroup);
          groupBox->setLayout(groupLayout);
          QString style = "QGroupBox {font: normal 13px \"Arial\"; } QGroupBox::title {font: normal 18px \"Arial\"; color: rgb(51,51,51); }";
          groupBox->setStyleSheet(style);
          QVBoxLayout* layout = new QVBoxLayout();
          layout->addWidget(le);
          layout->addWidget(groupBox);
          w.setLayout(layout);
          w.resize(500,500);
          w.show();
      
          return a.exec();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mpejcoch Martin Pejcoch (Inactive)
            mpejcoch Martin Pejcoch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes