Results 1 to 10 of 10

Thread: How to remove 3D frame and outline in QToolButton?

  1. #1
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default How to remove 3D frame and outline in QToolButton?

    I have a problem with QToolButton in removing default 3D frame and outline. I don't know how to remove 3D frame and outline in QToolButton when the mouse points at it?

    Somebody help me!
    Last edited by Kevin Hoang; 9th March 2010 at 06:04.

  2. The following user says thank you to Kevin Hoang for this useful post:

    ArlexBee-871RBO (9th March 2010)

  3. #2
    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: How to remove 3D frame and outline in QToolButton?

    How will user then know that hes about to click the button ?
    What functionality you want to achieve ?

    May be meanwhile you can have look at autoRaise property of QToolButton. Also if you are using QPushButton, you can use setFlat(true).

  4. #3
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: How to remove 3D frame and outline in QToolButton?

    Thank you very much!

    I'm using an image instead default QT button, when users points the mouse as it, it will display another image.

    I didn't see setFlat function in QToolButton. Can you help me where this function is available.

  5. #4
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to remove 3D frame and outline in QToolButton?

    Quote Originally Posted by Kevin Hoang View Post
    Thank you very much!

    I'm using an image instead default QT button, when users points the mouse as it, it will display another image.

    I didn't see setFlat function in QToolButton. Can you help me where this function is available.
    means u are using a QToolButton or a pixmap which u want the image to act it like a button ..?
    "Behind every great fortune lies a crime" - Balzac

  6. #5
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: How to remove 3D frame and outline in QToolButton?

    Quote Originally Posted by wagmare View Post
    means u are using a QToolButton or a pixmap which u want the image to act it like a button ..?
    exactly, below that image is text.

  7. #6
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to remove 3D frame and outline in QToolButton?

    ok create a own widget with a pixmap added in label1 and below label2 the text u want to display ... override the void QWidget::mousePressEvent ( QMouseEvent * event ) and emit your custom signal

    Qt Code:
    1. void
    2. customButton::mousePressEvent(QMouseEvent *event)
    3. {
    4. if (event->button() != Qt::LeftButton)
    5. {
    6. QWidget::mousePressEvent(event);
    7. return;
    8. }
    9. emit
    10. myOwnSignal();
    11. }
    To copy to clipboard, switch view to plain text mode 
    this signal will be emitted when user press or click on the widget ..
    "Behind every great fortune lies a crime" - Balzac

  8. #7
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: How to remove 3D frame and outline in QToolButton?

    wagmare: Thank you very much!

    Does it have any other ways?

  9. #8
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to remove 3D frame and outline in QToolButton?

    Quote Originally Posted by Kevin Hoang View Post
    Does it have any other ways?
    then u can use autoRaise property set to true in QToolButton what aamer suggest .... its the only option ..
    use setIcon(const QIcon icon) of QToolButton to set the image and set toolButtonStyle() to Qt::ToolButtonTextUnderIcon
    "Behind every great fortune lies a crime" - Balzac

  10. #9
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: How to remove 3D frame and outline in QToolButton?

    Quote Originally Posted by wagmare View Post
    then u can use autoRaise property set to true in QToolButton what aamer suggest .... its the only option ..
    use setIcon(const QIcon icon) of QToolButton to set the image and set toolButtonStyle() to Qt::ToolButtonTextUnderIcon
    By this way, it doesn't remove default style (3D Frame and outline) when users points mouse as it.

  11. #10
    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: How to remove 3D frame and outline in QToolButton?

    Quote Originally Posted by Kevin Hoang View Post
    I'm using an image instead default QT button, when users points the mouse as it, it will display another image.
    Are you doing that though style-sheets? If so, what exactly is your style-sheet? If not then why not?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Video Parsing - Frame by Frame
    By ctote in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2010, 19:30
  2. Checking for intersect of QPainterPath OUTLINE?
    By SonOfGuest in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2009, 01:30
  3. Line Outline?
    By jon-ecm in forum Qt Programming
    Replies: 0
    Last Post: 23rd April 2009, 01:46
  4. Previous frame inner to this frame(corrupt stack?)
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 28th May 2007, 02:35
  5. Previous frame inner to this frame(corrupt stack?)
    By coralbird in forum Qt Programming
    Replies: 17
    Last Post: 29th April 2006, 02:42

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.