• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • widgets
kruler.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /* This file is part of the KDE libraries
3  Copyright (C) 1998 Jörg Habenicht (j.habenicht@europemail.com)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KRULER_H
22 #define KRULER_H
23 
24 #include <kdeui_export.h>
25 
26 #include <QtGui/QAbstractSlider>
27 
73 class KDEUI_EXPORT KRuler : public QAbstractSlider
74 {
75  Q_OBJECT
76  Q_PROPERTY( bool showTinyMarks READ showTinyMarks WRITE setShowTinyMarks )
77  Q_PROPERTY( bool showLittleMarks READ showLittleMarks WRITE setShowLittleMarks )
78  Q_PROPERTY( bool showMediumMarks READ showMediumMarks WRITE setShowMediumMarks )
79  Q_PROPERTY( bool showBigMarks READ showBigMarks WRITE setShowBigMarks )
80  Q_PROPERTY( bool showPointer READ showPointer WRITE setShowPointer )
81  Q_PROPERTY( bool showEndLabel READ showEndLabel WRITE setShowEndLabel )
82  Q_PROPERTY( int tinyMarkDistance READ tinyMarkDistance WRITE setTinyMarkDistance )
83  Q_PROPERTY( int littleMarkDistance READ littleMarkDistance WRITE setLittleMarkDistance )
84  Q_PROPERTY( int mediumMarkDistance READ mediumMarkDistance WRITE setBigMarkDistance )
85  Q_PROPERTY( int bigMarkDistance READ bigMarkDistance WRITE setBigMarkDistance )
86  Q_PROPERTY( double pixelPerMark READ pixelPerMark WRITE setPixelPerMark )
87  Q_PROPERTY( bool lengthFixed READ lengthFixed WRITE setLengthFixed )
88  Q_PROPERTY( QString endLabel READ endLabel WRITE setEndLabel )
89  Q_ENUMS( MetricStyle )
90  Q_PROPERTY( int length READ length WRITE setLength )
91  Q_PROPERTY( int offset READ offset )
92  Q_PROPERTY( int endOffset READ endOffset )
93 
94 public:
95 
96 /*
97 #define KRULER_ROTATE_TEST KRULER_ROTATE_TEST
98 #undef KRULER_ROTATE_TEST
99 #ifdef KRULER_ROTATE_TEST
100  double xtrans, ytrans, rotate;
101 # warning tmporaer variablen eingeschaltet
102 #endif
103 */
104 
108  enum MetricStyle { Custom=0, Pixel, Inch, Millimetres, Centimetres, Metres };
109 
113  // enum PaintStyle { Flat, Raised, Sunken };
114 
118  explicit KRuler(QWidget *parent=0);
131  explicit KRuler(Qt::Orientation orient, QWidget *parent=0, Qt::WindowFlags f=0);
132 
147  KRuler(Qt::Orientation orient, int widgetWidth, QWidget *parent=0,
148  Qt::WindowFlags f=0);
149 
153  ~KRuler();
154 
162 #ifndef KDE_NO_DEPRECATED
163  KDE_DEPRECATED void setMinValue(int);
164 #endif
165 
169 #ifndef KDE_NO_DEPRECATED
170  KDE_DEPRECATED int minValue() const;
171 #endif
172 
179 #ifndef KDE_NO_DEPRECATED
180  KDE_DEPRECATED void setMaxValue(int);
181 #endif
182 
186 #ifndef KDE_NO_DEPRECATED
187  KDE_DEPRECATED int maxValue() const;
188 #endif
189 
190 
196  void setTinyMarkDistance(int);
200  int tinyMarkDistance() const;
201 
207  void setLittleMarkDistance(int);
208 
212  int littleMarkDistance() const;
213 
220  void setMediumMarkDistance(int);
221  int mediumMarkDistance() const;
222 
228  void setBigMarkDistance(int);
232  int bigMarkDistance() const;
233 
237  void setShowTinyMarks(bool);
238  bool showTinyMarks() const;
242  void setShowLittleMarks(bool);
243  bool showLittleMarks() const;
247  void setShowMediumMarks(bool);
248  bool showMediumMarks() const;
252  void setShowBigMarks(bool);
253  bool showBigMarks() const;
257  void setShowEndMarks(bool);
258  bool showEndMarks() const;
262  void setShowPointer(bool);
263  bool showPointer() const;
264 
265 
266  void setFrameStyle(int);
267 
273  // void setShowLittleMarkLabel(bool);
274 
280  // void setShowMediumMarkLabel(bool);
281 
287  // void showBigMarkLabel(bool);
288 
294  void setShowEndLabel(bool);
295  bool showEndLabel() const;
296 
301  void setEndLabel(const QString&);
302  QString endLabel() const;
303 
309  void setRulerMetricStyle(KRuler::MetricStyle);
310 
329  void setPixelPerMark(double rate);
330 
334  double pixelPerMark() const;
335 
345  void setLength(int);
346  int length() const;
347 
354  void setLengthFixed(bool fix);
355  bool lengthFixed() const;
356 
368  void slideUp(int count = 1);
369 
381  void slideDown(int count = 1);
382 
391  void setOffset(int offset);
392 
396  int offset() const;
397 
398  int endOffset() const;
399 
400 public Q_SLOTS:
401 
408  void slotNewValue(int);
409 
416  void slotNewOffset(int);
417 
418  void slotEndOffset(int);
419 
420 protected:
421  virtual void paintEvent(QPaintEvent *);
422 
423 private:
424  void init(Qt::Orientation orientation);
425 
426 private:
427  class KRulerPrivate;
428  KRulerPrivate * const d;
429 };
430 
431 #endif
QAbstractSlider::setMinValue
void setMinValue(int v)
QWidget
KRuler::Pixel
Definition: kruler.h:108
QWidget::paintEvent
virtual void paintEvent(QPaintEvent *event)
QAbstractSlider::minValue
int minValue() const
KRuler
A ruler widget.
Definition: kruler.h:73
QAbstractSlider::maxValue
int maxValue() const
QString
QAbstractSlider
kdeui_export.h
Qt::WindowFlags
typedef WindowFlags
QPaintEvent
QAbstractSlider::setMaxValue
void setMaxValue(int v)
KRuler::MetricStyle
MetricStyle
The types of units used.
Definition: kruler.h:108
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal