Back to index

salome-smesh  6.5.0
Public Member Functions
SMESHGUI_FilterTable::Table Class Reference

List of all members.

Public Member Functions

 Table (QWidget *=0)
 Table (int, int, QWidget *=0)
virtual ~Table ()
QSize minimumSizeHint () const
void setEditable (bool, int, int)
bool isEditable (int, int) const
void setReadOnly (bool)
bool isReadOnly () const
void insertRows (int, int=1)
QString text (int, int)
QList< int > selectedRows ()

Detailed Description

Definition at line 707 of file SMESHGUI_FilterDlg.cxx.


Constructor & Destructor Documentation

SMESHGUI_FilterTable::Table::Table ( QWidget *  parent = 0)

Definition at line 732 of file SMESHGUI_FilterDlg.cxx.

: QTableWidget(parent)
{
  // set custom item delegate
  setItemDelegate( new ComboDelegate(this) );
  // set edit triggers by default
  setReadOnly( false );
}

Here is the call graph for this function:

SMESHGUI_FilterTable::Table::Table ( int  numRows,
int  numCols,
QWidget *  parent = 0 
)

Definition at line 745 of file SMESHGUI_FilterDlg.cxx.

: QTableWidget(numRows, numCols, parent)
{
  // set custom item delegate
  setItemDelegate( new ComboDelegate(this) );
  // set edit triggers by default
  setReadOnly( false );
}

Here is the call graph for this function:

Definition at line 758 of file SMESHGUI_FilterDlg.cxx.

{
}

Member Function Documentation

void SMESHGUI_FilterTable::Table::insertRows ( int  row,
int  count = 1 
)

Definition at line 822 of file SMESHGUI_FilterDlg.cxx.

{
  closePersistentEditor( currentItem() );
  while ( count-- ) insertRow( row );
}
bool SMESHGUI_FilterTable::Table::isEditable ( int  row,
int  col 
) const

Definition at line 800 of file SMESHGUI_FilterDlg.cxx.

{
  QTableWidgetItem* anItem = item( row, col );
  return anItem == 0 || anItem->flags() & Qt::ItemIsEditable;
}

Definition at line 813 of file SMESHGUI_FilterDlg.cxx.

{
  return editTriggers() == QAbstractItemView::NoEditTriggers;
}

Definition at line 766 of file SMESHGUI_FilterDlg.cxx.

{
  QSize s = QTableWidget::minimumSizeHint();
  QHeaderView* hv = horizontalHeader();
  if ( hv )
    s.setWidth( qMax( s.width(), hv->length() ) );
  return s;
}

Definition at line 839 of file SMESHGUI_FilterDlg.cxx.

{
  QList<QTableWidgetItem*> selItems = selectedItems();
  QTableWidgetItem* anItem;
  QList<int> rows;

  foreach( anItem, selItems ) {
    int r = row( anItem );
    if ( !rows.contains( r ) ) rows.append( r );
  }

  qSort( rows );
  return rows;
}
void SMESHGUI_FilterTable::Table::setEditable ( bool  isEditable,
int  row,
int  col 
)

Definition at line 779 of file SMESHGUI_FilterDlg.cxx.

{
  QTableWidgetItem* anItem = item( row, col );
  if ( anItem ) {
    bool isSignalsBlocked = signalsBlocked();
    blockSignals( true );

    Qt::ItemFlags f = anItem->flags();
    if ( !isEditable ) f = f & ~Qt::ItemIsEditable;
    else f = f | Qt::ItemIsEditable;
    anItem->setFlags( f );
    
    blockSignals( isSignalsBlocked );
  }
}

Definition at line 806 of file SMESHGUI_FilterDlg.cxx.

{
  setEditTriggers( on ? 
                   QAbstractItemView::NoEditTriggers  :
                   QAbstractItemView::AllEditTriggers );
}

Here is the caller graph for this function:

QString SMESHGUI_FilterTable::Table::text ( int  row,
int  col 
)

Definition at line 832 of file SMESHGUI_FilterDlg.cxx.

{
  closePersistentEditor( currentItem() );
  QTableWidgetItem* anItem = item( row, col );
  return anItem ? anItem->text() : QString();
}

The documentation for this class was generated from the following file: