reverting trunk back to stable 3.4.1 version
git-svn-id: svn://svn.code.sf.net/p/qjoypad/code/trunk@82 c05e91a0-76c8-4ec0-b377-ef19ce7cc080
This commit is contained in:
committed by
virtuoussin13
parent
1cc6e9087e
commit
17ed926cdf
41
src/icon.cpp
41
src/icon.cpp
@ -1,33 +1,30 @@
|
||||
#include "icon.h"
|
||||
|
||||
#include <qpopupmenu.h>
|
||||
|
||||
FloatingIcon::FloatingIcon( const QPixmap &icon, QMenu *popup, QWidget *parent, const char *name)
|
||||
: QDialog( parent ) {
|
||||
this->setObjectName(name);
|
||||
setWindowTitle(NAME);
|
||||
QPalette palette;
|
||||
palette.setBrush(backgroundRole(), QBrush(icon));
|
||||
setPalette(palette);
|
||||
//setPaletteBackgroundPixmap(icon);
|
||||
pop = popup;
|
||||
FloatingIcon::FloatingIcon( const QPixmap &icon, QPopupMenu *popup, QWidget *parent, const char *name)
|
||||
: QDialog( parent, name ) {
|
||||
setCaption(NAME);
|
||||
setPaletteBackgroundPixmap(icon);
|
||||
pop = popup;
|
||||
|
||||
setFixedSize(64,64);
|
||||
setFixedSize(64,64);
|
||||
}
|
||||
|
||||
void FloatingIcon::mousePressEvent( QMouseEvent* e ) {
|
||||
//if it was the right mouse button,
|
||||
if (e->button() == Qt::RightButton) {
|
||||
//bring up the popup menu.
|
||||
pop->popup( e->globalPos() );
|
||||
e->accept();
|
||||
}
|
||||
else {
|
||||
//otherwise, treat it as a regular click.
|
||||
emit clicked();
|
||||
}
|
||||
//if it was the right mouse button,
|
||||
if (e->button() == RightButton) {
|
||||
//bring up the popup menu.
|
||||
pop->popup( e->globalPos() );
|
||||
e->accept();
|
||||
}
|
||||
else {
|
||||
//otherwise, treat it as a regular click.
|
||||
emit clicked();
|
||||
}
|
||||
}
|
||||
|
||||
void FloatingIcon::closeEvent( QCloseEvent* e ) {
|
||||
emit closed();
|
||||
e->accept();
|
||||
emit closed();
|
||||
e->accept();
|
||||
}
|
||||
|
Reference in New Issue
Block a user