VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMenuToolBar.h@ 103977

Last change on this file since 103977 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1/* $Id: UIMenuToolBar.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMenuToolBar class declaration.
4 */
5
6/*
7 * Copyright (C) 2017-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_widgets_UIMenuToolBar_h
29#define FEQT_INCLUDED_SRC_widgets_UIMenuToolBar_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QWidget>
36
37/* Forward declarations: */
38class UIMenuToolBarPrivate;
39
40
41/** QWidget wrapper for QIToolBar extension
42 * holding single drop-down menu of actions. */
43class UIMenuToolBar : public QWidget
44{
45 Q_OBJECT;
46
47public:
48
49 /** Menu toolbar alignment types. */
50 enum AlignmentType
51 {
52 AlignmentType_TopLeft,
53 AlignmentType_TopRight,
54 AlignmentType_BottomLeft,
55 AlignmentType_BottomRight,
56 };
57
58 /** Constructs menu-toolbar wrapper. */
59 UIMenuToolBar(QWidget *pParent = 0);
60
61 /** Defines toolbar alignment @a enmType. */
62 void setAlignmentType(AlignmentType enmType);
63
64 /** Defines toolbar icon @a size. */
65 void setIconSize(const QSize &size);
66
67 /** Defines toolbar menu action. */
68 void setMenuAction(QAction *pAction);
69
70 /** Defines toolbar tool button @a enmStyle. */
71 void setToolButtonStyle(Qt::ToolButtonStyle enmStyle);
72
73 /** Returns toolbar widget for passed @a pAction. */
74 QWidget *widgetForAction(QAction *pAction) const;
75
76private:
77
78 /** Prepares all. */
79 void prepare();
80
81 /** Holds the menu-toolbar instance. */
82 UIMenuToolBarPrivate *m_pToolbar;
83};
84
85#endif /* !FEQT_INCLUDED_SRC_widgets_UIMenuToolBar_h */
86
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette