VirtualBox

Changeset 78059 in vbox for trunk/src


Ignore:
Timestamp:
Apr 9, 2019 1:17:58 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9434: Extend QIComboBox with findData API.

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

Legend:

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

    r78041 r78059  
    249249    AssertPtrReturn(m_pComboBox, QString());
    250250    return m_pComboBox->itemText(iIndex);
     251}
     252
     253int QIComboBox::findData(const QVariant &data,
     254                         int iRole /* = Qt::UserRole */,
     255                         Qt::MatchFlags flags /* = static_cast<Qt::MatchFlags>(Qt::MatchExactly | Qt::MatchCaseSensitive) */) const
     256{
     257    /* Redirect to combo-box: */
     258    AssertPtrReturn(m_pComboBox, -1);
     259    return m_pComboBox->findData(data, iRole, flags);
    251260}
    252261
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIComboBox.h

    r78041 r78059  
    101101    QString itemText(int iIndex) const;
    102102
     103    /** Returns the index of the item containing the given @a data for the given @a iRole; otherwise returns -1.
     104      * @param  flags  Specifies how the items in the combobox are searched. */
     105    int findData(const QVariant &data, int iRole = Qt::UserRole,
     106                 Qt::MatchFlags flags = static_cast<Qt::MatchFlags>(Qt::MatchExactly | Qt::MatchCaseSensitive)) const;
     107
    103108public slots:
    104109
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