VirtualBox

Changeset 71536 in vbox for trunk


Ignore:
Timestamp:
Mar 28, 2018 12:03:55 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699 Some refactoring in file table view

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileModel.cpp

    r71350 r71536  
    3737    , m_pParent(qobject_cast<UIGuestControlFileTable*>(parent))
    3838{
    39     QList<QVariant> rootData;
    4039}
    4140
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp

    r71509 r71536  
    8989
    9090protected:
     91
    9192    virtual void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected) /*override */;
    9293    void contextMenuEvent(QContextMenuEvent *pEvent);
     94
     95private:
     96
     97    void configure();
     98
    9399};
    94100
     
    234240    :QTableView(parent)
    235241{
     242    configure();
     243}
     244
     245void UIGuestControlFileView::configure()
     246{
     247    setShowGrid(false);
     248    setSelectionBehavior(QAbstractItemView::SelectRows);
     249    verticalHeader()->setVisible(false);
     250    setEditTriggers(QAbstractItemView::NoEditTriggers);
     251    /* Minimize the row height: */
     252    verticalHeader()->setDefaultSectionSize(verticalHeader()->minimumSectionSize());
     253    setAlternatingRowColors(true);
    236254}
    237255
     
    471489    , m_uDirectoryCount(0)
    472490    , m_uSymlinkCount(0)
    473 {}
     491{
     492}
    474493
    475494
     
    731750    if (m_pView)
    732751    {
    733         m_pView->setShowGrid(false);
    734         m_pView->setSelectionBehavior(QAbstractItemView::SelectRows);
    735         m_pView->verticalHeader()->setVisible(false);
    736 
    737752        m_pMainLayout->addWidget(m_pView, 2, 0, 5, 5);
    738753        m_pView->setModel(m_pModel);
    739754        m_pView->setItemDelegate(new UIFileDelegate);
    740         m_pView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    741         /* Minimize the row height: */
    742         m_pView->verticalHeader()->setDefaultSectionSize(m_pView->verticalHeader()->minimumSectionSize());
    743755
    744756        connect(m_pView, &UIGuestControlFileView::doubleClicked,
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