VirtualBox

Changeset 64168 in vbox


Ignore:
Timestamp:
Oct 6, 2016 2:55:18 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111150
Message:

FE/Qt: bugref:6899: Accessibility support (step 76): A bit of cleanup for QITableView.

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

Legend:

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

    r64163 r64168  
    5454}
    5555
     56void QITableView::sltEditorCreated(QWidget *pEditor, const QModelIndex &index)
     57{
     58    /* Connect created editor to the table and store it: */
     59    connect(pEditor, SIGNAL(destroyed(QObject *)), this, SLOT(sltEditorDestroyed(QObject *)));
     60    m_editors[index] = pEditor;
     61}
     62
     63void QITableView::sltEditorDestroyed(QObject *pEditor)
     64{
     65    /* Clear destroyed editor from the table: */
     66    const QModelIndex index = m_editors.key(pEditor);
     67    AssertReturnVoid(index.isValid());
     68    m_editors.remove(index);
     69}
     70
    5671void QITableView::prepare()
    5772{
     
    7085}
    7186
    72 void QITableView::sltEditorCreated(QWidget *pEditor, const QModelIndex &index)
    73 {
    74     /* Connect created editor to the table and store it: */
    75     connect(pEditor, SIGNAL(destroyed(QObject *)), this, SLOT(sltEditorDestroyed(QObject *)));
    76     m_editors[index] = pEditor;
    77 }
    78 
    79 void QITableView::sltEditorDestroyed(QObject *pEditor)
    80 {
    81     /* Clear destroyed editor from the table: */
    82     QModelIndex index = m_editors.key(pEditor);
    83     AssertReturnVoid(index.isValid());
    84     m_editors.remove(index);
    85 }
    86 
    8787void QITableView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
    8888{
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.h

    r60496 r64168  
    2222#include <QTableView>
    2323
    24 /** QTableView extension providing GUI with advanced functionality. */
     24
     25/** QTableView subclass extending standard functionality. */
    2526class QITableView : public QTableView
    2627{
     
    3435public:
    3536
    36     /** Constructs table-view on the basis of passed @a pParent. */
     37    /** Constructs table-view passing @a pParent to the base-class. */
    3738    QITableView(QWidget *pParent = 0);
    3839
     
    4041    void makeSureEditorDataCommitted();
    4142
     43protected slots:
     44
     45    /** Stores the created @a pEditor for passed @a index in the map. */
     46    virtual void sltEditorCreated(QWidget *pEditor, const QModelIndex &index);
     47    /** Clears the destoyed @a pEditor from the map. */
     48    virtual void sltEditorDestroyed(QObject *pEditor);
     49
    4250protected:
    4351
    4452    /** Prepares all. */
    45     void prepare();
     53    virtual void prepare();
    4654
    4755    /** Handles index change from @a previous to @a current. */
    4856    virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous) /* override */;
    49 
    50 protected slots:
    51 
    52     /** Stores the created @a pEditor for passed @a index in the map. */
    53     void sltEditorCreated(QWidget *pEditor, const QModelIndex &index);
    54     /** Clears the destoyed @a pEditor from the map. */
    55     void sltEditorDestroyed(QObject *pEditor);
    56 
    57 private:
    5857
    5958    /** Holds the map of editors stored for passed indexes. */
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