VirtualBox

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


Ignore:
Timestamp:
May 18, 2021 12:36:28 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144478
Message:

FE/Qt: bugref:10003: Reworking Chooser pane; Removing unwanted unconst stuff.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.cpp

    r88862 r89137  
    2828#include "UIIconPool.h"
    2929#include "UIVirtualBoxManager.h"
    30 
    31 /* Other VBox includes: */
    32 #include "iprt/cpp/utils.h"
    3330
    3431
     
    553550}
    554551
    555 void UIChooserItemGlobal::paintBackground(QPainter *pPainter, const QRect &rectangle) const
     552void UIChooserItemGlobal::paintBackground(QPainter *pPainter, const QRect &rectangle)
    556553{
    557554    /* Save painter: */
     
    562559
    563560    /* Selected-item background: */
    564     if (model()->selectedItems().contains(unconst(this)))
     561    if (model()->selectedItems().contains(this))
    565562    {
    566563        /* Prepare color: */
     
    655652}
    656653
    657 void UIChooserItemGlobal::paintFrame(QPainter *pPainter, const QRect &rectangle) const
     654void UIChooserItemGlobal::paintFrame(QPainter *pPainter, const QRect &rectangle)
    658655{
    659656    /* Only selected and/or hovered item should have a frame: */
    660     if (!model()->selectedItems().contains(unconst(this)) && !isHovered())
     657    if (!model()->selectedItems().contains(this) && !isHovered())
    661658        return;
    662659
     
    669666
    670667    /* Selected-item frame: */
    671     if (model()->selectedItems().contains(unconst(this)))
     668    if (model()->selectedItems().contains(this))
    672669        strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightnessMin - 40);
    673670    /* Hovered-item frame: */
     
    689686}
    690687
    691 void UIChooserItemGlobal::paintGlobalInfo(QPainter *pPainter, const QRect &rectangle) const
     688void UIChooserItemGlobal::paintGlobalInfo(QPainter *pPainter, const QRect &rectangle)
    692689{
    693690    /* Prepare variables: */
     
    700697
    701698    /* Selected or hovered item foreground: */
    702     if (model()->selectedItems().contains(unconst(this)) || isHovered())
     699    if (model()->selectedItems().contains(this) || isHovered())
    703700    {
    704701        /* Prepare palette: */
     
    707704        /* Get background color: */
    708705        const QColor highlight = pal.color(QPalette::Active, QPalette::Highlight);
    709         const QColor background = model()->selectedItems().contains(unconst(this))
     706        const QColor background = model()->selectedItems().contains(this)
    710707                                ? highlight.lighter(m_iHighlightLightnessMin)
    711708                                : highlight.lighter(m_iHoverLightnessMin);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.h

    r84625 r89137  
    210210      * @{ */
    211211        /** Paints background using specified @a pPainter and certain @a rectangle. */
    212         void paintBackground(QPainter *pPainter, const QRect &rectangle) const;
     212        void paintBackground(QPainter *pPainter, const QRect &rectangle);
    213213        /** Paints frame using specified @a pPainter and certain @a rect. */
    214         void paintFrame(QPainter *pPainter, const QRect &rectangle) const;
     214        void paintFrame(QPainter *pPainter, const QRect &rectangle);
    215215        /** Paints global info using specified @a pPainter and certain @a pOptions. */
    216         void paintGlobalInfo(QPainter *pPainter, const QRect &rectangle) const;
     216        void paintGlobalInfo(QPainter *pPainter, const QRect &rectangle);
    217217    /** @} */
    218218
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp

    r88862 r89137  
    3333#include "UIVirtualMachineItemCloud.h"
    3434#include "UIVirtualMachineItemLocal.h"
    35 
    36 /* Other VBox includes: */
    37 #include "iprt/cpp/utils.h"
    3835
    3936
     
    897894}
    898895
    899 void UIChooserItemMachine::paintBackground(QPainter *pPainter, const QRect &rectangle) const
     896void UIChooserItemMachine::paintBackground(QPainter *pPainter, const QRect &rectangle)
    900897{
    901898    /* Save painter: */
     
    906903
    907904    /* Selected-item background: */
    908     if (model()->selectedItems().contains(unconst(this)))
     905    if (model()->selectedItems().contains(this))
    909906    {
    910907        /* Prepare color: */
     
    999996        {
    1000997            /* Selected-item background: */
    1001             if (model()->selectedItems().contains(unconst(this)))
     998            if (model()->selectedItems().contains(this))
    1002999                backgroundColor = pal.color(QPalette::Active, QPalette::Highlight);
    10031000            /* Default background: */
     
    10121009        {
    10131010            /* Selected-item background: */
    1014             if (model()->selectedItems().contains(unconst(this)))
     1011            if (model()->selectedItems().contains(this))
    10151012                backgroundColor = pal.color(QPalette::Active, QPalette::Highlight);
    10161013            /* Default background: */
     
    10351032}
    10361033
    1037 void UIChooserItemMachine::paintFrame(QPainter *pPainter, const QRect &rectangle) const
     1034void UIChooserItemMachine::paintFrame(QPainter *pPainter, const QRect &rectangle)
    10381035{
    10391036    /* Only selected and/or hovered item should have a frame: */
    1040     if (!model()->selectedItems().contains(unconst(this)) && !isHovered())
     1037    if (!model()->selectedItems().contains(this) && !isHovered())
    10411038        return;
    10421039
     
    10491046
    10501047    /* Selected-item frame: */
    1051     if (model()->selectedItems().contains(unconst(this)))
     1048    if (model()->selectedItems().contains(this))
    10521049        strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightnessMin - 40);
    10531050    /* Hovered-item frame: */
     
    10711068}
    10721069
    1073 void UIChooserItemMachine::paintMachineInfo(QPainter *pPainter, const QRect &rectangle) const
     1070void UIChooserItemMachine::paintMachineInfo(QPainter *pPainter, const QRect &rectangle)
    10741071{
    10751072    /* Prepare variables: */
     
    10841081
    10851082    /* Selected or hovered item foreground: */
    1086     if (model()->selectedItems().contains(unconst(this)) || isHovered())
     1083    if (model()->selectedItems().contains(this) || isHovered())
    10871084    {
    10881085        /* Prepare palette: */
     
    10911088        /* Get background color: */
    10921089        const QColor highlight = pal.color(QPalette::Active, QPalette::Highlight);
    1093         const QColor background = model()->selectedItems().contains(unconst(this))
     1090        const QColor background = model()->selectedItems().contains(this)
    10941091                                ? highlight.lighter(m_iHighlightLightnessMin)
    10951092                                : highlight.lighter(m_iHoverLightnessMin);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h

    r86769 r89137  
    243243      * @{ */
    244244        /** Paints background using specified @a pPainter and certain @a rectangle. */
    245         void paintBackground(QPainter *pPainter, const QRect &rectangle) const;
     245        void paintBackground(QPainter *pPainter, const QRect &rectangle);
    246246        /** Paints frame using specified @a pPainter and certain @a rectangle. */
    247         void paintFrame(QPainter *pPainter, const QRect &rectangle) const;
     247        void paintFrame(QPainter *pPainter, const QRect &rectangle);
    248248        /** Paints machine info using specified @a pPainter and certain @a rectangle. */
    249         void paintMachineInfo(QPainter *pPainter, const QRect &rectangle) const;
     249        void paintMachineInfo(QPainter *pPainter, const QRect &rectangle);
    250250    /** @} */
    251251
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