void CRangeChooserDialog::initConnections() {
    // Signals from text/list widgets
    QObject::connect(m_rangeList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
                     this, SLOT(editRange(QListWidgetItem*)));

    QObject::connect(m_rangeEdit, SIGNAL(textChanged()),
                     this, SLOT(parseRange()));
    QObject::connect(m_rangeEdit, SIGNAL(textChanged()),
                     this, SLOT(rangeChanged()));

    QObject::connect(m_nameEdit, SIGNAL(textChanged(const QString&)),
                     this, SLOT(nameChanged(const QString&)));

    // Buttons
    QObject::connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(slotOk()));
    QObject::connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(close()));
    QObject::connect(m_newRangeButton, SIGNAL(clicked()), this, SLOT(addNewRange()));
    QObject::connect(m_deleteRangeButton, SIGNAL(clicked()), this, SLOT(deleteCurrentRange()));
    //restore defaults!
    QPushButton* defaultsButton = m_buttonBox->button(QDialogButtonBox::RestoreDefaults);
    QObject::connect(defaultsButton, SIGNAL(clicked()), this, SLOT(slotDefault()));
}
Ejemplo n.º 2
0
void CRangeChooserDialog::initConnections() {
    connect(m_rangeList, SIGNAL(currentItemChanged(QListWidgetItem*,
                                                   QListWidgetItem*)),
            this,        SLOT(selectedRangeChanged(QListWidgetItem*,
                                                   QListWidgetItem*)));
    connect(m_nameEdit, SIGNAL(textEdited(QString)),
            this,       SLOT(nameEditTextChanged(QString)));
    connect(m_rangeEdit, SIGNAL(textChanged()),
           this,        SLOT(updateResultList()));

    // Connect buttons:
    connect(m_buttonBox, SIGNAL(accepted()),
            this,        SLOT(accept()));
    connect(m_buttonBox, SIGNAL(rejected()),
            this,        SLOT(reject()));
    connect(m_newRangeButton, SIGNAL(clicked()),
            this,             SLOT(addNewRange()));
    connect(m_deleteRangeButton, SIGNAL(clicked()),
            this,                SLOT(deleteCurrentRange()));
    QPushButton * defaultsButton = m_buttonBox->button(QDialogButtonBox::RestoreDefaults);
    connect(defaultsButton, SIGNAL(clicked()),
            this,           SLOT(restoreDefaults()));
}