VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsScrollArea.h@ 100347

Last change on this file since 100347 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: 3.3 KB
Line 
1/* $Id: UIGraphicsScrollArea.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIGraphicsScrollArea class declaration.
4 */
5
6/*
7 * Copyright (C) 2019-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_graphics_UIGraphicsScrollArea_h
29#define FEQT_INCLUDED_SRC_widgets_graphics_UIGraphicsScrollArea_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "QIGraphicsWidget.h"
36
37/* Forward declarations: */
38class QGraphicsScene;
39class UIGraphicsScrollBar;
40
41/** QIGraphicsWidget subclass providing GUI with graphics scroll-area. */
42class UIGraphicsScrollArea : public QIGraphicsWidget
43{
44 Q_OBJECT;
45
46public:
47
48 /** Constructs graphics scroll-area of requested @a enmOrientation, embedding it directly to passed @a pScene. */
49 UIGraphicsScrollArea(Qt::Orientation enmOrientation, QGraphicsScene *pScene);
50
51 /** Constructs graphics scroll-area of requested @a enmOrientation passing @a pParent to the base-class. */
52 UIGraphicsScrollArea(Qt::Orientation enmOrientation, QIGraphicsWidget *pParent = 0);
53
54 /** Returns minimum size-hint. */
55 virtual QSizeF minimumSizeHint() const RT_OVERRIDE;
56
57 /** Defines scroll-area @a pViewport. */
58 void setViewport(QIGraphicsWidget *pViewport);
59 /** Returns scroll-area viewport. */
60 QIGraphicsWidget *viewport() const;
61
62 /** Returns scrolling location value in pixels. */
63 int scrollingValue() const;
64 /** Defines scrolling location @a iValue in pixels. */
65 void setScrollingValue(int iValue);
66 /** Performs scrolling by @a iDelta pixels. */
67 void scrollBy(int iDelta);
68
69 /** Makes sure passed @a rect is visible. */
70 void makeSureRectIsVisible(const QRectF &rect);
71
72protected:
73
74 /** Preprocesses any Qt @a pEvent for passed @a pObject. */
75 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
76
77 /** Handles resize @a pEvent. */
78 virtual void resizeEvent(QGraphicsSceneResizeEvent *pEvent) RT_OVERRIDE;
79
80private slots:
81
82 /** Handles scroll-bar @a iValue change. */
83 void sltHandleScrollBarValueChange(int iValue);
84
85private:
86
87 /** Prepares all. */
88 void prepare();
89 /** Prepares all. */
90 void prepareWidgets();
91
92 /** Layout widgets. */
93 void layoutWidgets();
94
95 /** Holds the orientation. */
96 Qt::Orientation m_enmOrientation;
97 /** Holds whether scroll-bar is in auto-hide mode. */
98 bool m_fAutoHideMode;
99
100 /** Holds the scroll-bar instance. */
101 UIGraphicsScrollBar *m_pScrollBar;
102 /** Holds the viewport instance. */
103 QIGraphicsWidget *m_pViewport;
104};
105
106#endif /* !FEQT_INCLUDED_SRC_widgets_graphics_UIGraphicsScrollArea_h */
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