// connection internal signals & slots void QKeySequenceWidget::_connectingSlots() { // connect signals to slots connect(d_ptr->clearButton, SIGNAL(clicked()), this, SLOT(clearKeySequence())); connect(&d_ptr->modifierlessTimeout, SIGNAL(timeout()), this, SLOT(doneRecording())); connect(d_func()->shortcutButton, SIGNAL(clicked()), this, SLOT(captureKeySequence())); }
FcitxQtKeySequenceWidget::FcitxQtKeySequenceWidget(QWidget *parent) : QWidget(parent), d(new FcitxQtKeySequenceWidgetPrivate(this)) { d->init(); setFocusProxy( d->keyButton ); connect(d->keyButton, SIGNAL(clicked()), this, SLOT(captureKeySequence())); connect(d->clearButton, SIGNAL(clicked()), this, SLOT(clearKeySequence())); connect(&d->modifierlessTimeout, SIGNAL(timeout()), this, SLOT(doneRecording())); //TODO: how to adopt style changes at runtime? /*QFont modFont = d->clearButton->font(); modFont.setStyleHint(QFont::TypeWriter); d->clearButton->setFont(modFont);*/ d->updateShortcutDisplay(); }