VirtualBox

Changeset 64163 in vbox for trunk


Ignore:
Timestamp:
Oct 6, 2016 1:59:29 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 75): Unify QIStyledItemDelegate clones into main-stream.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r64067 r64163  
    539539        src/extensions/QISplitter.cpp \
    540540        src/extensions/QIAdvancedToolBar.cpp \
    541         src/extensions/QITableView.cpp \
    542541        src/extradata/UIExtraDataManager.cpp \
    543542        src/globals/UIActionPool.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStyledItemDelegate.h

    r64162 r64163  
    2929
    3030signals:
     31
     32    /** Notifies listeners about @a pEditor created for particular model @a index. */
     33    void sigEditorCreated(QWidget *pEditor, const QModelIndex &index) const;
    3134
    3235    /** Notifies listeners about editor's Enter key triggering. */
     
    6467            connect(pEditor, SIGNAL(sigEnterKeyTriggered()), this, SIGNAL(sigEditorEnterKeyTriggered()));
    6568
     69        /* Notify listeners about editor created: */
     70        emit sigEditorCreated(pEditor, index);
     71
    6672        /* Return actual editor: */
    6773        return pEditor;
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.cpp

    r60496 r64163  
    2020#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
    2121
    22 /* Qt includes: */
    23 # include <QStyledItemDelegate>
    24 
    2522/* GUI includes: */
    2623# include "QITableView.h"
     24# include "QIStyledItemDelegate.h"
    2725
    2826/* Other VBox includes: */
     
    3129#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3230
    33 
    34 /** QStyledItemDelegate extension used with QITableView. */
    35 class QITableViewStyledItemDelegate : public QStyledItemDelegate
    36 {
    37     Q_OBJECT;
    38 
    39 signals:
    40 
    41     /** Notifies listeners about @a pEditor created for particular model @a index. */
    42     void sigEditorCreated(QWidget *pEditor, const QModelIndex &index) const;
    43 
    44 public:
    45 
    46     /** Constructs table-view styled-item-delegate on the basis of passed @a pParent. */
    47     QITableViewStyledItemDelegate(QObject *pParent);
    48 
    49 private:
    50 
    51     /** Returns the widget used to edit the item specified by @a index for editing.
    52       * The @a pParent widget and style @a option are used to control how the editor widget appears.
    53       * Besides that, we are notifying listener about editor was created for particular model @a index. */
    54     virtual QWidget* createEditor(QWidget *pParent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    55 };
    56 
    57 
    58 /*********************************************************************************************************************************
    59 *   Class QITableViewStyledItemDelegate implementation.                                                                          *
    60 *********************************************************************************************************************************/
    61 
    62 QITableViewStyledItemDelegate::QITableViewStyledItemDelegate(QObject *pParent)
    63     : QStyledItemDelegate(pParent)
    64 {
    65 }
    66 
    67 QWidget* QITableViewStyledItemDelegate::createEditor(QWidget *pParent, const QStyleOptionViewItem &option, const QModelIndex &index) const
    68 {
    69     /* Call to base-class: */
    70     QWidget *pEditor = QStyledItemDelegate::createEditor(pParent, option, index);
    71     /* Notify listeners about editor created: */
    72     emit sigEditorCreated(pEditor, index);
    73     /* Return editor: */
    74     return pEditor;
    75 }
    76 
    77 
    78 /*********************************************************************************************************************************
    79 *   Class QITableView implementation.                                                                                            *
    80 *********************************************************************************************************************************/
    8131
    8232QITableView::QITableView(QWidget *pParent)
     
    10959    delete itemDelegate();
    11060    /* Create new delegate: */
    111     QITableViewStyledItemDelegate *pStyledItemDelegate = new QITableViewStyledItemDelegate(this);
     61    QIStyledItemDelegate *pStyledItemDelegate = new QIStyledItemDelegate(this);
    11262    AssertPtrReturnVoid(pStyledItemDelegate);
    11363    {
     
    14393}
    14494
    145 #include "QITableView.moc"
    146 
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