Пример #1
0
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")) {
Пример #2
0
void SymbolDialog::addCurrentChar() {
  for (int i = 1; i < numButtons; i++) {
    QPushButton *btn = (QPushButton *)buttons->button(i);
    if (btn && btn->hasFocus())
      emit addLetter(btn->text());
  }
}
Пример #3
0
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;
		}
	}
}
Пример #4
0
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;
}