Ejemplo n.º 1
0
void QQuickMenuItem::bindToAction(QQuickAction *action)
{
    m_boundAction = action;

    connect(m_boundAction, SIGNAL(destroyed(QObject*)), this, SLOT(unbindFromAction(QObject*)));

    connect(m_boundAction, SIGNAL(triggered()), this, SIGNAL(triggered()));
    connect(m_boundAction, SIGNAL(toggled(bool)), this, SLOT(updateChecked()));
    connect(m_boundAction, SIGNAL(exclusiveGroupChanged()), this, SIGNAL(exclusiveGroupChanged()));
    connect(m_boundAction, SIGNAL(enabledChanged()), this, SLOT(updateEnabled()));
    connect(m_boundAction, SIGNAL(textChanged()), this, SLOT(updateText()));
    connect(m_boundAction, SIGNAL(shortcutChanged(QVariant)), this, SLOT(updateShortcut()));
    connect(m_boundAction, SIGNAL(checkableChanged()), this, SIGNAL(checkableChanged()));
    connect(m_boundAction, SIGNAL(iconNameChanged()), this, SLOT(updateIcon()));
    connect(m_boundAction, SIGNAL(iconNameChanged()), this, SIGNAL(iconNameChanged()));
    connect(m_boundAction, SIGNAL(iconSourceChanged()), this, SLOT(updateIcon()));
    connect(m_boundAction, SIGNAL(iconSourceChanged()), this, SIGNAL(iconSourceChanged()));

    if (m_boundAction->parent() != this) {
        updateText();
        updateShortcut();
        updateEnabled();
        updateIcon();
        if (checkable())
            updateChecked();
    }
}
Ejemplo n.º 2
0
void Updater::readReply( QNetworkReply *reply )
{
    int returnCode = reply->attribute( QNetworkRequest::HttpStatusCodeAttribute ).toInt();
    qDebug() << returnCode;
    if ( returnCode == 200 ) {
        QString latest = reply->readLine();
        latest.chop(1); // remove the trailing enter
        QString changes = reply->readAll();
        bool available = !latest.isEmpty();
        emit updateChecked( available, available ? latest : ConfigFile::APP_VERSION, available ? changes : QString() );
    }
}
Ejemplo n.º 3
0
std::set<QString> PeaksTableColumnsDialog::getVisibleColumns()
{
    // copy what was originally visible
    std::set<QString> result(m_origVisible.begin(), m_origVisible.end());

    // delete what is no longer visible
    //      - it is done this way so things that aren't in the dialog stay visible
    updateChecked(result, QPeaksTableModel::RUNNUMBER, ui->cb_runnumber->isChecked());
    updateChecked(result, QPeaksTableModel::DETID, ui->cb_detID->isChecked());
    updateChecked(result, QPeaksTableModel::WAVELENGTH, ui->cb_wavelength->isChecked());
    updateChecked(result, QPeaksTableModel::ENERGY, ui->cb_deltaE->isChecked());
    updateChecked(result, QPeaksTableModel::INITIAL_ENERGY, ui->cb_ei->isChecked());
    updateChecked(result, QPeaksTableModel::FINAL_ENERGY, ui->cb_ef->isChecked());
    updateChecked(result, QPeaksTableModel::TOF, ui->cb_tof->isChecked());
    updateChecked(result, QPeaksTableModel::DSPACING, ui->cb_dspacing->isChecked());
    updateChecked(result, QPeaksTableModel::BINCOUNT, ui->cb_bincount->isChecked());
    updateChecked(result, QPeaksTableModel::BANKNAME, ui->cb_bankname->isChecked());
    updateChecked(result, QPeaksTableModel::ROW, ui->cb_row->isChecked());
    updateChecked(result, QPeaksTableModel::COL, ui->cb_column->isChecked());
    updateChecked(result, QPeaksTableModel::QLAB, ui->cb_qLab->isChecked());
    updateChecked(result, QPeaksTableModel::QSAMPLE, ui->cb_qSample->isChecked());

    return result;
}