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

QTableWidget Stylesheet Issue

    XMLWordPrintable

Details

    • Android, Windows

    Description

      In QtCreator (11.0.3 ), I placed a QTableWidget, and set stylesheet (thru QtCreator interface) as follows;
       
      {{QTableView

      {background-color: rgb(47, 177, 83);font: 22pt "Arial"; selection-color: rgb(0, 85, 0);color: rgb(255, 255, 255);}


      QTableView::item

      { border: 0px; padding: 25px;}

      }}

      Formatting are are taking effect; but row size is not increasing to accommodate text.
      But if the same is done thru code, (ui->tablewidget->SetStylesheet(...)), row size is increasing.

      What I had to do to retain stylesheet done in Qt Creator is to add a line as following in code;
       
      ui->tablewidget->setStyleSheet(ui->tablewidget->styleSheet());

      This fixes the issue. Sample image is added; first image without the line in code.

      Attachments

        1. qt-bug.png
          qt-bug.png
          3 kB
        2. QTBug-QTW.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            axelspoerl Axel Spoerl
            abygm Aby Mathews
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes