bool ListViewEditor::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: applyClicked(); break;
    case 1: columnClickable((bool)static_QUType_bool.get(_o+1)); break;
    case 2: columnDownClicked(); break;
    case 3: columnPixmapChosen(); break;
    case 4: columnPixmapDeleted(); break;
    case 5: columnResizable((bool)static_QUType_bool.get(_o+1)); break;
    case 6: columnTextChanged((const QString&)static_QUType_QString.get(_o+1)); break;
    case 7: columnUpClicked(); break;
    case 8: currentColumnChanged((QListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    case 9: currentItemChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 10: deleteColumnClicked(); break;
    case 11: itemColChanged((int)static_QUType_int.get(_o+1)); break;
    case 12: itemDeleteClicked(); break;
    case 13: itemDownClicked(); break;
    case 14: itemNewClicked(); break;
    case 15: itemNewSubClicked(); break;
    case 16: itemPixmapChoosen(); break;
    case 17: itemPixmapDeleted(); break;
    case 18: itemTextChanged((const QString&)static_QUType_QString.get(_o+1)); break;
    case 19: itemUpClicked(); break;
    case 20: itemLeftClicked(); break;
    case 21: itemRightClicked(); break;
    case 22: newColumnClicked(); break;
    case 23: okClicked(); break;
    case 24: initTabPage((const QString&)static_QUType_QString.get(_o+1)); break;
    case 25: emitItemRenamed((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2),(const QString&)static_QUType_QString.get(_o+3)); break;
    default:
	return ListViewEditorBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
예제 #2
0
void TasksView::stateChanged( State previous )
{
    switch( ApplicationCore::instance().state() ) {
    case Connecting:
    {
        // set model on view:
        ViewFilter* filter = ApplicationCore::instance().model().taskModel();
        m_treeView->setModel( filter );
        const QItemSelectionModel* smodel =  m_treeView->selectionModel();
        connect( smodel, SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(configureUi()) );
        connect( smodel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(configureUi()) );
        connect( smodel, SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)), SLOT(configureUi()) );
        connect( filter, SIGNAL(eventActivationNotice(EventId)),
                 SLOT(slotEventActivated(EventId)) );
        connect( filter, SIGNAL(eventDeactivationNotice(EventId)),
                 SLOT(slotEventDeactivated(EventId)) );
        connect( MODEL.charmDataModel(), SIGNAL(resetGUIState()),
                 SLOT(restoreGuiState()) );
    }
    break;
    case Connected:
        //the model is populated when entering Connected, so delay state restore
        QMetaObject::invokeMethod( this, "restoreGuiState", Qt::QueuedConnection );
        break;
    case Disconnecting:
        saveGuiState();
        break;
    case ShuttingDown:
    case Dead:
    default:
        break;
    };
}
예제 #3
0
void ResultsPage::setSelectedOutput(int index)
{
    if (m_selectedOutput)
        disconnect(m_selectedOutput, 0, this, 0);

    m_selectedOutput = m_outputCatalog->setSelectedOutput(index);

    if (m_selectedOutput->rowCount() <= m_selectedRow)
        m_selectedRow = -1;

    m_selectedOutput->plot(m_plot, m_curves);

#if QWT_VERSION >= 0x060100
    m_plot->updateLegend();
#endif

    m_catalogTableView->resizeColumnsToContents();
    m_catalogTableView->resizeRowsToContents();

    // Remove the previous model and delete the selectionModel
    if (QItemSelectionModel *m = m_outputTableView->selectionModel()) {
        m_outputTableView->setModel(0);
        delete m;
    }
    m_outputTableView->setModel(m_selectedOutput);
    m_outputTableView->resizeColumnsToContents();
    m_outputTableView->resizeRowsToContents();

    // Need to remove the previous connections because otherwise it signals multiple times
    disconnect(m_outputTableView->selectionModel(), 0, this, 0);
    connect(m_outputTableView->selectionModel(), SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)),
               this, SLOT(selectedDataChanged(QModelIndex,QModelIndex)));

    // Site indepedent
    m_catalogTableView->setColumnHidden(
            OutputCatalog::SiteColumn,
            m_selectedOutput->siteIndependent());
    m_enableSitePushButton->setHidden(
            m_selectedOutput->siteIndependent());

    // Motion independent
    m_catalogTableView->setColumnHidden(
            OutputCatalog::MotionColumn,
            m_selectedOutput->motionIndependent());
    m_enableMotionPushButton->setHidden(
            m_selectedOutput->motionIndependent());

    if (m_selectedOutput && m_selectedRow >= 0)
        setSelectedSeries(m_outputCatalog->index(m_selectedRow, 0));
}
예제 #4
0
void TableEditor::columnUpClicked()
{
    if ( listColumns->currentItem() <= 0 ||
	 listColumns->count() < 2 )
	return;
    saveFieldMap();
    int index = listColumns->currentItem() - 1;
    QListBoxItem *i = listColumns->item( listColumns->currentItem() );
    listColumns->takeItem( i );
    listColumns->insertItem( i, index );
    listColumns->setCurrentItem( i );
    readColumns();
    restoreFieldMap();
    currentColumnChanged( i );
}
예제 #5
0
    connect(ui->makeUnitDefaultButton, SIGNAL(clicked()), this, SLOT(slotMakeCurrentUnitDefault()));
    connect(ui->partUnitsTableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),this, SLOT(slotUnitSelectionChanged(QItemSelection,QItemSelection)));
    connect(ui->partUnitsTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotUnitDoubleClick(QModelIndex)));
    connect(_partUnitsModel,SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged()));    
    connect(ui->partUnitsTableView->itemDelegate(), SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this,SLOT(slotClosePartUnitEditor(QWidget*,QAbstractItemDelegate::EndEditHint)));

    connect(ui->addUnitButton, SIGNAL(clicked()), this, SLOT(slotAddUnit()));
    connect(ui->deleteUnitButton, SIGNAL(clicked()), this, SLOT(slotDeleteUnit()));

    connect(ui->paramUnitsTableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(slotParamUnitRowChanged(QModelIndex,QModelIndex)));
    connect(_parameterUnitsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged()));
    connect(ui->addParamUnitButton, SIGNAL(clicked()), this, SLOT(slotAddParamUnit()));
    connect(ui->deleteParamUnitButton, SIGNAL(clicked()), this, SLOT(slotDeleteParamUnit()));

    connect(ui->partConditionTableView->selectionModel(), SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)), this, SLOT(slotPartConditionRowChanged(QModelIndex,QModelIndex)));
    connect(_partConditionModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged()));
    connect(ui->addConditionButton, SIGNAL(clicked()), this, SLOT(slotAddPartCondition()));
    connect(ui->deleteConditionButton, SIGNAL(clicked()), this, SLOT(slotDeletePartCondition()));
    connect(ui->makeConditionDefaultButton, SIGNAL(clicked()), this, SLOT(slotMakeCurrentConditionDefault()));
    connect(ui->partConditionTableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotConditionDoubleClick(QModelIndex)));
    connect(ui->partConditionTableView->itemDelegate(), SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this,SLOT(slotClosePartConditionEditor(QWidget*,QAbstractItemDelegate::EndEditHint)));

    connect(ui->parametersTableView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(slotParameterRowChanged(QModelIndex,QModelIndex)));
    connect(ui->addParameterButton, SIGNAL(clicked(bool)), this, SLOT(slotAddParameter()));
    connect(ui->deleteParameterButton, SIGNAL(clicked(bool)), this, SLOT(slotDeleteParameter()));
    connect(_parameterModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotDataChanged()));
    ui->deleteParameterButton->setEnabled(false);
}

