コード例 #1
0
ファイル: connectiontable.cpp プロジェクト: app/ananas-labs
void ConnectionTable::sortColumn( int col, bool ascending, bool )
{
    horizontalHeader()->setSortIndicator( col, ascending );
    if ( isEditing() )
	endEdit( currEditRow(), currEditCol(), FALSE, FALSE );
    QTable::sortColumn( col, ascending, TRUE );
    setCurrentCell( 0, 0 );
    emit resorted();
}
コード例 #2
0
QWidget* TeQtBigTable::cellWidget(int row, int col) const
{
	if (row < 0 || col < 0)
		return 0;
	
	if (row == currEditRow() && col == currEditCol())
			return editor_;
	else
		return 0;
}
コード例 #3
0
ファイル: mtable.cpp プロジェクト: Klunkerball/EGSnrc
void MTable::endEdit( int row, int col, bool accept, bool replace )
{
    QWidget *editor = cellWidget( row, col );
    if ( !editor ) return;
    if (!editor->inherits("QComboBox")){
         QTable::endEdit( row, col, accept, replace );
         zap(editor);
         //if (editor) delete editor;// <== this seems neccessary to return control to the Table
         return;
    }
    else{
             setCellContentFromEditor( row, col );
              if ( row == currEditRow() && col == currEditCol() )
	     setEditMode( NotEditing, -1, -1 );
              viewport()->setFocus();
              updateCell( row, col );
              clearCellWidget( row, col );
              zap (editor);
              //if (editor) delete editor;// <== this seems neccessary to return control to the Table
               emit valueChanged( row, col );
    }
}