TransparentTop::TransparentTop(QWidget *parent, unsigned transparent) : QObject(parent) { m_transparent = transparent * 0.01; rootpixmap = new KRootPixmap(parent); rootpixmap->setCustomPainting(true); connect(rootpixmap, SIGNAL(backgroundUpdated(const QPixmap&)), this, SLOT(backgroundUpdated(const QPixmap&))); transparentChanged(); }
TransparentTop::TransparentTop(QWidget *parent, ConfigBool &_useTransparent, ConfigULong &_transparent) : QObject(parent, _TRANSPARENT), useTransparent(_useTransparent), transparent(_transparent) { #if defined(USE_KDE) && defined(HAVE_KROOTPIXMAP_H) rootpixmap = new KRootPixmap(parent); #endif QObjectList *l = parent->queryList("TransparentBg"); QObjectListIt it(*l); QObject *obj; while ((obj = it.current()) != NULL){ TransparentBg *transp = static_cast<TransparentBg*>(obj); transp->init(parent); ++it; } connect(pMain, SIGNAL(transparentChanged()), this, SLOT(transparentChanged())); transparentChanged(); }
bool TransparentTop::eventFilter(QObject*, QEvent *e) { switch (e->type()){ case QEvent::WindowActivate: case QEvent::WindowDeactivate: transparentChanged(); break; default: break; } return false; }
TransparentTop::TransparentTop(QWidget *parent, unsigned transparent) : QObject(parent) { m_transparent = transparent * 0.01; rootpixmap = new KRootPixmap(parent); #if COMPAT_QT_VERSION < 0x030000 parent->installEventFilter(this); #else rootpixmap->setCustomPainting(true); connect(rootpixmap, SIGNAL(backgroundUpdated(const QPixmap&)), this, SLOT(backgroundUpdated(const QPixmap&))); #endif transparentChanged(); }
void TransparentTop::setTransparent(unsigned transparent) { m_transparent = transparent * 0.01; transparentChanged(); }