Back to index

salome-gui  6.5.0
Public Member Functions
SalomeApp_ComboBox Class Reference

#include <SalomeApp_ListView.h>

List of all members.

Public Member Functions

 SalomeApp_ComboBox (bool rw, QWidget *parent=0, const char *name=0)
 Constructor.
int findItem (const QString &theText)
 Searches item in list and returns its index.
void insertItem (const QString &theValue, int theIndex=-1)
 Adds item in combo box.
void insertList (const QStringList &theList)
 Adds list of items in combo box.
void insertItem (const int theValue)
 Adds item in combo box.
void insertList (const TColStd_ListOfInteger &theList)
 Adds list of items in combo box.
void insertItem (const double theValue)
 Adds item in combo box.
void insertList (const TColStd_ListOfReal &theList)
 Adds list of items in combo box.

Detailed Description

Definition at line 142 of file SalomeApp_ListView.h.


Constructor & Destructor Documentation

SalomeApp_ComboBox::SalomeApp_ComboBox ( bool  rw,
QWidget *  parent = 0,
const char *  name = 0 
)

Constructor.

Definition at line 948 of file SalomeApp_ListView.cxx.

                                                                                 :
QComboBox(parent)
{
  setEditable( rw );
  setObjectName( name );
}

Member Function Documentation

int SalomeApp_ComboBox::findItem ( const QString &  theText)

Searches item in list and returns its index.

Definition at line 958 of file SalomeApp_ListView.cxx.

{
  for (int i = 0; i < count(); i++)
    if (itemText(i) == theText)
      return i;
  return -1;
}

Here is the caller graph for this function:

void SalomeApp_ComboBox::insertItem ( const QString &  theValue,
int  theIndex = -1 
)

Adds item in combo box.

Definition at line 969 of file SalomeApp_ListView.cxx.

{
  if (duplicatesEnabled() || findItem(theValue) < 0)
    QComboBox::insertItem(theIndex, theValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SalomeApp_ComboBox::insertItem ( const int  theValue)

Adds item in combo box.

Definition at line 988 of file SalomeApp_ListView.cxx.

{
  int aNum;
  bool bOk;
  for (int i = 0; i < count(); i++) {
    aNum = itemText(i).toInt(&bOk);
    if (bOk) {
      if (aNum > theValue || (aNum == theValue && duplicatesEnabled())) {
        insertItem(QString::number(theValue),i);
        return;
      }
    }
  }
  insertItem(QString::number(theValue));
}

Here is the call graph for this function:

void SalomeApp_ComboBox::insertItem ( const double  theValue)

Adds item in combo box.

Definition at line 1016 of file SalomeApp_ListView.cxx.

{
  double aNum;
  bool bOk;
  for (int i = 0; i < count(); i++) {
    aNum = itemText(i).toDouble(&bOk);
    if (bOk) {
      if (aNum > theValue || (aNum == theValue && duplicatesEnabled())) {
        insertItem(QString::number(theValue), i);
        return;
      }
    }
  }
  insertItem(QString::number(theValue));
}

Here is the call graph for this function:

void SalomeApp_ComboBox::insertList ( const QStringList &  theList)

Adds list of items in combo box.

Definition at line 979 of file SalomeApp_ListView.cxx.

{
  for (unsigned i = 0; i < theList.count(); i++)
    insertItem(theList[i]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SalomeApp_ComboBox::insertList ( const TColStd_ListOfInteger &  theList)

Adds list of items in combo box.

Definition at line 1007 of file SalomeApp_ListView.cxx.

{
  for (TColStd_ListIteratorOfListOfInteger aIter(theList); aIter.More(); aIter.Next())
    insertItem(aIter.Value());
}

Here is the call graph for this function:

void SalomeApp_ComboBox::insertList ( const TColStd_ListOfReal &  theList)

Adds list of items in combo box.

Definition at line 1035 of file SalomeApp_ListView.cxx.

{
  for (TColStd_ListIteratorOfListOfReal aIter(theList); aIter.More(); aIter.Next())
    insertItem(aIter.Value());
}

Here is the call graph for this function:


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