mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-24 02:27: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:
178
libs/qwt-6.1.5/include/qwt_knob.h
Normal file
178
libs/qwt-6.1.5/include/qwt_knob.h
Normal file
@ -0,0 +1,178 @@
|
||||
/* -*- 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_KNOB_H
|
||||
#define QWT_KNOB_H
|
||||
|
||||
#include "qwt_global.h"
|
||||
#include "qwt_abstract_slider.h"
|
||||
|
||||
class QwtRoundScaleDraw;
|
||||
|
||||
/*!
|
||||
\brief The Knob Widget
|
||||
|
||||
The QwtKnob widget imitates look and behavior of a volume knob on a radio.
|
||||
It looks similar to QDial - not to QwtDial.
|
||||
|
||||
The value range of a knob might be divided into several turns.
|
||||
|
||||
The layout of the knob depends on the knobWidth().
|
||||
|
||||
- width > 0
|
||||
The diameter of the knob is fixed and the knob is aligned
|
||||
according to the alignment() flags inside of the contentsRect().
|
||||
|
||||
- width <= 0
|
||||
The knob is extended to the minimum of width/height of the contentsRect()
|
||||
and aligned in the other direction according to alignment().
|
||||
|
||||
Setting a fixed knobWidth() is helpful to align several knobs with different
|
||||
scale labels.
|
||||
|
||||
\image html knob.png
|
||||
*/
|
||||
|
||||
class QWT_EXPORT QwtKnob: public QwtAbstractSlider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_ENUMS ( KnobStyle MarkerStyle )
|
||||
|
||||
Q_PROPERTY( KnobStyle knobStyle READ knobStyle WRITE setKnobStyle )
|
||||
Q_PROPERTY( int knobWidth READ knobWidth WRITE setKnobWidth )
|
||||
Q_PROPERTY( Qt::Alignment alignment READ alignment WRITE setAlignment )
|
||||
Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
|
||||
Q_PROPERTY( int numTurns READ numTurns WRITE setNumTurns )
|
||||
Q_PROPERTY( MarkerStyle markerStyle READ markerStyle WRITE setMarkerStyle )
|
||||
Q_PROPERTY( int markerSize READ markerSize WRITE setMarkerSize )
|
||||
Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
|
||||
|
||||
public:
|
||||
/*!
|
||||
\brief Style of the knob surface
|
||||
|
||||
Depending on the KnobStyle the surface of the knob is
|
||||
filled from the brushes of the widget palette().
|
||||
|
||||
\sa setKnobStyle(), knobStyle()
|
||||
*/
|
||||
enum KnobStyle
|
||||
{
|
||||
//! Fill the knob with a brush from QPalette::Button.
|
||||
Flat,
|
||||
|
||||
//! Build a gradient from QPalette::Midlight and QPalette::Button
|
||||
Raised,
|
||||
|
||||
/*!
|
||||
Build a gradient from QPalette::Midlight, QPalette::Button
|
||||
and QPalette::Midlight
|
||||
*/
|
||||
Sunken,
|
||||
|
||||
/*!
|
||||
Build a radial gradient from QPalette::Button
|
||||
like it is used for QDial in various Qt styles.
|
||||
*/
|
||||
Styled
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief Marker type
|
||||
|
||||
The marker indicates the current value on the knob
|
||||
The default setting is a Notch marker.
|
||||
|
||||
\sa setMarkerStyle(), setMarkerSize()
|
||||
*/
|
||||
enum MarkerStyle
|
||||
{
|
||||
//! Don't paint any marker
|
||||
NoMarker = -1,
|
||||
|
||||
//! Paint a single tick in QPalette::ButtonText color
|
||||
Tick,
|
||||
|
||||
//! Paint a triangle in QPalette::ButtonText color
|
||||
Triangle,
|
||||
|
||||
//! Paint a circle in QPalette::ButtonText color
|
||||
Dot,
|
||||
|
||||
/*!
|
||||
Draw a raised ellipse with a gradient build from
|
||||
QPalette::Light and QPalette::Mid
|
||||
*/
|
||||
Nub,
|
||||
|
||||
/*!
|
||||
Draw a sunken ellipse with a gradient build from
|
||||
QPalette::Light and QPalette::Mid
|
||||
*/
|
||||
Notch
|
||||
};
|
||||
|
||||
explicit QwtKnob( QWidget* parent = NULL );
|
||||
virtual ~QwtKnob();
|
||||
|
||||
void setAlignment( Qt::Alignment );
|
||||
Qt::Alignment alignment() const;
|
||||
|
||||
void setKnobWidth( int );
|
||||
int knobWidth() const;
|
||||
|
||||
void setNumTurns( int );
|
||||
int numTurns() const;
|
||||
|
||||
void setTotalAngle ( double angle );
|
||||
double totalAngle() const;
|
||||
|
||||
void setKnobStyle( KnobStyle );
|
||||
KnobStyle knobStyle() const;
|
||||
|
||||
void setBorderWidth( int );
|
||||
int borderWidth() const;
|
||||
|
||||
void setMarkerStyle( MarkerStyle );
|
||||
MarkerStyle markerStyle() const;
|
||||
|
||||
void setMarkerSize( int );
|
||||
int markerSize() const;
|
||||
|
||||
virtual QSize sizeHint() const;
|
||||
virtual QSize minimumSizeHint() const;
|
||||
|
||||
void setScaleDraw( QwtRoundScaleDraw * );
|
||||
|
||||
const QwtRoundScaleDraw *scaleDraw() const;
|
||||
QwtRoundScaleDraw *scaleDraw();
|
||||
|
||||
QRect knobRect() const;
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * );
|
||||
virtual void changeEvent( QEvent * );
|
||||
|
||||
virtual void drawKnob( QPainter *, const QRectF & ) const;
|
||||
|
||||
virtual void drawFocusIndicator( QPainter * ) const;
|
||||
|
||||
virtual void drawMarker( QPainter *,
|
||||
const QRectF &, double angle ) const;
|
||||
|
||||
virtual double scrolledTo( const QPoint & ) const;
|
||||
virtual bool isScrollPosition( const QPoint & ) const;
|
||||
|
||||
private:
|
||||
class PrivateData;
|
||||
PrivateData *d_data;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user