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. Make QWidget fit into a QTableView Cell
Forum Updated to NodeBB v4.3 + New Features

Make QWidget fit into a QTableView Cell

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 538 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.
  • F Offline
    F Offline
    Fuel
    wrote on 8 Jul 2017, 07:48 last edited by
    #1

    I have a QWidget that i show in a QTableView. For that i have a Delegate and a Model. In the QWidget i set the Margin and Padding to Zero, but i have that Problem shown on the Picture

    0_1499500015423_star.png

    Anyone knows how i can make it that it fits to his Content? I dont like the Grey Box around the Widget.

    Finally i got that working by doing this.

    rating->render(painter, painter->deviceTransform().map(option.rect.topLeft()));
    

    Maybe thats not correct.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Fuel
      wrote on 8 Jul 2017, 15:27 last edited by
      #2

      The Third Argument of render is a QRegion. With it i was able to fix the Size and the Offset.

      1 Reply Last reply
      0

      1/2

      8 Jul 2017, 07:48

      • 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