Results 1 to 3 of 3

Thread: QTableView empty view

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default QTableView empty view

    Hi,

    I have a table view. When no items exist, I want to show a message in the center of the table view like "No items". As far as I researched, there is no empty view widget inside QTableView. Any ideas for a possible workaround?

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QTableView empty view

    Have you tried to subclass QTableView, reimplement paintEvent and render this text if your model contains no items ?

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: QTableView empty view

    Yeah sorry to not mention. I thought about it but just wanted to check if there would be an easier solution.

    This might be a good improvement as well if qt supports such embedded empty view for tables & lists for future releases.

Similar Threads

  1. Qt View adds empty rows
    By RaymondMcEvilly in forum Qt Programming
    Replies: 4
    Last Post: 24th February 2013, 03:10
  2. Replies: 5
    Last Post: 29th June 2010, 11:58
  3. View decoration role empty on Windows
    By sebr in forum Qt Programming
    Replies: 5
    Last Post: 28th October 2007, 10:44
  4. QTableView showing empty fields
    By ederbs in forum Qt Programming
    Replies: 5
    Last Post: 4th October 2007, 00:30
  5. QTableView from SQLite, empty!
    By grellsworth in forum Qt Programming
    Replies: 9
    Last Post: 3rd July 2007, 20:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.