Unsolved qpushbutton tooltip displays without icon
-
i have a qtoolbutton and i've set an icon to it and a tooltip. the tooltip also show the icon of the button before tooltip text.
i also have a qpsuhbutton and i've set an icon to it and a tooltip. the tooltip only shows the tooltip text. how can i make it behave like qtoolbutton's tooltip?
-
Hi
Really ?
mine Tool buttons do not show icon in tooltip ??
-
@mrjj
yes my toolbutton has an icon in tooltip -
@user4592357
What Qt version are you using?
Can you post example? -
@Taz742
i'm using qt5.11.1DeleteButton::DeleteButton(QWidget* parent) : QToolButton(parent) { setIcon(QIcon(":/remove")); setCheckable(false); setEnabled(false); setToolTip("Delete"); }
-
Hi,
AFAIK, you have a button with an icon and a tooltip. You don't have a tooltip with an icon.
You should post images of what you are getting in both cases.
-
@user4592357 said in qpushbutton tooltip displays without icon:
QIcon(":/remove")
Are you sure :/remove is a correct path of image?
-
Hi,
maybe someone has still the same problem.I encounter something similar as setting the border-image via setStyleSheet. If one skip the selector the change will affect the tooltip as well:
pushButton->setStyleSheet(" border-image: url(:image);");
Changing this into
pushButton->setStyleSheet("QPushButton{ border-image: url(:image); }");
remove the image from the tooltip.