~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to kexi/widget/kexislider.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2012 Oleg Kukharchuk <oleg.kuh@gmail.com>
 
3
 
 
4
   This program is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU Library General Public
 
6
   License as published by the Free Software Foundation; either
 
7
   version 2 of the License, or (at your option) any later version.
 
8
 
 
9
   This program is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
   Library General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU Library General Public License
 
15
   along with this program; see the file COPYING.  If not, write to
 
16
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
 * Boston, MA 02110-1301, USA.
 
18
*/
 
19
 
 
20
#ifndef KEXISLIDER_H
 
21
#define KEXISLIDER_H
 
22
 
 
23
#include "kexi_export.h"
 
24
 
 
25
#include <QWidget>
 
26
#include <QSlider>
 
27
 
 
28
class Slider;
 
29
class QSpinBox;
 
30
class QBoxLayout;
 
31
 
 
32
 
 
33
/**
 
34
 * @brief KexiSlider widget provides slider with spinbox and labels for tickmarks
 
35
 *
 
36
 */
 
37
class KEXIEXTWIDGETS_EXPORT KexiSlider : public QWidget
 
38
{
 
39
    Q_OBJECT
 
40
    Q_PROPERTY(int value READ value WRITE setValue)
 
41
    Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
 
42
    Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
 
43
    Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
 
44
    Q_PROPERTY(int tickInterval READ tickInterval WRITE setTickInterval)
 
45
    Q_PROPERTY(QSlider::TickPosition tickPosition READ tickPosition WRITE setTickPosition)
 
46
    Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
 
47
    Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep)
 
48
    Q_PROPERTY(bool showEditor READ showEditor WRITE setShowEditor)
 
49
 
 
50
public:
 
51
    explicit KexiSlider(QWidget *parent = 0);
 
52
    explicit KexiSlider(Qt::Orientation orientation, QWidget *parent = 0);
 
53
    ~KexiSlider();
 
54
 
 
55
    void setTickInterval(int ti);
 
56
    void setTickPosition(QSlider::TickPosition pos);
 
57
    void setMinimum(int min);
 
58
    void setMaximum(int max);
 
59
    void setSingleStep(int step);
 
60
    void setPageStep(int step);
 
61
    void setShowEditor(bool show);
 
62
 
 
63
    int value() const;
 
64
    int maximum() const;
 
65
    int minimum() const;
 
66
    Qt::Orientation orientation() const;
 
67
    int singleStep() const;
 
68
    int pageStep() const;
 
69
    QSlider::TickPosition tickPosition() const;
 
70
    int tickInterval() const;
 
71
    bool showEditor() const;
 
72
 
 
73
signals:
 
74
    void valueChanged(int);
 
75
    void sliderPressed();
 
76
    void sliderReleased();
 
77
public slots:
 
78
    void setValue(int value);
 
79
    void setOrientation(Qt::Orientation o);
 
80
private:
 
81
    void updateLayout();
 
82
    void init(Qt::Orientation);
 
83
 
 
84
    Slider *m_slider;
 
85
    QSpinBox *m_spinBox;
 
86
    QBoxLayout *m_layout;
 
87
};
 
88
#endif // KEXISLIDER_H