/usr/include/paraview/ctkRangeSlider.h is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | /*=========================================================================
Program: ParaView
Module: pqSpinBox.h
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
/*=========================================================================
Library: CTK
Copyright (c) Kitware Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#ifndef ctkRangeSlider_h
#define ctkRangeSlider_h
// Qt includes
#include <QSlider>
// PQ includes
#include "pqWidgetsModule.h"
class QStylePainter;
class ctkRangeSliderPrivate;
/// \ingroup Widgets
///
/// A ctkRangeSlider is a slider that lets you input 2 values instead of one
/// (see QSlider). These values are typically a lower and upper bound.
/// Values are comprised between the range of the slider. See setRange(),
/// minimum() and maximum(). The upper bound can't be smaller than the
/// lower bound and vice-versa.
/// When setting new values (setMinimumValue(), setMaximumValue() or
/// setValues()), make sure they lie between the range (minimum(), maximum())
/// of the slider, they would be forced otherwised. If it is not the behavior
/// you desire, you can set the range first (setRange(), setMinimum(),
/// setMaximum())
/// TODO: support triggerAction(QAbstractSlider::SliderSingleStepSub) that
/// moves both values at a time.
/// \sa ctkDoubleRangeSlider, ctkDoubleSlider, ctkRangeWidget
class PQWIDGETS_EXPORT ctkRangeSlider : public QSlider
{
Q_OBJECT
Q_PROPERTY(int minimumValue READ minimumValue WRITE setMinimumValue)
Q_PROPERTY(int maximumValue READ maximumValue WRITE setMaximumValue)
Q_PROPERTY(int minimumPosition READ minimumPosition WRITE setMinimumPosition)
Q_PROPERTY(int maximumPosition READ maximumPosition WRITE setMaximumPosition)
Q_PROPERTY(bool symmetricMoves READ symmetricMoves WRITE setSymmetricMoves)
Q_PROPERTY(QString handleToolTip READ handleToolTip WRITE setHandleToolTip)
public:
// Superclass typedef
typedef QSlider Superclass;
/// Constructor, builds a ctkRangeSlider that ranges from 0 to 100 and has
/// a lower and upper values of 0 and 100 respectively, other properties
/// are set the QSlider default properties.
explicit ctkRangeSlider( Qt::Orientation o, QWidget* par= 0 );
explicit ctkRangeSlider( QWidget* par = 0 );
virtual ~ctkRangeSlider();
///
/// This property holds the slider's current minimum value.
/// The slider silently forces minimumValue to be within the legal range:
/// minimum() <= minimumValue() <= maximumValue() <= maximum().
/// Changing the minimumValue also changes the minimumPosition.
int minimumValue() const;
///
/// This property holds the slider's current maximum value.
/// The slider forces the maximum value to be within the legal range:
/// The slider silently forces maximumValue to be within the legal range:
/// Changing the maximumValue also changes the maximumPosition.
int maximumValue() const;
///
/// This property holds the current slider minimum position.
/// If tracking is enabled (the default), this is identical to minimumValue.
int minimumPosition() const;
void setMinimumPosition(int min);
///
/// This property holds the current slider maximum position.
/// If tracking is enabled (the default), this is identical to maximumValue.
int maximumPosition() const;
void setMaximumPosition(int max);
///
/// Utility function that set the minimum position and
/// maximum position at once.
void setPositions(int min, int max);
///
/// When symmetricMoves is true, moving a handle will move the other handle
/// symmetrically, otherwise the handles are independent. False by default
bool symmetricMoves()const;
void setSymmetricMoves(bool symmetry);
///
/// Controls the text to display for the handle tooltip. It is in addition
/// to the widget tooltip.
/// "%1" is replaced by the current value of the slider.
/// Empty string (by default) means no tooltip.
QString handleToolTip()const;
void setHandleToolTip(const QString& toolTip);
Q_SIGNALS:
///
/// This signal is emitted when the slider minimum value has changed,
/// with the new slider value as argument.
void minimumValueChanged(int min);
///
/// This signal is emitted when the slider maximum value has changed,
/// with the new slider value as argument.
void maximumValueChanged(int max);
///
/// Utility signal that is fired when minimum or maximum values have changed.
void valuesChanged(int min, int max);
///
/// This signal is emitted when sliderDown is true and the slider moves.
/// This usually happens when the user is dragging the minimum slider.
/// The value is the new slider minimum position.
/// This signal is emitted even when tracking is turned off.
void minimumPositionChanged(int min);
///
/// This signal is emitted when sliderDown is true and the slider moves.
/// This usually happens when the user is dragging the maximum slider.
/// The value is the new slider maximum position.
/// This signal is emitted even when tracking is turned off.
void maximumPositionChanged(int max);
///
/// Utility signal that is fired when minimum or maximum positions
/// have changed.
void positionsChanged(int min, int max);
public Q_SLOTS:
///
/// This property holds the slider's current minimum value.
/// The slider silently forces min to be within the legal range:
/// minimum() <= min <= maximumValue() <= maximum().
/// Note: Changing the minimumValue also changes the minimumPosition.
/// \sa stMaximumValue, setValues, setMinimum, setMaximum, setRange
void setMinimumValue(int min);
///
/// This property holds the slider's current maximum value.
/// The slider silently forces max to be within the legal range:
/// minimum() <= minimumValue() <= max <= maximum().
/// Note: Changing the maximumValue also changes the maximumPosition.
/// \sa stMinimumValue, setValues, setMinimum, setMaximum, setRange
void setMaximumValue(int max);
///
/// Utility function that set the minimum value and maximum value at once.
/// The slider silently forces min and max to be within the legal range:
/// minimum() <= min <= max <= maximum().
/// Note: Changing the minimumValue and maximumValue also changes the
/// minimumPosition and maximumPosition.
/// \sa setMinimumValue, setMaximumValue, setMinimum, setMaximum, setRange
void setValues(int min, int max);
protected Q_SLOTS:
void onRangeChanged(int minimum, int maximum);
protected:
ctkRangeSlider( ctkRangeSliderPrivate* impl, Qt::Orientation o, QWidget* par= 0 );
ctkRangeSlider( ctkRangeSliderPrivate* impl, QWidget* par = 0 );
// Description:
// Standard Qt UI events
virtual void mousePressEvent(QMouseEvent* ev);
virtual void mouseMoveEvent(QMouseEvent* ev);
virtual void mouseReleaseEvent(QMouseEvent* ev);
virtual void mouseDoubleClickEvent(QMouseEvent *ev);
bool isMinimumSliderDown()const;
bool isMaximumSliderDown()const;
// Description:
// Rendering is done here.
virtual void paintEvent(QPaintEvent* ev);
virtual void initMinimumSliderStyleOption(QStyleOptionSlider* option) const;
virtual void initMaximumSliderStyleOption(QStyleOptionSlider* option) const;
// Description:
// Reimplemented for the tooltips
virtual bool event(QEvent* event);
protected:
QScopedPointer<ctkRangeSliderPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(ctkRangeSlider);
Q_DISABLE_COPY(ctkRangeSlider);
};
#endif
|