bool QAquaAnimate::addWidget(QWidget *w) { if(focusable(w)) { if(w->hasFocus()) setFocusWidget(w); w->installEventFilter(this); } if(w == d->defaultButton || d->progressBars.contains((QProgressBar*)w)) //already knew of it return FALSE; if(w->inherits("QPushButton")){ QPushButton * btn = (QPushButton *) w; if(btn->isDefault() || (btn->autoDefault() && btn->hasFocus())){ d->defaultButton = btn; btn->installEventFilter(this); if(btn->isVisible() && d->buttonTimerId == -1) d->buttonTimerId = startTimer(50); } return TRUE; } else if(w->inherits("QProgressBar")){ w->installEventFilter(this); QObject::connect(w, SIGNAL(destroyed(QObject*)), this, SLOT(objDestroyed(QObject*))); if(w->isVisible() && d->progressTimerId == -1) { d->progressBars.append((QProgressBar*)w); d->progressTimerId = startTimer(50); } return TRUE; } else if(w->inherits("QListView")) {
void SymbolDialog::addCurrentChar() { for (int i = 1; i < numButtons; i++) { QPushButton *btn = (QPushButton *)buttons->button(i); if (btn && btn->hasFocus()) emit addLetter(btn->text()); } }
void symbolDialog::addCurrentChar() { for (int i=0; i<GroupBox1->count(); i++) { QPushButton *btn = (QPushButton *) GroupBox1->find (i); if (btn && btn->hasFocus()) { emit addLetter(btn->text()); return; } } }
bool DialogyWidget::clickButton(QDialogButtonBox::StandardButton standardButton) { QPushButton* pb = qobject_cast<QPushButton*>(focusWidget()); if (pb && pb->isVisible() && pb->isEnabled() && pb->hasFocus()) { pb->click(); return true; } QList<QDialogButtonBox*> buttonBoxes = findChildren<QDialogButtonBox*>(); for (int i = 0; i < buttonBoxes.size(); ++i) { QDialogButtonBox* buttonBox = buttonBoxes.at(i); pb = buttonBox->button(standardButton); if (pb && pb->isVisible() && pb->isEnabled()) { pb->click(); return true; } } return false; }