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. QTableView showing extra space

QTableView showing extra space

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.9k Views 1 Watching
  • 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.
  • N Offline
    N Offline
    nike.niec
    wrote on last edited by
    #1

    i am displaying a QTableView with customized QTableModel.
    my model has two row and two columns
    Parent of QTableView is one of the widget in QTabWidget

    My QTableView is showing extra space after displaying a table of two rows and colums,both in horizontal and verticla direction

    How to remove this extra unwanted white space.

    Also scroll bar is not coming in my view

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

      You have two ways for that:

      1. Stretch last column;
      2. Resize QTableView widget to contents.

      I think for many applications first way is prefered and you can turn it on just by:
      @ui->tableView->horizontalHeader()->setStretchLastSection(true);@

      about second way you can read "here":http://stackoverflow.com/questions/1850391/how-do-i-resize-qtableview-so-that-the-area-is-not-scrolled-anymore .

      1 Reply Last reply
      0

      • Login

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