Results 1 to 4 of 4

Thread: Change HLine color

  1. #1
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Change HLine color

    Hi, I'm trying to display a hierarchy and am using HLines and VLines to show relationship.

    The only problem is that I can't seem to change their color.

    Any help would be much appreciated.

    Cheers
    G

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Change HLine color

    What kind of hierarchy? Maybe it'll be easier if you just paint all lines and text instead of using line widgets?

  3. #3
    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: Change HLine color

    A QFrame with frame shape of QFrame::VLine or QFrame::HLine and frame shadow of QFrame::Plain draws the line with QPalette::WindowText:
    Qt Code:
    1. QPalette palette = line->palette();
    2. palette.setColor(QPalette::WindowText, Qt::red);
    3. line->setPalette(p);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  4. The following user says thank you to jpn for this useful post:

    smtgra011 (5th July 2007)

  5. #4
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Change HLine color

    Legendary, thanks alot.

    Cheers
    G

Similar Threads

  1. Change background color of QPushButton
    By gtthang in forum Qt Programming
    Replies: 3
    Last Post: 26th November 2013, 10:23
  2. How to change color of Tab in QTabWidget?
    By rajesh in forum Qt Programming
    Replies: 10
    Last Post: 21st October 2013, 07:52
  3. Change QPushButton Background Color, Qt4.3
    By Rayven in forum Qt Programming
    Replies: 5
    Last Post: 4th July 2009, 07:14
  4. Replies: 2
    Last Post: 9th March 2007, 23:19
  5. [QTable] Change row's color
    By villy in forum Qt Programming
    Replies: 5
    Last Post: 15th November 2006, 19:21

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.