void QgsAttributeSelectionDialog::on_mColumnUpPushButton_clicked() { if ( mComposerTable ) { //move selected row up QItemSelection viewSelection( mColumnsTableView->selectionModel()->selection() ); int selectedRow = viewSelection.indexes().at( 0 ).row(); mColumnModel->moveRow( selectedRow, QgsComposerAttributeTableColumnModelV2::ShiftUp ); } else if ( mComposerTableV1 ) { //move selected row up QItemSelection viewSelection( mColumnsTableView->selectionModel()->selection() ); int selectedRow = viewSelection.indexes().at( 0 ).row(); mColumnModelV1->moveRow( selectedRow, QgsComposerAttributeTableColumnModel::ShiftUp ); } }
void QgsAttributeSelectionDialog::on_mRemoveColumnPushButton_clicked() { if ( mComposerTable ) { //remove selected row from model QItemSelection viewSelection( mColumnsTableView->selectionModel()->selection() ); int selectedRow = viewSelection.indexes().at( 0 ).row(); mColumnModel->removeRow( selectedRow ); } if ( mComposerTableV1 ) { //remove selected row from model QItemSelection viewSelection( mColumnsTableView->selectionModel()->selection() ); int selectedRow = viewSelection.indexes().at( 0 ).row(); mColumnModelV1->removeRow( selectedRow ); } }
void QgsAttributeSelectionDialog::on_mColumnDownPushButton_clicked() { //move selected row down QItemSelection viewSelection( mColumnsTableView->selectionModel()->selection() ); if ( viewSelection.size() > 0 ) { int selectedRow = viewSelection.indexes().at( 0 ).row(); mColumnModel->moveRow( selectedRow, QgsComposerAttributeTableColumnModelV2::ShiftDown ); } }