VirtualBox

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


Ignore:
Timestamp:
Mar 15, 2018 10:03:10 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9049: Preparing to common library: Split the QIToolButton code to proper files, doxygen, cleanup.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 edited
1 copied

Legend:

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

    r71336 r71346  
    673673        src/extensions/QIStatusBarIndicator.cpp \
    674674        src/extensions/QITableView.cpp \
     675        src/extensions/QIToolButton.cpp \
    675676        src/extensions/QITreeView.cpp \
    676677        src/extensions/QITreeWidget.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIToolButton.cpp

    r71343 r71346  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - Qt extensions: QIToolButton class declaration.
     3 * VBox Qt GUI - Qt extensions: QIToolButton class implementation.
    44 */
    55
    66/*
    7  * Copyright (C) 2009-2017 Oracle Corporation
     7 * Copyright (C) 2009-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __QIToolButton_h__
    19 #define __QIToolButton_h__
     18/* GUI includes: */
     19#include "QIToolButton.h"
    2020
    21 /* Global includes: */
    22 #include <QToolButton>
    2321
    24 /* QToolButton reimplementation: */
    25 class QIToolButton: public QToolButton
     22QIToolButton::QIToolButton(QWidget *pParent /* = 0 */)
     23    : QToolButton(pParent)
    2624{
    27     Q_OBJECT;
     25#ifdef VBOX_WS_MAC
     26    /* Keep size-hint alive: */
     27    const QSize sh = sizeHint();
     28    setStyleSheet("QToolButton { border: 0px none black; margin: 0px 0px 0px 0px; } QToolButton::menu-indicator {image: none;}");
     29    setFixedSize(sh);
     30#else /* !VBOX_WS_MAC */
     31    setAutoRaise(true);
     32#endif /* !VBOX_WS_MAC */
     33}
    2834
    29 public:
     35void QIToolButton::setAutoRaise(bool fEnabled)
     36{
     37#ifdef VBOX_WS_MAC
     38    /* Ignore for macOS: */
     39    Q_UNUSED(fEnabled);
     40#else /* !VBOX_WS_MAC */
     41    /* Call to base-class: */
     42    QToolButton::setAutoRaise(fEnabled);
     43#endif /* !VBOX_WS_MAC */
     44}
    3045
    31     QIToolButton(QWidget *pParent = 0)
    32         : QToolButton(pParent)
    33     {
    34 #ifdef VBOX_WS_MAC
    35         /* Keep size-hint alive: */
    36         const QSize sh = sizeHint();
    37         setStyleSheet("QToolButton { border: 0px none black; margin: 0px 0px 0px 0px; } QToolButton::menu-indicator {image: none;}");
    38         setFixedSize(sh);
    39 #else /* !VBOX_WS_MAC */
    40         setAutoRaise(true);
    41 #endif /* !VBOX_WS_MAC */
    42     }
     46void QIToolButton::removeBorder()
     47{
     48    setStyleSheet("QToolButton { border: 0px }");
     49}
    4350
    44     /** Sets the auto-raise status. */
    45     virtual void setAutoRaise(bool fEnable)
    46     {
    47 #ifdef VBOX_WS_MAC
    48         /* Ignore for Mac OS X: */
    49         Q_UNUSED(fEnable);
    50 #else /* !VBOX_WS_MAC */
    51         /* Call to base-class: */
    52         QToolButton::setAutoRaise(fEnable);
    53 #endif /* !VBOX_WS_MAC */
    54     }
    55 
    56     void removeBorder()
    57     {
    58         setStyleSheet("QToolButton { border: 0px }");
    59     }
    60 };
    61 
    62 #endif /* __QIToolButton_h__ */
    63 
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIToolButton.h

    r69500 r71346  
    55
    66/*
    7  * Copyright (C) 2009-2017 Oracle Corporation
     7 * Copyright (C) 2009-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __QIToolButton_h__
    19 #define __QIToolButton_h__
     18#ifndef ___QIToolButton_h___
     19#define ___QIToolButton_h___
    2020
    21 /* Global includes: */
     21/* Qt includes: */
    2222#include <QToolButton>
    2323
    24 /* QToolButton reimplementation: */
    25 class QIToolButton: public QToolButton
     24/** QToolButton subclass with extended functionality. */
     25class QIToolButton : public QToolButton
    2626{
    2727    Q_OBJECT;
     
    2929public:
    3030
    31     QIToolButton(QWidget *pParent = 0)
    32         : QToolButton(pParent)
    33     {
    34 #ifdef VBOX_WS_MAC
    35         /* Keep size-hint alive: */
    36         const QSize sh = sizeHint();
    37         setStyleSheet("QToolButton { border: 0px none black; margin: 0px 0px 0px 0px; } QToolButton::menu-indicator {image: none;}");
    38         setFixedSize(sh);
    39 #else /* !VBOX_WS_MAC */
    40         setAutoRaise(true);
    41 #endif /* !VBOX_WS_MAC */
    42     }
     31    /** Constructs tool-button passing @a pParent to the base-class. */
     32    QIToolButton(QWidget *pParent = 0);
    4333
    44     /** Sets the auto-raise status. */
    45     virtual void setAutoRaise(bool fEnable)
    46     {
    47 #ifdef VBOX_WS_MAC
    48         /* Ignore for Mac OS X: */
    49         Q_UNUSED(fEnable);
    50 #else /* !VBOX_WS_MAC */
    51         /* Call to base-class: */
    52         QToolButton::setAutoRaise(fEnable);
    53 #endif /* !VBOX_WS_MAC */
    54     }
     34    /** Sets whether the auto-raise status @a fEnabled. */
     35    virtual void setAutoRaise(bool fEnabled);
    5536
    56     void removeBorder()
    57     {
    58         setStyleSheet("QToolButton { border: 0px }");
    59     }
     37    /** Removes the tool-button border. */
     38    void removeBorder();
    6039};
    6140
    62 #endif /* __QIToolButton_h__ */
     41#endif /* !___QIToolButton_h___ */
    6342
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