Last change
on this file since 71346 was 71346, checked in by vboxsync, 7 years ago |
FE/Qt: bugref:9049: Preparing to common library: Split the QIToolButton code to proper files, doxygen, cleanup.
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.4 KB
|
Line | |
---|
1 | /* $Id: QIToolButton.cpp 71346 2018-03-15 10:03:10Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - Qt extensions: QIToolButton class implementation.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-2018 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | /* GUI includes: */
|
---|
19 | #include "QIToolButton.h"
|
---|
20 |
|
---|
21 |
|
---|
22 | QIToolButton::QIToolButton(QWidget *pParent /* = 0 */)
|
---|
23 | : QToolButton(pParent)
|
---|
24 | {
|
---|
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 | }
|
---|
34 |
|
---|
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 | }
|
---|
45 |
|
---|
46 | void QIToolButton::removeBorder()
|
---|
47 | {
|
---|
48 | setStyleSheet("QToolButton { border: 0px }");
|
---|
49 | }
|
---|
50 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.