00001 #ifndef INFOPOPUP_H 00002 #define INFOPOPUP_H 00003 00004 #include <qapplication.h> 00005 #include <qpopupmenu.h> 00006 #include <qclipboard.h> 00007 #include <qstring.h> 00008 00009 00010 class InfoPopup : public QPopupMenu 00011 { 00012 Q_OBJECT 00013 00014 public: 00015 InfoPopup(QWidget * parent = 0, const char * name = 0) : QPopupMenu(parent, name) 00016 { 00017 connect( this, SIGNAL( activated( int ) ), 00018 this, SLOT( slotCopyText( int ) ) ); 00019 } 00020 00021 00022 public slots: 00023 00024 void slotCopyText(int id) 00025 { 00026 QString str = text(id); 00027 QClipboard *cb = QApplication::clipboard(); 00028 00029 cb->setText( str, QClipboard::Clipboard ); 00030 00031 } 00032 00033 00034 }; 00035 00036 #endif //INFOPOPUP_H