VirtualBox

Changeset 77922 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 27, 2019 2:38:22 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Chooser pane: A bit of cleanup for makeSureItemIsVisible API.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.h

    r77847 r77922  
    186186        /** Makes sure item is visible. */
    187187        virtual void makeSureItsVisible();
    188         /** Makes sure passed @a pItem is visible within the current root item.
    189           * @note Please keep in mind that any group item can be a root, but there
    190           * is just one model root item at the same time, accessible via model's
    191           * root() getter, and this API can be called for current root item only,
    192           * because this is root item who performs actual scrolling, while
    193           * @a pItem itself can be on any level of embedding. */
    194         virtual void makeSureItemIsVisible(UIChooserItem *pItem) { Q_UNUSED(pItem); }
    195188
    196189        /** Returns pixmap item representation. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp

    r77847 r77922  
    140140}
    141141
    142 /* static */
    143 QString UIChooserItemGroup::className()
    144 {
    145     return "UIChooserItemGroup";
    146 }
    147 
    148142void UIChooserItemGroup::makeSureItemIsVisible(UIChooserItem *pItem)
    149143{
     
    157151    const QRectF itemRectInGroup = QRectF(positionInGroup, pItem->size());
    158152    m_pScrollArea->makeSureRectIsVisible(itemRectInGroup);
     153}
     154
     155/* static */
     156QString UIChooserItemGroup::className()
     157{
     158    return "UIChooserItemGroup";
    159159}
    160160
     
    262262    /* Make sure item visible: */
    263263    if (model()->root())
    264         model()->root()->makeSureItemIsVisible(this);
     264        model()->root()->toGroupItem() ->makeSureItemIsVisible(this);
    265265
    266266    /* Assign name-editor text: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h

    r77847 r77922  
    9090    /** @name Navigation stuff.
    9191      * @{ */
     92        /** Makes sure passed @a pItem is visible within the current root item.
     93          * @note Please keep in mind that any group item can be a root, but there
     94          * is just one model root item at the same time, accessible via model's
     95          * root() getter, and this API can be called for current root item only,
     96          * because this is root item who performs actual scrolling, while
     97          * @a pItem itself can be on any level of embedding. */
     98        void makeSureItemIsVisible(UIChooserItem *pItem) /* override */;
     99
    92100        /** Class-name used for drag&drop mime-data format. */
    93101        static QString className();
    94         /** Makes sure passed child @a pItem is visible. */
    95         virtual void makeSureItemIsVisible(UIChooserItem *pItem) /* override */;
    96102    /** @} */
    97103
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r77919 r77922  
    414414    if (view() && view()->window() && root())
    415415        if (view()->window()->isVisible() && pItem)
    416             root()->makeSureItemIsVisible(pItem);
     416            root()->toGroupItem()->makeSureItemIsVisible(pItem);
    417417}
    418418
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