Changeset 71346 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 15, 2018 10:03:10 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r71336 r71346 673 673 src/extensions/QIStatusBarIndicator.cpp \ 674 674 src/extensions/QITableView.cpp \ 675 src/extensions/QIToolButton.cpp \ 675 676 src/extensions/QITreeView.cpp \ 676 677 src/extensions/QITreeWidget.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIToolButton.cpp
r71343 r71346 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - Qt extensions: QIToolButton class declaration.3 * VBox Qt GUI - Qt extensions: QIToolButton class implementation. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2009-201 7Oracle Corporation7 * Copyright (C) 2009-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 16 16 */ 17 17 18 #ifndef __QIToolButton_h__ 19 # define __QIToolButton_h__18 /* GUI includes: */ 19 #include "QIToolButton.h" 20 20 21 /* Global includes: */22 #include <QToolButton>23 21 24 /* QToolButton reimplementation: */ 25 class QIToolButton: public QToolButton 22 QIToolButton::QIToolButton(QWidget *pParent /* = 0 */) 23 : QToolButton(pParent) 26 24 { 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 } 28 34 29 public: 35 void 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 } 30 45 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 } 46 void QIToolButton::removeBorder() 47 { 48 setStyleSheet("QToolButton { border: 0px }"); 49 } 43 50 44 /** Sets the auto-raise status. */45 virtual void setAutoRaise(bool fEnable)46 {47 #ifdef VBOX_WS_MAC48 /* 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 5 5 6 6 /* 7 * Copyright (C) 2009-201 7Oracle Corporation7 * Copyright (C) 2009-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 16 16 */ 17 17 18 #ifndef __ QIToolButton_h__19 #define __ QIToolButton_h__18 #ifndef ___QIToolButton_h___ 19 #define ___QIToolButton_h___ 20 20 21 /* Globalincludes: */21 /* Qt includes: */ 22 22 #include <QToolButton> 23 23 24 /* QToolButton reimplementation:*/25 class QIToolButton : public QToolButton24 /** QToolButton subclass with extended functionality. */ 25 class QIToolButton : public QToolButton 26 26 { 27 27 Q_OBJECT; … … 29 29 public: 30 30 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); 43 33 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); 55 36 56 void removeBorder() 57 { 58 setStyleSheet("QToolButton { border: 0px }"); 59 } 37 /** Removes the tool-button border. */ 38 void removeBorder(); 60 39 }; 61 40 62 #endif /* __QIToolButton_h__ */41 #endif /* !___QIToolButton_h___ */ 63 42
Note:
See TracChangeset
for help on using the changeset viewer.