How to make a QPushButton appear as a shaped back button similar to iOS?
-
Basically a rectangle, with a triangular arrow shape on left-side:
Example:
http://cssnerd.com/wp-content/uploads/2013/03/Screen-Shot-2013-03-09-at-22.13.01-600x367.png
Thanks in advance,
-Ed
-
@Eddie you can either use
QPushButton::setIcon(const QIcon& icon)
, but that just paints the graphic on a standard push button leaving the frame visible. If you want to change that I am afraid you have to go deeper and override thepaintEvent(QPaintEvent *e)
method of QPushButton. -
Or just use a custom image with a stylesheet:
button->setStyleSheet("background-image: url(...)")