Results 1 to 3 of 3

Thread: Table model header and statustip

  1. #1
    Join Date
    Nov 2010
    Posts
    22
    Thanks
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Table model header and statustip

    Is it possible to have a statustip message when pointing over a table header?

    I am using a custom QTableView with a custom model. After setting viewport()->setMouseTracking(true) I get a status tip for every cell of the table but not for the headers.

    I have something like:

    QVariant MyModel::headerData ( int section, Qt::Orientation orientation, int role) const {
    if (role == Qt::StatusTipRole) {
    qDebug() << "!!! at header stuff !!!";
    return tr("My status tip test")
    ....
    }
    ....
    }

    I can never get that log message :-(

    any ideas????

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Table model header and statustip

    You could try and see if you have to enable mouse tracking on the header views as well (horizontalHeader(), verticalHeader()).
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  3. #3
    Join Date
    Nov 2010
    Posts
    22
    Thanks
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Table model header and statustip

    I have this:

    horizontalHeader()->viewport()->setMouseTracking(true);
    horizontalHeader()->setMouseTracking(true);

    I monitor the calls to MyModel::headerData and I see Qt::ToolTipRole but never Qt::StatusTipRole
    maybe am I missing something else?

Similar Threads

  1. how to add a image to table column header
    By nageshvk in forum Newbie
    Replies: 3
    Last Post: 25th December 2010, 13:34
  2. Editable table header
    By bbarran in forum Qt Programming
    Replies: 4
    Last Post: 9th December 2010, 10:26
  3. How to fix width of the Table Header
    By rk0747 in forum Qt Programming
    Replies: 0
    Last Post: 27th September 2010, 09:46
  4. Editable table header
    By cmaxb in forum Qt Programming
    Replies: 1
    Last Post: 9th December 2006, 12:12
  5. How can i set a delegate on header in table
    By ankurjain in forum Qt Programming
    Replies: 1
    Last Post: 16th May 2006, 13:04

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.