CFx SDK Documentation  2023 SP0
Public Types | Public Member Functions | List of all members
CFxUIComboBox Class Reference

#include <FxUIComboBox.h>

Inheritance diagram for CFxUIComboBox:
CFxUIBaseView CFxUIObject

Public Types

enum  InsertPolicy {
  NoInsert , InsertAtTop , InsertAtCurrent , InsertAtBottom ,
  InsertAfterCurrent , InsertBeforeCurrent , InsertAlphabetically
}
 
- Public Types inherited from CFxUIBaseView
enum  TextAlignment {
  AlignLeft = 0x0001 , AlignRight = 0x0002 , AlignHCenter = 0x0004 , AlignJustify = 0x0008 ,
  AlignTop = 0x0020 , AlignBottom = 0x0040 , AlignVCenter = 0x0080 , AlignBaseline = 0x0100 ,
  AlignCenter = AlignVCenter | AlignHCenter
}
 
enum  FocusPolicyType {
  eNoFocus = 0 , eTabFocus = 0x1 , eClickFocus = 0x2 , eStrongFocus = eTabFocus | eClickFocus | 0x8 ,
  eWheelFocus = eStrongFocus | 0x4 , eKeyboardOnSetfocus = 0x10
}
 
enum  UIWidthSizePolicy {
  eXS = 0 , eS , eM , eL ,
  eXL
}
 

Public Member Functions

 CFxUIComboBox ()
 
 ~CFxUIComboBox ()
 
void clear ()
 
void addItem (const CFxUIString &text, const CFxUIVariant &userData=CFxUIVariant())
 
void addItem (const CFxUIIcon &icon, const CFxUIString &text, const CFxUIVariant &userData=CFxUIVariant())
 
void insertItems (int index, const CFxUIStringList &list)
 
void insertItem (int index, const CFxUIString &text, const CFxUIVariant &userData=CFxUIVariant())
 
void insertItem (int index, const CFxUIIcon &icon, const CFxUIString &text, const CFxUIVariant &userData=CFxUIVariant())
 
void removeItem (int index)
 
void setItemText (int index, const CFxUIString &text)
 
void setItemIcon (int index, const CFxUIIcon &icon)
 
void setEditText (const CFxUIString &text)
 
int count () const
 
void clearEditText ()
 
CFxUIVariant itemData (int index, int role=Qt::UserRole) const
 
void setItemData (int index, const CFxUIVariant &data, int role=Qt::UserRole)
 
CFxUIString itemText (int index) const
 
void setCurrentText (const CFxUIString &text)
 
CFxUIString currentText () const
 
int findData (const CFxUIVariant &data, int role=Qt::UserRole, Qt::MatchFlags flags=static_cast< Qt::MatchFlags >(Qt::MatchExactly|Qt::MatchCaseSensitive)) const
 
int findText (const CFxUIString &text, Qt::MatchFlags flags=static_cast< Qt::MatchFlags >(Qt::MatchExactly|Qt::MatchCaseSensitive)) const
 
void setCurrentIndex (int iIndex)
 
int currentIndex () const
 
void setHideEmptyText (bool)
 
bool isEditable () const
 
void setEditable (bool)
 
void setValidator (const CFxUIValidator *)
 
void setInsertPolicy (CFxUIComboBox::InsertPolicy)
 
void setIconSize (CFxUISize size)
 
void setMaxVisibleItems (int Value)
 
CFxUISignal< void(int)> & activated ()
 
CFxUISignal< void(int)> & currentIndexChanged ()
 
CFxUISignal< void(const CFxUIString &)> & currentStringChanged ()
 
CFxUISignal< void(const CFxUIString &)> & editTextChanged ()
 
CFxUISignal< void(void)> & editingFinished ()
 
- Public Member Functions inherited from CFxUIBaseView
 CFxUIBaseView ()
 
virtual ~CFxUIBaseView ()
 
void setDisabled (bool on)
 
void setEnabled (bool on)
 
bool isEnabled () const
 
CFxUIPalette::ColorRole backgroundRole ()
 
void setPalette (const CFxUIPalette &)
 
const CFxUIPalettepalette () const
 
bool isVisible ()
 
void setVisible (bool bVisible)
 
bool hasFocus () const
 
void setFocus ()
 
void setFocus (int iReason)
 
void setFocusPolicy (int iPolicy)
 
int width ()
 
void setWidth (int w)
 
int height ()
 
void setHeight (int h)
 
void update ()
 
void setBusyState (bool bBusy=false)
 
void resize (int w, int h)
 
void setCornerRadius (float radius)
 
void setBorderWidth (float width)
 
void setBorderWidth (float left, float top, float right, float bottom)
 
void setBorderColor (int r, int g, int b)
 
virtual void showEvent (CFxUIShowEvent *event)
 
virtual void hideEvent (CFxUIHideEvent *event)
 
virtual void paintEvent (CFxUIPaintEvent *event)
 
virtual void resizeEvent (CFxUIResizeEvent *event)
 
virtual void focusInEvent (CFxUIFocusEvent *focusInEvent)
 
virtual void focusOutEvent (CFxUIFocusEvent *focusOutEvent)
 
