CMS 3D CMS Logo

IgQtPixButton Class Reference

#include <Iguana/Studio/interface/IgQtPixButton.h>

List of all members.

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)


Detailed Description

Definition at line 16 of file IgQtPixButton.h.


Constructor & Destructor Documentation

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); }


Member Function Documentation

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 }

void IgQtPixButton::showWhatsThisHelp ( void   )  [protected, slot]

Definition at line 59 of file IgQtPixButton.cc.

Referenced by mousePressEvent().

00060 { QWhatsThis::display (QWhatsThis::textFor(this, QPoint (), true)); }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:25:27 2009 for CMSSW by  doxygen 1.5.4