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!
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).
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.
Re: How to remove 3D frame and outline in QToolButton?
Quote:
Originally Posted by
Kevin Hoang
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 ..?
Re: How to remove 3D frame and outline in QToolButton?
Quote:
Originally Posted by
wagmare
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.
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
Code:
void
{
if (event->button() != Qt::LeftButton)
{
return;
}
emit
myOwnSignal();
}
this signal will be emitted when user press or click on the widget ..:o
Re: How to remove 3D frame and outline in QToolButton?
wagmare: Thank you very much!
Does it have any other ways?
Re: How to remove 3D frame and outline in QToolButton?
Quote:
Originally Posted by
Kevin Hoang
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
Re: How to remove 3D frame and outline in QToolButton?
Quote:
Originally Posted by
wagmare
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. :)
Re: How to remove 3D frame and outline in QToolButton?
Quote:
Originally Posted by
Kevin Hoang
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?