[Qt-interest] check button state during paintevent

Yifei Li yifli at mtu.edu
Thu Nov 12 01:31:31 CET 2009


Reimplement event() as follows:

bool event(QEvent* e)
{
   switch(e->type())
   {
      case QEvent::HoverEnter:
         m_hover = true;
         break;
      case QEvent::HoverLeave:
         m_hover = false;
         break;
   }
}

Yifei
----- Original Message -----
From: "Shi Yan" <billconan at gmail.com>
To: qt-interest at trolltech.com
Sent: Wednesday, November 11, 2009 4:07:02 PM GMT -05:00 US/Canada Eastern
Subject: [Qt-interest] check button state during paintevent

hello guys,

i want to customize my pushbutton by reimplement 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.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list