Take pixmap of pressed button ?
-
@Dariusz What do you mean by "take pixmap"?
What about https://doc.qt.io/qt-5/qabstractbutton.html#icon-prop ? -
so what does QPushbutton::grab() with default parameters do in your case? According to docs, it should do what you seem to want.
-
@Kent-Dorfman Grab would return it in natural state, but I need it in pressed state.
-
@Dariusz Then subclass QPushButton and override https://doc.qt.io/qt-5/qabstractbutton.html#mousePressEvent and grab the pixmap there.
-
@jsulm said in Take pixmap of pressed button ?:
@Dariusz Then subclass QPushButton and override https://doc.qt.io/qt-5/qabstractbutton.html#mousePressEvent and grab the pixmap there.
Hmm will give it a go. But I need to grab it before UI shows up to display it as icon in other areas.
-
@Dariusz said in Take pixmap of pressed button ?:
But I need to grab it before UI shows
I don't think you can do this as there is nothing to grab if nothing is shown. You would need to render to a buffer somehow, but I really don't know how you could do this.