Results 1 to 4 of 4

Thread: QTableView paint row in stylesheet hover

  1. #1
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QTableView paint row in stylesheet hover

    Hi guys,

    I have a QTableView with items from a result of a QSqlQueryModel. So far, so good, created a stylesheet so that when the mouse pointer was placed on an item, a color was painted. Running perfectly, but not found a way to make the entire line was painted in this case. There are as I do so with stylesheets?

    Then my stylesheet:

    Qt Code:
    1. QTableView::item:hover {
    2. background-color: rgb(185, 210, 235);
    3. }
    To copy to clipboard, switch view to plain text mode 

    See the picture below.
    Thanks,

    Marcelo Estanislau
    Brazil
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTableView paint row in stylesheet hover

    I'm afraid style sheets don't support that. You could send a suggestion to Trolltech.
    J-P Nurmi

  3. #3
    Join Date
    Sep 2012
    Location
    Iran, Tehran
    Posts
    76
    Thanks
    17
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QTableView paint row in stylesheet hover

    I have same problem, also asked in this thread http://www.qtcentre.org/threads/4479...-in-QTableView

    If I want to extend Qt's style sheets, what I have to looking for? How and/or where I must start? Can anyone point me the direction? I have no idea.

  4. #4
    Join Date
    Sep 2012
    Location
    Iran, Tehran
    Posts
    76
    Thanks
    17
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QTableView paint row in stylesheet hover

    I have started by reading the source code of QWidget::setStyleSheet. Also took a look at qcssparser and qstylesheetstyle. What I realized is there are many Qt's private implementation involve in the process of setting a stylesheet. I think choosing another way to solve my problem will be much easier.

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.