Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT 6.9 QTableView QStyledItemDelegate Button CSS not working
Forum Updated to NodeBB v4.3 + New Features

QT 6.9 QTableView QStyledItemDelegate Button CSS not working

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 58 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Peter Akakpo
    wrote 21 days ago last edited by
    #1

    Button Css does not apply on qtableview button drawn inside a QStyledItemDelegate with QT 6.9. QT 6.8 works fine. Below is the code that draws the button.

    QStyleOptionButton button;
    button.rect = option.rect.adjusted(2,2,-2,-2);
    button.state = QStyle::State_Enabled | QStyle::State_Raised;
    button.icon= QIcon(index.column()==0 ? ":/images/svg/media/media_play.svg" : ":/images/png/eye.png");
    button.iconSize= QSize(12,12);
    btn.style()->drawControl(QStyle::CE_PushButton, &button, painter, &btn);

    QT 6.8 Snapshot

    99f46a38-0e1e-4814-90fe-820e99a54a06-image.png

    QT 6.9 Snapshot

    7304b183-a60a-477e-9bcb-e475f74674e5-image.png

    CSS

    QPushButton {
    color: rgb(226, 226, 226);
    background-color: #333333;
    padding: 4px 20px;
    margin-bottom: 0px;
    border: 1px outset #333333;
    border-radius: 0px;
    }

    Please observe the first and last columns. in QT 6.9 , the borders of the buttons are not showing

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote 21 days ago last edited by
      #2

      Please provide a minimal, compilable example of your problem - I would guess it's not more than 30 lines.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1

      2/2

      14 May 2025, 15:37

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved