void WindowManager::registerWidget(QWidget *widget) { if (isBlackListed(widget)) { addEventFilter(widget, this); } else if (isDragable(widget)) { addEventFilter(widget, this); } }
void GtkProxyStyle::polish(QWidget *widget) { #ifdef ENABLE_OVERLAYSCROLLBARS if (SB_Overlay==sbarType && sbarThumb && widget && qobject_cast<QAbstractScrollArea *>(widget) && qstrcmp(widget->metaObject()->className(), "QComboBoxListView")) { addEventFilter(widget, this); widget->setAttribute(Qt::WA_Hover, true); } else if (SB_Standard!=sbarType && usePlainScrollbars(widget)) { widget->setAttribute(Qt::WA_Hover, true); } #else // TODO: Why was this here?? Should it not have just been for QScrollBars??? // if (SB_Standard!=sbarType) { // widget->setAttribute(Qt::WA_Hover, true); // } if (SB_Standard!=sbarType && qobject_cast<QScrollBar *>(widget) && isOnCombo(widget)) { widget->setProperty(constOnCombo, true); } #endif #ifndef ENABLE_KDE_SUPPORT if (widget && qobject_cast<QMenu *>(widget) && !widget->property(constAccelProp).isValid()) { AcceleratorManager::manage(widget); widget->setProperty(constAccelProp, true); } #endif baseStyle()->polish(widget); }
Pointer & Pointer::operator=(QWidget *w) { widget_=w; if (widget_) { addEventFilter(widget_, this); } return *this; }
LogBrowser::LogBrowser(QWidget *parent) : QWidget(parent) , m_nextID(0) , m_actorFilterActive(false) , m_actorFilterCheck(0) { m_log = new LogModel(this); m_log->setResultType(Log::MostRecentSubjects); QSortFilterProxyModel *filter = new QSortFilterProxyModel(this); filter->setSourceModel(m_log); filter->setSortCaseSensitivity(Qt::CaseInsensitive); filter->setDynamicSortFilter(true); filter->setFilterKeyColumn(0); QLineEdit *searchBox = new QLineEdit(this); searchBox->setPlaceholderText(tr("Search")); connect(searchBox, SIGNAL(textEdited(QString)), filter, SLOT(setFilterFixedString(QString))); QListView *view = new QListView(this); view->setResizeMode(QListView::Adjust); connect(view, SIGNAL(activated(QModelIndex)), this, SLOT(handleActivation(QModelIndex))); m_logView = view; m_logView->setModel(filter); QVBoxLayout *layout = new QVBoxLayout(this); m_filterLayout = new QHBoxLayout(this); layout->addWidget(searchBox); layout->addLayout(m_filterLayout); layout->addWidget(m_logView); m_actionMapper = new QSignalMapper(this); connect(m_actionMapper, SIGNAL(mapped(int)), this, SLOT(applyFilter(int))); DataModel::Event emptyEvent; addEventFilter(DataModel::EventList() << emptyEvent, "All")->setChecked(true); }
//___________________________________________________________ void BlurHelper::registerWidget( QWidget* widget ) { // check if already registered if( _widgets.contains( widget ) ) return; // install event filter addEventFilter( widget ); // add to widgets list _widgets.insert( widget ); // cleanup on destruction connect( widget, SIGNAL(destroyed(QObject*)), SLOT(widgetDestroyed(QObject*)) ); if( enabled() ) { // schedule shadow area repaint _pendingWidgets.insert( widget, widget ); update(); } }
void GtkProxyStyle::polish(QApplication *app) { addEventFilter(app, shortcutHander); TouchProxyStyle::polish(app); }