VirtualBox

Changeset 64179 in vbox for trunk/src


Ignore:
Timestamp:
Oct 7, 2016 1:03:10 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 79): Continuing with the r111152.

File:
1 edited

Legend:

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

    r64170 r64179  
    150150    /* Handler: Readiness stuff: */
    151151    void sltHandleShortcutsLoaded();
     152
     153private:
     154
     155    /** Prepares all. */
     156    void prepare();
    152157};
    153158
     
    478483    /* Set object name: */
    479484    setObjectName(strObjectName);
    480 
    481     /* Connect model: */
     485    /* Set model: */
    482486    setModel(pModel);
    483     connect(pModel, SIGNAL(sigShortcutsLoaded()), this, SLOT(sltHandleShortcutsLoaded()));
    484 
     487
     488    /* Prepare all: */
     489    prepare();
     490}
     491
     492void UIHotKeyTable::sltHandleShortcutsLoaded()
     493{
     494    /* Resize columns to feat contents: */
     495    resizeColumnsToContents();
     496
     497    /* Configure sorting: */
     498    sortByColumn(Section_Name, Qt::AscendingOrder);
     499    setSortingEnabled(true);
     500}
     501
     502void UIHotKeyTable::prepare()
     503{
    485504    /* Configure self: */
    486505    setTabKeyNavigation(false);
     
    502521#endif /* QT_VERSION < 0x050000 */
    503522
     523    /* Connect model: */
     524    connect(model(), SIGNAL(sigShortcutsLoaded()), this, SLOT(sltHandleShortcutsLoaded()));
     525
    504526    /* Reinstall delegate: */
    505527    delete itemDelegate();
    506528    QIStyledItemDelegate *pStyledItemDelegate = new QIStyledItemDelegate(this);
    507529    setItemDelegate(pStyledItemDelegate);
    508 
    509     /* Create new item editor factory: */
    510     QItemEditorFactory *pNewItemEditorFactory = new QItemEditorFactory;
    511 
    512     /* Register UIHotKeyEditor as the UIHotKey editor: */
    513     int iHotKeyTypeId = qRegisterMetaType<UIHotKey>();
    514     QStandardItemEditorCreator<UIHotKeyEditor> *pHotKeyItemEditorCreator = new QStandardItemEditorCreator<UIHotKeyEditor>();
    515     pNewItemEditorFactory->registerEditor((QVariant::Type)iHotKeyTypeId, pHotKeyItemEditorCreator);
    516 
    517     /* Register UIHostComboEditor as the UIHostComboWrapper: */
    518     int iHostComboTypeId = qRegisterMetaType<UIHostComboWrapper>();
    519     QStandardItemEditorCreator<UIHostComboEditor> *pHostComboItemEditorCreator = new QStandardItemEditorCreator<UIHostComboEditor>();
    520     pNewItemEditorFactory->registerEditor((QVariant::Type)iHostComboTypeId, pHostComboItemEditorCreator);
    521 
    522     /* Set configured item editor factory for table delegate: */
    523     pStyledItemDelegate->setItemEditorFactory(pNewItemEditorFactory);
    524 
    525     /* Configure item delegate: */
    526     pStyledItemDelegate->setWatchForEditorDataCommits(true);
    527 }
    528 
    529 void UIHotKeyTable::sltHandleShortcutsLoaded()
    530 {
    531     /* Resize columns to feat contents: */
    532     resizeColumnsToContents();
    533 
    534     /* Configure sorting: */
    535     sortByColumn(Section_Name, Qt::AscendingOrder);
    536     setSortingEnabled(true);
     530    AssertPtrReturnVoid(pStyledItemDelegate);
     531    {
     532        /* Configure item delegate: */
     533        pStyledItemDelegate->setWatchForEditorDataCommits(true);
     534
     535        /* Create new item editor factory: */
     536        QItemEditorFactory *pNewItemEditorFactory = new QItemEditorFactory;
     537        AssertPtrReturnVoid(pNewItemEditorFactory);
     538        {
     539            /* Register UIHotKeyEditor as the UIHotKey editor: */
     540            int iHotKeyTypeId = qRegisterMetaType<UIHotKey>();
     541            QStandardItemEditorCreator<UIHotKeyEditor> *pHotKeyItemEditorCreator = new QStandardItemEditorCreator<UIHotKeyEditor>();
     542            pNewItemEditorFactory->registerEditor((QVariant::Type)iHotKeyTypeId, pHotKeyItemEditorCreator);
     543
     544            /* Register UIHostComboEditor as the UIHostComboWrapper editor: */
     545            int iHostComboTypeId = qRegisterMetaType<UIHostComboWrapper>();
     546            QStandardItemEditorCreator<UIHostComboEditor> *pHostComboItemEditorCreator = new QStandardItemEditorCreator<UIHostComboEditor>();
     547            pNewItemEditorFactory->registerEditor((QVariant::Type)iHostComboTypeId, pHostComboItemEditorCreator);
     548
     549            /* Assign configured item editor factory to item delegate: */
     550            pStyledItemDelegate->setItemEditorFactory(pNewItemEditorFactory);
     551        }
     552    }
    537553}
    538554
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