void setEventAccepted (bool bAccepted=false)
 
void addView (CFxUIBaseView *pChild, float fWeight=0.0)
 
void insertView (CFxUIBaseView *pChild, int index=0, float fWeight=0.0)
 
int indexOf (CFxUIBaseView *pChild)
 
void removeView (CFxUIBaseView *pChild)
 
void setPreferableSize (int w, int h)
 
void setMinimumWidth (int iWidth)
 
void setMinimumHeight (int iHeight)
 
void setMinimumSize (const CFxUISize &size)
 
void setMaximumWidth (int iWidth)
 
void setMaximumHeight (int iHeight)
 
void setMaximumSize (const CFxUISize &size)
 
int minimumWidth ()
 
int minimumHeight ()
 
int maximumWidth ()
 
int maximumHeight ()
 
void setToolTip (const CFxUIString &sToolTip)
 
const CFxUIString toolTip ()
 
CFxUISignal< void(void)> & aboutToPassEventToParent ()
 
CFxUISignal< void(void)> & aboutToShow ()
 
CFxUISignal< void(void)> & hoverEnter ()
 
CFxUISignal< void(void)> & hoverLeave ()
 
- Public Member Functions inherited from CFxUIObject
 CFxUIObject ()
 
virtual ~CFxUIObject ()
 
FxNativeHandle getHandle () const
 
void setHandle (FxNativeHandle handle)
 
void setParent (CFxUIObject *parent)
 
CFxUIObjectparent ()
 
const CFxUIObjectparent () const
 
void setObjectName (const CFxUIString &objectName)
 
CFxUIString objectName () const
 
bool setProperty (const char *name, const CFxUIVariant &value)
 
CFxUIVariant property (const char *name)
 
CFxUIList< CFxUIObject * > children () const
 
template<typename T >
CFxUIList< T > findChildren (const CFxUIString &name=CFxUIString())
 
void blockSignals (bool block)
 
bool signalsBlocked () const
 

Additional Inherited Members

- Static Public Member Functions inherited from CFxUIBaseView
static void setTabOrder (CFxUIObject *first, CFxUIObject *second)
 
- Protected Member Functions inherited from CFxUIObject
CFxUIObjectsender ()
 
- Protected Attributes inherited from CFxUIObject
CFxUIObjectImpl * m_pImpl
 
CFxUIObjectData * m_pData
 

Detailed Description

Class CFxUIComboBox provides a means of presenting a list of options to the user in a way that takes up the minimum amount of screen space.

Definition at line 27 of file FxUIComboBox.h.

Member Enumeration Documentation

◆ InsertPolicy

This enum specifies what the CFxUIComboBox should do when a new string is entered by the user.

Enumerator
NoInsert 

The string will not be inserted into the combobox.

InsertAtTop 

The string will be inserted as the first item in the combobox.

InsertAtCurrent 

The current item will be replaced by the string.

InsertAtBottom 

The string will be inserted after the last item in the combobox.

InsertAfterCurrent 

The string is inserted after the current item in the combobox.

InsertBeforeCurrent 

The string is inserted before the current item in the combobox.

InsertAlphabetically 

The string is inserted in the alphabetic order in the combobox.

Definition at line 33 of file FxUIComboBox.h.

Constructor & Destructor Documentation

◆ CFxUIComboBox()

CFxUIComboBox::CFxUIComboBox ( )

Constructor

◆ ~CFxUIComboBox()

CFxUIComboBox::~CFxUIComboBox ( )

Destructor

Member Function Documentation

◆ activated()

CFxUISignal<void(int)>& CFxUIComboBox::activated ( )

Signal is emitted when the user chooses an item in the combobox

◆ addItem() [1/2]

void CFxUIComboBox::addItem ( const CFxUIIcon icon,
const CFxUIString text,
const CFxUIVariant userData = CFxUIVariant() 
)

Adds the provided item with text, icon and user data at the end of list.

Parameters
iconThe parameter passed sets the icon on item.
textThe string passed is set on item as text.
userDataInput. The data is set to item to be added in list.

◆ addItem() [2/2]

void CFxUIComboBox::addItem ( const CFxUIString text,
const CFxUIVariant userData = CFxUIVariant() 
)

Adds the provided item with text and user data at the end of list.

Parameters
textThe string passed is set on item as text.
userDataInput. The data is set to item to be added in list.

◆ clear()

void CFxUIComboBox::clear ( )

Clears the content of text editor.

◆ clearEditText()

void CFxUIComboBox::clearEditText ( )

Clears the text in the combobox's text edit.

◆ count()

int CFxUIComboBox::count ( ) const

Returns the total number of items in list.

Returns
int value.

◆ currentIndex()

int CFxUIComboBox::currentIndex ( ) const

Returns current index in combo box .

Returns
int

◆ currentIndexChanged()

CFxUISignal<void(int)>& CFxUIComboBox::currentIndexChanged ( )

Signal is emitted whenever the currentIndex in the combobox changes either through user interaction or programmatically. The item's index is passed or -1 if the combobox becomes empty or the currentIndex was reset.

◆ currentStringChanged()

