#include <Iguana/Studio/interface/IgQtPixButton.h>
Public Member Functions | |
IgQtPixButton (QPixmap pixmap, QWidget *parent, const char *name=0) | |
IgQtPixButton (QWidget *parent, const char *name=0) | |
Protected Slots | |
void | showWhatsThisHelp (void) |
Protected Member Functions | |
void | initialise (QPixmap pixmap) |
void | mousePressEvent (QMouseEvent *event) |
Definition at line 16 of file IgQtPixButton.h.
IgQtPixButton::IgQtPixButton | ( | QWidget * | parent, | |
const char * | name = 0 | |||
) |
Definition at line 19 of file IgQtPixButton.cc.
References initialise().
00020 : QToolButton (parent, name) 00021 { initialise (QPixmap ()); }
IgQtPixButton::IgQtPixButton | ( | QPixmap | pixmap, | |
QWidget * | parent, | |||
const char * | name = 0 | |||
) |
Definition at line 23 of file IgQtPixButton.cc.
References initialise().
00024 : QToolButton (parent, name) 00025 { initialise (pixmap); }
void IgQtPixButton::initialise | ( | QPixmap | pixmap | ) | [protected] |
Definition at line 28 of file IgQtPixButton.cc.
Referenced by IgQtPixButton().
00029 { 00030 setAutoRepeat (true); 00031 setAutoRaise (true); 00032 if (!pixmap.isNull ()) 00033 setPixmap (pixmap); 00034 }
void IgQtPixButton::mousePressEvent | ( | QMouseEvent * | event | ) | [protected] |
Definition at line 37 of file IgQtPixButton.cc.
References count, and showWhatsThisHelp().
00038 { 00039 QPopupMenu *menu = popup (); 00040 if (event->button () == Qt::RightButton && menu) 00041 { 00042 QString text (QWhatsThis::textFor(this, QPoint (), true)); 00043 unsigned int count = menu->count (); 00044 if(!text.isNull()) 00045 { 00046 menu->insertSeparator (); 00047 menu->insertItem ("&What's This?", this, SLOT (showWhatsThisHelp (void))); 00048 } 00049 popup ()->exec (QCursor::pos ()); 00050 event->accept (); 00051 while (menu->count () > count) 00052 menu->removeItemAt (count); 00053 } 00054 else 00055 QToolButton::mousePressEvent (event); 00056 }