VirtualBox

Changeset 44651 in vbox


Ignore:
Timestamp:
Feb 12, 2013 12:43:33 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83742
Message:

FE/Qt: 6065: Updating UIHotKey: Class extended with required methods.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp

    r44650 r44651  
    302302UIHotKey UIHotKeyEditor::hotKey() const
    303303{
    304     return m_pLineEdit->text();
     304    m_hotKey.setSequence(m_pLineEdit->text());
     305    return m_hotKey;
    305306}
    306307
    307308void UIHotKeyEditor::setHotKey(const UIHotKey &hotKey)
    308309{
    309     m_pLineEdit->setText(hotKey.toString());
     310    m_hotKey = hotKey;
     311    m_pLineEdit->setText(hotKey.sequence());
    310312}
    311313
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.h

    r44650 r44651  
    3535
    3636    /* Constructors: */
    37     UIHotKey(const QString &strSequence = QString()) : m_strSequence(strSequence) {}
    38     UIHotKey(const UIHotKey &other) : m_strSequence(other.toString()) {}
     37    UIHotKey() {}
     38    UIHotKey(const QString &strSequence)
     39        : m_strSequence(strSequence)
     40    {}
     41    UIHotKey(const UIHotKey &other)
     42        : m_strSequence(other.sequence())
     43    {}
    3944
    40     /* API: Conversion stuff: */
    41     const QString& toString() const { return m_strSequence; }
     45    /* API: Operators stuff: */
     46    UIHotKey& operator=(const UIHotKey &other)
     47    {
     48        m_strSequence = other.sequence();
     49        return *this;
     50    }
     51
     52    /* API: Access stuff: */
     53    const QString& sequence() const { return m_strSequence; }
     54    void setSequence(const QString &strSequence) { m_strSequence = strSequence; }
    4255
    4356private:
     
    8396
    8497    /* Variables: */
     98    mutable UIHotKey m_hotKey;
    8599    QHBoxLayout *m_pMainLayout;
    86100    UIHotKeyLineEdit *m_pLineEdit;
Note: See TracChangeset for help on using the changeset viewer.

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