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. [Solved] QTableWidget padding

[Solved] QTableWidget padding

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 23.3k 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.
  • V Offline
    V Offline
    VRonin
    wrote on 8 Jan 2013, 18:10 last edited by
    #1

    I use setCellWidget() method of the class QTableWidget but It puts A LOT of space between the widget border and the cell border, is there a way to remove this cell padding.

    I tried with a stylesheet:
    @
    QTableWidget::item{
    border: none;
    padding: 0px;
    margin: 0px;
    }
    @

    but it didn't work

    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
    ~Napoleon Bonaparte

    On a crusade to banish setIndexWidget() from the holy land of Qt

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 8 Jan 2013, 21:12 last edited by
      #2

      Well, maybe check if you're setting the style on right widget. I just checked setting the padding and it "just works".
      With code like this:
      @
      ui->tableWidget->setStyleSheet("QTableWidget::item { padding: 0px }");
      ui->tableWidget_2->setStyleSheet("QTableWidget::item { padding: 10px }");
      @
      i get
      !http://img854.imageshack.us/img854/7120/tablepadding.jpg(table padding)!

      1 Reply Last reply
      0

      1/2

      8 Jan 2013, 18:10

      • Login

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