VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/QIAdvancedSlider.h@ 22480

Last change on this file since 22480 was 21194, checked in by vboxsync, 15 years ago

FE/Qt4: Colored slider for memory/CPU. Better snapping handling.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VirtualBox Qt extensions: QIAdvancedSlider class implementation
5 */
6
7/*
8 * Copyright (C) 2009 Sun Microsystems, Inc.
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23#ifndef __QIAdvancedSlider_h__
24#define __QIAdvancedSlider_h__
25
26/* Qt includes */
27#include <QSlider>
28
29class CPrivateSlider;
30
31class QIAdvancedSlider: public QWidget
32{
33 Q_OBJECT;
34
35public:
36 QIAdvancedSlider (QWidget *aParent = 0);
37 QIAdvancedSlider (Qt::Orientation aOrientation, QWidget *aParent = 0);
38
39 int value() const;
40
41 void setRange (int aMinV, int aMaxV);
42
43 void setMaximum (int aVal);
44 int maximum() const;
45
46 void setMinimum (int aVal);
47 int minimum() const;
48
49 void setPageStep (int aVal);
50 int pageStep() const;
51
52 void setSingleStep (int aVal);
53 int singelStep() const;
54
55 void setTickInterval (int aVal);
56 int tickInterval() const;
57
58 void setTickPosition (QSlider::TickPosition aPos);
59 QSlider::TickPosition tickPosition() const;
60
61 Qt::Orientation orientation() const;
62
63 void setSnappingEnabled (bool aOn);
64 bool isSnappingEnabled() const;
65
66 void setOptimalHint (int aMin, int aMax);
67 void setWarningHint (int aMin, int aMax);
68 void setErrorHint (int aMin, int aMax);
69
70public slots:
71
72 void setOrientation (Qt::Orientation aOrientation);
73 void setValue (int aVal);
74
75signals:
76 void valueChanged (int);
77 void sliderMoved (int);
78 void sliderPressed();
79 void sliderReleased();
80
81private slots:
82
83 void prvSliderMoved (int val);
84
85private:
86
87 void init (Qt::Orientation aOrientation = Qt::Horizontal);
88 int snapValue(int val);
89
90 /* Private member vars */
91 CPrivateSlider *mSlider;
92 bool mSnappingEnabled;
93};
94
95#endif /* __QIAdvancedSlider__ */
96
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