Dhanya Thattil 38cd10d4e6
Qt5 built in qwt (#570)
- qt4->qt5
- in built qt5 6.1.5 because rhel7 is not upto date with qt5, removed findqwt.cmake
- made a fix in qwt lib (qwt_plot_layout.h) to work with 5.15 and lower versions for qrect constr.
- qt5 forms fixed, qt4 many hard coding forms switched to forms including qtabwidget, scrolls etc, fonts moved to forms
 - docking option enabled by default, removed option to disable docking feature from "Mode"
- added qVersionResolve utility functions to handle compatibility before and after qt5.12
- qtplots (ian's code) takes in gain mode enable to set some settings within the class, with proper gain plot ticks
- ensure gain plots have no zooming of z axis in 2d and y axis in 1d
- removed placeholder text in qpalette in main window form as its not supportd until 5.12 (so using qt5.9 designer insted of qt5.15 to cope)
- tab order
Servers:
- fixed some error messages that were empty for fail in funcs (mostly minor as if this error, major issues)
2022-11-11 15:15:10 +01:00

131 lines
3.4 KiB
C++

/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_SLIDER_H
#define QWT_SLIDER_H
#include "qwt_global.h"
#include "qwt_abstract_slider.h"
class QwtScaleDraw;
/*!
\brief The Slider Widget
QwtSlider is a slider widget which operates on an interval
of type double. Its position is related to a scale showing
the current value.
The slider can be customized by having a through, a groove - or both.
\image html sliders.png
*/
class QWT_EXPORT QwtSlider: public QwtAbstractSlider
{
Q_OBJECT
Q_ENUMS( ScalePosition BackgroundStyle )
Q_PROPERTY( Qt::Orientation orientation
READ orientation WRITE setOrientation )
Q_PROPERTY( ScalePosition scalePosition READ scalePosition
WRITE setScalePosition )
Q_PROPERTY( bool trough READ hasTrough WRITE setTrough )
Q_PROPERTY( bool groove READ hasGroove WRITE setGroove )
Q_PROPERTY( QSize handleSize READ handleSize WRITE setHandleSize )
Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
Q_PROPERTY( int spacing READ spacing WRITE setSpacing )
public:
/*!
Position of the scale
\sa QwtSlider(), setScalePosition(), setOrientation()
*/
enum ScalePosition
{
//! The slider has no scale
NoScale,
//! The scale is right of a vertical or below a horizontal slider
LeadingScale,
//! The scale is left of a vertical or above a horizontal slider
TrailingScale
};
explicit QwtSlider( QWidget *parent = NULL );
explicit QwtSlider( Qt::Orientation, QWidget *parent = NULL );
virtual ~QwtSlider();
void setOrientation( Qt::Orientation );
Qt::Orientation orientation() const;
void setScalePosition( ScalePosition );
ScalePosition scalePosition() const;
void setTrough( bool );
bool hasTrough() const;
void setGroove( bool );
bool hasGroove() const;
void setHandleSize( const QSize & );
QSize handleSize() const;
void setBorderWidth( int );
int borderWidth() const;
void setSpacing( int );
int spacing() const;
virtual QSize sizeHint() const;
virtual QSize minimumSizeHint() const;
void setScaleDraw( QwtScaleDraw * );
const QwtScaleDraw *scaleDraw() const;
void setUpdateInterval( int );
int updateInterval() const;
protected:
virtual double scrolledTo( const QPoint & ) const;
virtual bool isScrollPosition( const QPoint & ) const;
virtual void drawSlider ( QPainter *, const QRect & ) const;
virtual void drawHandle( QPainter *, const QRect &, int pos ) const;
virtual void mousePressEvent( QMouseEvent * );
virtual void mouseReleaseEvent( QMouseEvent * );
virtual void resizeEvent( QResizeEvent * );
virtual void paintEvent ( QPaintEvent * );
virtual void changeEvent( QEvent * );
virtual void timerEvent( QTimerEvent * );
virtual void scaleChange();
QRect sliderRect() const;
QRect handleRect() const;
private:
QwtScaleDraw *scaleDraw();
void layoutSlider( bool );
void initSlider( Qt::Orientation );
class PrivateData;
PrivateData *d_data;
};
#endif