VirtualBox

Ignore:
Timestamp:
Feb 12, 2013 1:05:12 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: 6065: Updating UIHostComboEditor API with corresponding properties.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp

    r44528 r44654  
    6969{
    7070    /* Upload to cache: */
    71     m_cache.m_strHostCombo = m_pHostKeyEditor->combo();
     71    m_cache.m_strHostCombo = m_pHostKeyEditor->combo().toString();
    7272    m_cache.m_fAutoCapture = m_pEnableAutoGrabCheckbox->isChecked();
    7373}
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHostComboEditor.cpp

    r44561 r44654  
    334334}
    335335
    336 void UIHostComboEditor::setCombo(const QString &strKeyCombo)
     336void UIHostComboEditor::setCombo(const UIHostComboWrapper &strCombo)
    337337{
    338338    /* Cleanup old combo: */
    339339    m_shownKeys.clear();
    340340    /* Parse newly passed combo: */
    341     QList<int> keyCodeList = UIHostCombo::toKeyCodeList(strKeyCombo);
     341    QList<int> keyCodeList = UIHostCombo::toKeyCodeList(strCombo.toString());
    342342    for (int i = 0; i < keyCodeList.size(); ++i)
    343343        if (int iKeyCode = keyCodeList[i])
     
    347347}
    348348
    349 QString UIHostComboEditor::combo() const
     349UIHostComboWrapper UIHostComboEditor::combo() const
    350350{
    351351    /* Compose current combination: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHostComboEditor.h

    r44561 r44654  
    4848}
    4949
     50/* Host-combo wrapper: */
     51class UIHostComboWrapper
     52{
     53public:
     54
     55    UIHostComboWrapper(const QString &strHostCombo = QString())
     56        : m_strHostCombo(strHostCombo)
     57    {}
     58
     59    const QString& toString() const { return m_strHostCombo; }
     60
     61private:
     62
     63    QString m_strHostCombo;
     64};
     65Q_DECLARE_METATYPE(UIHostComboWrapper);
     66
    5067/* Host-combo editor widget: */
    5168class UIHostComboEditor : public QLineEdit
    5269{
    5370    Q_OBJECT;
     71    Q_PROPERTY(UIHostComboWrapper combo READ combo WRITE setCombo USER true);
    5472
    5573public:
     
    5876    ~UIHostComboEditor();
    5977
    60     void setCombo(const QString &strKeyCombo);
    61     QString combo() const;
     78    void setCombo(const UIHostComboWrapper &strCombo);
     79    UIHostComboWrapper combo() const;
    6280
    6381public 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