From f67b8df3ebdba2d398b9cce686b7c644adffff08 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 7 May 2011 00:02:01 +0200 Subject: library split --- src/widgets/widgets/qslider.h | 134 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 src/widgets/widgets/qslider.h (limited to 'src/widgets/widgets/qslider.h') diff --git a/src/widgets/widgets/qslider.h b/src/widgets/widgets/qslider.h new file mode 100644 index 0000000000..a2201da9a2 --- /dev/null +++ b/src/widgets/widgets/qslider.h @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSLIDER_H +#define QSLIDER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_SLIDER + +class QSliderPrivate; +class QStyleOptionSlider; +class Q_GUI_EXPORT QSlider : public QAbstractSlider +{ + Q_OBJECT + + Q_ENUMS(TickPosition) + Q_PROPERTY(TickPosition tickPosition READ tickPosition WRITE setTickPosition) + Q_PROPERTY(int tickInterval READ tickInterval WRITE setTickInterval) + +public: + enum TickPosition { + NoTicks = 0, + TicksAbove = 1, + TicksLeft = TicksAbove, + TicksBelow = 2, + TicksRight = TicksBelow, + TicksBothSides = 3 + +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + ,NoMarks = NoTicks, + Above = TicksAbove, + Left = TicksAbove, + Below = TicksBelow, + Right = TicksRight, + Both = TicksBothSides +#endif + }; + + explicit QSlider(QWidget *parent = 0); + explicit QSlider(Qt::Orientation orientation, QWidget *parent = 0); + + ~QSlider(); + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + void setTickPosition(TickPosition position); + TickPosition tickPosition() const; + + void setTickInterval(int ti); + int tickInterval() const; + + bool event(QEvent *event); + +protected: + void paintEvent(QPaintEvent *ev); + void mousePressEvent(QMouseEvent *ev); + void mouseReleaseEvent(QMouseEvent *ev); + void mouseMoveEvent(QMouseEvent *ev); + void initStyleOption(QStyleOptionSlider *option) const; + +#ifdef QT3_SUPPORT +public: + QT3_SUPPORT_CONSTRUCTOR QSlider(QWidget *parent, const char *name); + QT3_SUPPORT_CONSTRUCTOR QSlider(Qt::Orientation, QWidget *parent, const char *name); + QT3_SUPPORT_CONSTRUCTOR QSlider(int minValue, int maxValue, int pageStep, int value, + Qt::Orientation orientation, + QWidget *parent = 0, const char *name = 0); + inline QT3_SUPPORT void setTickmarks(TickPosition position) { setTickPosition(position); } + inline QT3_SUPPORT TickPosition tickmarks() const { return tickPosition(); } +public Q_SLOTS: + inline QT_MOC_COMPAT void addStep() { triggerAction(SliderSingleStepAdd); } + inline QT_MOC_COMPAT void subtractStep() { triggerAction(SliderSingleStepSub); } +#endif + +private: + friend Q_GUI_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider); + + Q_DISABLE_COPY(QSlider) + Q_DECLARE_PRIVATE(QSlider) +}; + +#endif // QT_NO_SLIDER + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QSLIDER_H -- cgit v1.2.3 From 94c0628d22e844a23e1ee27cd3df03cc9e0e2c25 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 7 May 2011 15:05:43 +0200 Subject: fix includes --- src/widgets/widgets/qslider.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/widgets/qslider.h') diff --git a/src/widgets/widgets/qslider.h b/src/widgets/widgets/qslider.h index a2201da9a2..a6c457267e 100644 --- a/src/widgets/widgets/qslider.h +++ b/src/widgets/widgets/qslider.h @@ -42,7 +42,7 @@ #ifndef QSLIDER_H #define QSLIDER_H -#include +#include QT_BEGIN_HEADER -- cgit v1.2.3 From 819f9ca965279562f34895dab405f28162c0b8ab Mon Sep 17 00:00:00 2001 From: Olli Werwolff Date: Wed, 8 Jun 2011 09:51:07 +0200 Subject: Use Q_WIDGETS_EXPORT for widgets library Reviewed-by: Lars Knoll --- src/widgets/widgets/qslider.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets/qslider.h') diff --git a/src/widgets/widgets/qslider.h b/src/widgets/widgets/qslider.h index 60326106a3..907548fcb2 100644 --- a/src/widgets/widgets/qslider.h +++ b/src/widgets/widgets/qslider.h @@ -54,7 +54,7 @@ QT_MODULE(Gui) class QSliderPrivate; class QStyleOptionSlider; -class Q_GUI_EXPORT QSlider : public QAbstractSlider +class Q_WIDGETS_EXPORT QSlider : public QAbstractSlider { Q_OBJECT @@ -119,7 +119,7 @@ public Q_SLOTS: #endif private: - friend Q_GUI_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider); + friend Q_WIDGETS_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider); Q_DISABLE_COPY(QSlider) Q_DECLARE_PRIVATE(QSlider) -- cgit v1.2.3