- Timestamp:
- Nov 2, 2016 3:43:22 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
-
QIComboBox.cpp (modified) (1 diff)
-
QIComboBox.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIComboBox.cpp
r64519 r64520 41 41 } 42 42 43 int QIComboBox::subElementCount() const 44 { 45 /* Depending on 'editable' property: */ 46 return !isEditable() ? SubElement_Max : SubElementEditable_Max; 47 } 48 49 QWidget *QIComboBox::subElement(int iIndex) const 50 { 51 /* Make sure index is inside the bounds: */ 52 AssertReturn(iIndex >= 0 && iIndex < subElementCount(), 0); 53 54 /* For 'non-editable' case: */ 55 if (!isEditable()) 56 { 57 switch (iIndex) 58 { 59 case SubElement_Selector: return m_pComboBox; 60 default: break; 61 } 62 } 63 /* For 'editable' case: */ 64 else 65 { 66 switch (iIndex) 67 { 68 case SubElementEditable_Editor: return lineEdit(); 69 case SubElementEditable_Selector: return m_pComboBox; 70 default: break; 71 } 72 } 73 74 /* Null otherwise: */ 75 return 0; 76 } 77 43 78 QLineEdit *QIComboBox::lineEdit() const 44 79 { -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIComboBox.h
r64519 r64520 28 28 Q_OBJECT; 29 29 30 /** Enumerates sub-element indexes for basic case. */ 31 enum { SubElement_Selector, SubElement_Max }; 32 /** Enumerates sub-element indexes for editable case. */ 33 enum { SubElementEditable_Editor, SubElementEditable_Selector, SubElementEditable_Max }; 34 30 35 public: 31 36 32 37 /** Constructs combo-box passing @a pParent to the base-class. */ 33 38 QIComboBox(QWidget *pParent = 0); 39 40 /** Returns sub-element count. */ 41 int subElementCount() const; 42 /** Returns sub-element with passed @a iIndex. */ 43 QWidget *subElement(int iIndex) const; 34 44 35 45 /** Returns the embedded line-editor reference. */
Note:
See TracChangeset
for help on using the changeset viewer.