CFxUISignal<void(const CFxUIString&)>& CFxUIComboBox::currentStringChanged ( )

Signal is emitted whenever currentText changes .

◆ currentText()

CFxUIString CFxUIComboBox::currentText ( ) const

Returns current text in combo box as provided in argument.

Parameters
<em>string</em>Input

◆ editingFinished()

CFxUISignal<void(void)>& CFxUIComboBox::editingFinished ( )

Signal is emitted whenever the editing is finished i.e. when focusOut event occurs.

◆ editTextChanged()

CFxUISignal<void(const CFxUIString&)>& CFxUIComboBox::editTextChanged ( )

Signal is emitted when the text in the combobox's line edit widget is changed. The new text is specified by text.

◆ findData()

int CFxUIComboBox::findData ( const CFxUIVariant data,
int  role = Qt::UserRole,
Qt::MatchFlags  flags = static_cast< Qt::MatchFlags >(Qt::MatchExactly|Qt::MatchCaseSensitive) 
) const

◆ findText()

int CFxUIComboBox::findText ( const CFxUIString text,
Qt::MatchFlags  flags = static_cast< Qt::MatchFlags >(Qt::MatchExactly|Qt::MatchCaseSensitive) 
) const

◆ insertItem() [1/2]

void CFxUIComboBox::insertItem ( int  index,
const CFxUIIcon icon,
const CFxUIString text,
const CFxUIVariant userData = CFxUIVariant() 
)

Inserts the item with passed text and icon at the provided index.

User can also sets the data of variant type.

Parameters
indexInput
iconInput
textInput
userData

◆ insertItem() [2/2]

void CFxUIComboBox::insertItem ( int  index,
const CFxUIString text,
const CFxUIVariant userData = CFxUIVariant() 
)

Inserts the item with passed text at the provided index.

User can also sets the data of variant type.

Parameters
indexInput
textInput
userDataInput

◆ insertItems()

void CFxUIComboBox::insertItems ( int  index,
const CFxUIStringList list 
)

Inserts the provided list of items starting from the provided index to bottom.

Parameters
indexInput
listAppend the list passed at the index passed.

◆ isEditable()

bool CFxUIComboBox::isEditable ( ) const

Returns if current item editable.

Returns
bool

◆ itemData()

CFxUIVariant CFxUIComboBox::itemData ( int  index,
int  role = Qt::UserRole 
) const

Returns the data on item present at given index.

Parameters
indexValue for item at which data is to be set.
roleInput. The data role for the item on the given index in the combobox to the specified value.
Returns
variant .

◆ itemText()

CFxUIString CFxUIComboBox::itemText ( int  index) const

Returns the text of item at provided index.

Parameters
indexInput
Returns
string

◆ removeItem()

void CFxUIComboBox::removeItem ( int  index)

Removes the item from the list at provided index

Parameters
indexInput

◆ setCurrentIndex()

void CFxUIComboBox::setCurrentIndex ( int  iIndex)

Sets current index in combo box as provided in argument.

Parameters
iIndexInput

◆ setCurrentText()

void CFxUIComboBox::setCurrentText ( const CFxUIString text)

Sets current text in combo box as provided in argument.

Parameters
textInput

◆ setEditable()

void CFxUIComboBox::setEditable ( bool  )

Sets the current item editable.

Parameters
bEditIf parameter is true the item is set to editable, otherwise editing is not available.

◆ setEditText()

void CFxUIComboBox::setEditText ( const CFxUIString text)

Sets the text in the combobox's text edit.

Parameters
textInput

◆ setHideEmptyText()

void CFxUIComboBox::setHideEmptyText ( bool  )

◆ setIconSize()

void CFxUIComboBox::setIconSize ( CFxUISize  size)

Sets the size of icon.

Parameters
sizeThe icon is resized to the value passed in parameter.

◆ setInsertPolicy()

void CFxUIComboBox::setInsertPolicy ( CFxUIComboBox::InsertPolicy  )

Sets the policy used to determine where user-inserted items should appear in the combobox

Parameters
policy

◆ setItemData()

void CFxUIComboBox::setItemData ( int  index,
const CFxUIVariant data,
int  role = Qt::UserRole 
)

Sets the data on item present at given index.

Parameters
indexValue for item at which data is to be set.
dataInput.
rolehe data role for the item on the given index in the combobox to the specified value

◆ setItemIcon()

void CFxUIComboBox::setItemIcon ( int  index,
const CFxUIIcon icon 
)

Sets the icon at provided index.

Parameters
indexInput
iconInput

◆ setItemText()

void CFxUIComboBox::setItemText ( int  index,
const CFxUIString text 
)

Sets the text of item at provided index.

Parameters
indexInput
textInput Sets the text in the combobox's text edit at provided index.
indexInput
textInput

◆ setMaxVisibleItems()

void CFxUIComboBox::setMaxVisibleItems ( int  Value)

Sets the maximum allowed size on screen of the combo box, measured in items

Parameters
ValueInput.

◆ setValidator()

void CFxUIComboBox::setValidator ( const CFxUIValidator )

Sets the validator to use instead of the current validator of item.

Parameters
validatorPointer to the validator.

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