Back to index

salome-smesh  6.5.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SMESHGUI_FilterTable::ComboItem Class Reference

List of all members.

Public Member Functions

 ComboItem (const QMap< int, QString > &)
void setItems (const QMap< int, QString > &)
void clear ()
int count () const
int value () const
void setValue (const int)

Static Public Member Functions

static int Type ()

Private Member Functions

int id (int) const
int index (int) const

Private Attributes

QMap< int, int > myIdToIdx

Detailed Description

Definition at line 334 of file SMESHGUI_FilterDlg.cxx.


Constructor & Destructor Documentation

SMESHGUI_FilterTable::ComboItem::ComboItem ( const QMap< int, QString > &  theIds)

Definition at line 361 of file SMESHGUI_FilterDlg.cxx.

 : QTableWidgetItem( Type() )
{
  setItems( theIds );
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 380 of file SMESHGUI_FilterDlg.cxx.

{
  QMap<int, QString> empty;
  setItems( empty );
}

Here is the caller graph for this function:

Definition at line 386 of file SMESHGUI_FilterDlg.cxx.

{
  return myIdToIdx.count();
}
int SMESHGUI_FilterTable::ComboItem::id ( int  idx) const [private]

Definition at line 403 of file SMESHGUI_FilterDlg.cxx.

{
  QMap<int,int>::const_iterator it;
  for ( it = myIdToIdx.begin(); it != myIdToIdx.end(); ++it )
    if ( it.value() == idx ) return it.key();
  return -1;
}
int SMESHGUI_FilterTable::ComboItem::index ( int  i) const [private]

Definition at line 411 of file SMESHGUI_FilterDlg.cxx.

{
  return myIdToIdx.contains( i ) ? myIdToIdx[i] : -1;
}
void SMESHGUI_FilterTable::ComboItem::setItems ( const QMap< int, QString > &  theIds)

Definition at line 367 of file SMESHGUI_FilterDlg.cxx.

{
  myIdToIdx.clear();
  QMap<int, QString>::const_iterator it;
  QStringList items;
  for ( it = theIds.begin(); it != theIds.end(); ++it ) {
    myIdToIdx[it.key()] = items.count();
    items.append( it.value() );
  }
  setData( Qt::UserRole, items );
  setValue( id( 0 ) ); 
}

Here is the caller graph for this function:

void SMESHGUI_FilterTable::ComboItem::setValue ( const int  theId)

Definition at line 396 of file SMESHGUI_FilterDlg.cxx.

{
  int idx = index( theId );
  QStringList items = data( Qt::UserRole ).toStringList();
  setText( idx >= 0 && idx < items.count() ? items[idx] : "" );
}

Definition at line 356 of file SMESHGUI_FilterDlg.cxx.

{
  return QTableWidgetItem::UserType + 1;
}

Definition at line 391 of file SMESHGUI_FilterDlg.cxx.

{
  return( id( data( Qt::UserRole ).toStringList().indexOf( text() ) ) ); 
}

Member Data Documentation

Definition at line 353 of file SMESHGUI_FilterDlg.cxx.


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