hello guys,
i want to customize my pushbutton by reimplementing paintevent. the
problem is, i don't know how to check the button state within
paintevent, say "hover" "pressed". i didn't find any function
returning these state.
thanks.
hello guys,
i want to customize my pushbutton by reimplementing paintevent. the
problem is, i don't know how to check the button state within
paintevent, say "hover" "pressed". i didn't find any function
returning these state.
thanks.
hi,
see QWidget::underMouse() and for the pressed you have to reimplement the mouse handlers as well and save the press state in a member variable yourself.
You can call QPushButton::initStyleOption() to ask Qt to fill some of the data into the styleoption object for you.
Bookmarks