VirtualBox

Changeset 80197 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 8, 2019 12:29:28 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7720: QIComboBox: Extend with some of hidden QComboBox API, passing it through.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/extensions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIComboBox.cpp

    r80067 r80197  
    209209}
    210210
     211QString QIComboBox::currentText() const
     212{
     213    /* Redirect to combo-box: */
     214    AssertPtrReturn(m_pComboBox, -1);
     215    return m_pComboBox->currentText();
     216}
     217
     218void QIComboBox::addItems(const QStringList &items) const
     219{
     220    /* Redirect to combo-box: */
     221    AssertPtrReturnVoid(m_pComboBox);
     222    return m_pComboBox->addItems(items);
     223}
     224
    211225void QIComboBox::addItem(const QString &strText, const QVariant &userData /* = QVariant() */) const
    212226{
     
    258272    AssertPtrReturn(m_pComboBox, -1);
    259273    return m_pComboBox->findData(data, iRole, flags);
     274}
     275
     276int QIComboBox::findText(const QString &strText,
     277                         Qt::MatchFlags flags /* = static_cast<Qt::MatchFlags>(Qt::MatchExactly | Qt::MatchCaseSensitive) */) const
     278{
     279    /* Redirect to combo-box: */
     280    AssertPtrReturn(m_pComboBox, -1);
     281    return m_pComboBox->findData(strText, flags);
    260282}
    261283
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIComboBox.h

    r79241 r80197  
    8686    /** Returns the index of the current item in the combo-box. */
    8787    int currentIndex() const;
     88    /** Returns the text of the current item in the combo-box. */
     89    QString currentText() const;
    8890
     91    /** Adds the @a items into the combo-box. */
     92    void addItems(const QStringList &items) const;
    8993    /** Adds the @a strText and userData (stored in the Qt::UserRole) into the combo-box. */
    9094    void addItem(const QString &strText, const QVariant &userData = QVariant()) const;
     
    105109    int findData(const QVariant &data, int iRole = Qt::UserRole,
    106110                 Qt::MatchFlags flags = static_cast<Qt::MatchFlags>(Qt::MatchExactly | Qt::MatchCaseSensitive)) const;
     111    /** Returns the index of the item containing the given @a strText; otherwise returns -1.
     112      * @param  flags  Specifies how the items in the combobox are searched. */
     113    int findText(const QString &strText, Qt::MatchFlags flags = static_cast<Qt::MatchFlags>(Qt::MatchExactly | Qt::MatchCaseSensitive)) const;
    107114
    108115public slots:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette