Results 1 to 4 of 4

Thread: Selector for a tab with unread data

  1. #1
    Join Date
    Mar 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Selector for a tab with unread data

    I use css style to distinguish tabs in Konsole application:
    Qt Code:
    1. QTabBar::tab:selected {
    2. background: #4286f4
    3. }
    4. QTabBar::tab:hover {
    5. background: #dff442
    6. }
    7. QTabBar::tab:selected:hover {
    8. background: #fd4442
    9. }
    10. QTabBar::tab {
    11. background: #449449
    12. }
    To copy to clipboard, switch view to plain text mode 
    Everything works fine. The only problem I can not solve is foreground for a tab which has unread data. Does anyone know which selector to use? Default style conflicts with my color.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Selector for a tab with unread data

    The application code might need to support that by having a property on the tab for "has unread data" which you can then use in the selector.

    Cheers,
    _

  3. #3
    Join Date
    Mar 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Selector for a tab with unread data

    Can you please point me to some example of a widget custom state implementation? And how it is connected to setStyleSheet if at all.

    Thanks in advance

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Selector for a tab with unread data

    See http://doc.qt.io/qt-5/qobject.html#Q_PROPERTY for declaring properties, see "property selector" here on how to use them in the style sheet

    Cheers,
    _

Similar Threads

  1. QFileDialog Filter Selector
    By SixDegrees in forum Qt Programming
    Replies: 0
    Last Post: 7th May 2010, 02:00
  2. List selector doesnt become visiable
    By shiranraviv in forum Qt Programming
    Replies: 2
    Last Post: 16th November 2009, 07:59
  3. Custom selector widget
    By Strongoloid in forum Newbie
    Replies: 8
    Last Post: 5th August 2009, 17:10
  4. Language Selector QCombobox question
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 31st January 2008, 09:03
  5. QLabel Stylesheet selector issue.
    By Enygma in forum Qt Programming
    Replies: 3
    Last Post: 24th August 2007, 15:52

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.