Advertisement
Guest User

Combo

a guest
Dec 22nd, 2014
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. /* Combobox class */
  2. class HoverableComboBox : public QComboBox
  3. {
  4.     Q_OBJECT
  5.  
  6. public:
  7.     HoverableComboBox() { this->installEventFilter(this); }
  8.     /*~HoverableComboBox();*/
  9.  
  10. signals:
  11.     void opened();
  12.     void closed();
  13.  
  14. private:
  15. public:
  16.     void hidePopup()
  17.     {
  18.        QComboBox::hidePopup();
  19.        emit closed();
  20.     }
  21.  
  22.     void showPopup()
  23.     {
  24.        QComboBox::showPopup();
  25.        emit opened();
  26.     }
  27.     void paintEvent(QPaintEvent * e)
  28.     {
  29.         QComboBox::paintEvent(e);
  30.     }
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement