mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
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)
This commit is contained in:
168
libs/qwt-6.1.5/include/qwt_dial.h
Normal file
168
libs/qwt-6.1.5/include/qwt_dial.h
Normal file
@ -0,0 +1,168 @@
|
||||
/* -*- 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_DIAL_H
|
||||
#define QWT_DIAL_H 1
|
||||
|
||||
#include "qwt_global.h"
|
||||
#include "qwt_abstract_slider.h"
|
||||
#include "qwt_abstract_scale_draw.h"
|
||||
#include <qframe.h>
|
||||
#include <qpalette.h>
|
||||
|
||||
class QwtDialNeedle;
|
||||
class QwtRoundScaleDraw;
|
||||
|
||||
/*!
|
||||
\brief QwtDial class provides a rounded range control.
|
||||
|
||||
QwtDial is intended as base class for dial widgets like
|
||||
speedometers, compass widgets, clocks ...
|
||||
|
||||
\image html dials2.png
|
||||
|
||||
A dial contains a scale and a needle indicating the current value
|
||||
of the dial. Depending on Mode one of them is fixed and the
|
||||
other is rotating. If not isReadOnly() the
|
||||
dial can be rotated by dragging the mouse or using keyboard inputs
|
||||
(see QwtAbstractSlider::keyPressEvent()). A dial might be wrapping, what means
|
||||
a rotation below/above one limit continues on the other limit (f.e compass).
|
||||
The scale might cover any arc of the dial, its values are related to
|
||||
the origin() of the dial.
|
||||
|
||||
Often dials have to be updated very often according to values from external
|
||||
devices. For these high refresh rates QwtDial caches as much as possible.
|
||||
For derived classes it might be necessary to clear these caches manually
|
||||
according to attribute changes using invalidateCache().
|
||||
|
||||
\sa QwtCompass, QwtAnalogClock, QwtDialNeedle
|
||||
\note The controls and dials examples shows different types of dials.
|
||||
\note QDial is more similar to QwtKnob than to QwtDial
|
||||
*/
|
||||
|
||||
class QWT_EXPORT QwtDial: public QwtAbstractSlider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_ENUMS( Shadow Mode Direction )
|
||||
|
||||
Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
|
||||
Q_PROPERTY( Shadow frameShadow READ frameShadow WRITE setFrameShadow )
|
||||
Q_PROPERTY( Mode mode READ mode WRITE setMode )
|
||||
Q_PROPERTY( double origin READ origin WRITE setOrigin )
|
||||
Q_PROPERTY( double minScaleArc READ minScaleArc WRITE setMinScaleArc )
|
||||
Q_PROPERTY( double maxScaleArc READ maxScaleArc WRITE setMaxScaleArc )
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
\brief Frame shadow
|
||||
|
||||
Unfortunately it is not possible to use QFrame::Shadow
|
||||
as a property of a widget that is not derived from QFrame.
|
||||
The following enum is made for the designer only. It is safe
|
||||
to use QFrame::Shadow instead.
|
||||
*/
|
||||
enum Shadow
|
||||
{
|
||||
//! QFrame::Plain
|
||||
Plain = QFrame::Plain,
|
||||
|
||||
//! QFrame::Raised
|
||||
Raised = QFrame::Raised,
|
||||
|
||||
//! QFrame::Sunken
|
||||
Sunken = QFrame::Sunken
|
||||
};
|
||||
|
||||
//! Mode controlling whether the needle or the scale is rotating
|
||||
enum Mode
|
||||
{
|
||||
//! The needle is rotating
|
||||
RotateNeedle,
|
||||
|
||||
//! The needle is fixed, the scales are rotating
|
||||
RotateScale
|
||||
};
|
||||
|
||||
explicit QwtDial( QWidget *parent = NULL );
|
||||
virtual ~QwtDial();
|
||||
|
||||
void setFrameShadow( Shadow );
|
||||
Shadow frameShadow() const;
|
||||
|
||||
void setLineWidth( int );
|
||||
int lineWidth() const;
|
||||
|
||||
void setMode( Mode );
|
||||
Mode mode() const;
|
||||
|
||||
void setScaleArc( double minArc, double maxArc );
|
||||
|
||||
void setMinScaleArc( double );
|
||||
double minScaleArc() const;
|
||||
|
||||
void setMaxScaleArc( double );
|
||||
double maxScaleArc() const;
|
||||
|
||||
virtual void setOrigin( double );
|
||||
double origin() const;
|
||||
|
||||
void setNeedle( QwtDialNeedle * );
|
||||
const QwtDialNeedle *needle() const;
|
||||
QwtDialNeedle *needle();
|
||||
|
||||
QRect boundingRect() const;
|
||||
QRect innerRect() const;
|
||||
|
||||
virtual QRect scaleInnerRect() const;
|
||||
|
||||
virtual QSize sizeHint() const;
|
||||
virtual QSize minimumSizeHint() const;
|
||||
|
||||
void setScaleDraw( QwtRoundScaleDraw * );
|
||||
|
||||
QwtRoundScaleDraw *scaleDraw();
|
||||
const QwtRoundScaleDraw *scaleDraw() const;
|
||||
|
||||
protected:
|
||||
virtual void wheelEvent( QWheelEvent * );
|
||||
virtual void paintEvent( QPaintEvent * );
|
||||
virtual void changeEvent( QEvent * );
|
||||
|
||||
virtual void drawFrame( QPainter * );
|
||||
virtual void drawContents( QPainter * ) const;
|
||||
virtual void drawFocusIndicator( QPainter * ) const;
|
||||
|
||||
void invalidateCache();
|
||||
|
||||
virtual void drawScale( QPainter *,
|
||||
const QPointF ¢er, double radius ) const;
|
||||
|
||||
virtual void drawScaleContents( QPainter *painter,
|
||||
const QPointF ¢er, double radius ) const;
|
||||
|
||||
virtual void drawNeedle( QPainter *, const QPointF &,
|
||||
double radius, double direction, QPalette::ColorGroup ) const;
|
||||
|
||||
virtual double scrolledTo( const QPoint & ) const;
|
||||
virtual bool isScrollPosition( const QPoint & ) const;
|
||||
|
||||
virtual void sliderChange();
|
||||
virtual void scaleChange();
|
||||
|
||||
private:
|
||||
void setAngleRange( double angle, double span );
|
||||
void drawNeedle( QPainter * ) const;
|
||||
|
||||
class PrivateData;
|
||||
PrivateData *d_data;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user