void OptionsDialog::setupGeneralSettings()
int QItemSelectionModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0:
            selectionChanged((*reinterpret_cast< const QItemSelection(*)>(_a[1])),(*reinterpret_cast< const QItemSelection(*)>(_a[2])));
            break;
        case 1:
            currentChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2])));
            break;
        case 2:
            currentRowChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2])));
            break;
        case 3:
            currentColumnChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2])));
            break;
        case 4:
            setCurrentIndex((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< QItemSelectionModel::SelectionFlags(*)>(_a[2])));
            break;
        case 5:
            select((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< QItemSelectionModel::SelectionFlags(*)>(_a[2])));
            break;
        case 6:
            select((*reinterpret_cast< const QItemSelection(*)>(_a[1])),(*reinterpret_cast< QItemSelectionModel::SelectionFlags(*)>(_a[2])));
            break;
        case 7:
            clear();
            break;
        case 8:
            reset();
            break;
        case 9:
            clearSelection();
            break;
        case 10:
            d_func()->_q_columnsAboutToBeRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])));
            break;
        case 11:
            d_func()->_q_rowsAboutToBeRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])));
            break;
        case 12:
            d_func()->_q_columnsAboutToBeInserted((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])));
            break;
        case 13:
            d_func()->_q_rowsAboutToBeInserted((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])));
            break;
        case 14:
            d_func()->_q_layoutAboutToBeChanged();
            break;
        case 15:
            d_func()->_q_layoutChanged();
            break;
        default:
            ;
        }
        _id -= 16;
    }
    return _id;
}