Results 1 to 6 of 6

Thread: QFrame V and H Line

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default QFrame V and H Line

    Hey there,

    I'd like to have a QFrame : BOX and PLAIN with only :
    - The right Vertical line.
    - The bottom Horizontal line.

    Like this :



    Is it possible ?

  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: QFrame V and H Line

    J-P Nurmi

  3. #3
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: QFrame V and H Line

    Draws a line separator at the center.

    Not what I want.

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFrame V and H Line

    You can subclass QFrame and draw the lines urself, cant u

  5. #5
    Join Date
    Dec 2006
    Location
    San Antonio, TX
    Posts
    9
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFrame V and H Line

    bunjee,

    Qt Code:
    1. frame->setFrameShape( QFrame::StyledPanel );
    2. frame->setStyleSheet( "border-width: 2px; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-color: blue; ");
    To copy to clipboard, switch view to plain text mode 

    I usually figure out the context of the style sheet setting by opening designer and creating the object, then right click on the object and select "Change styleSheet" option to work out the kinks.

    Hope this helps,

    Junior

  6. #6
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: QFrame V and H Line

    Solved it this way :

    Qt Code:
    1. q->setFrameStyle(QFrame::Box | QFrame::Plain);
    2. q->setLineWidth(2);
    3. q->setContentsMargins(0, 0, 2, 2);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  2. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  3. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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.