mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-15 13:28:41 +01: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:
141
libs/qwt-6.1.5/include/qwt_abstract_scale_draw.h
Normal file
141
libs/qwt-6.1.5/include/qwt_abstract_scale_draw.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/* -*- 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_ABSTRACT_SCALE_DRAW_H
|
||||
#define QWT_ABSTRACT_SCALE_DRAW_H
|
||||
|
||||
#include "qwt_global.h"
|
||||
#include "qwt_scale_div.h"
|
||||
#include "qwt_text.h"
|
||||
|
||||
class QPalette;
|
||||
class QPainter;
|
||||
class QFont;
|
||||
class QwtTransform;
|
||||
class QwtScaleMap;
|
||||
|
||||
/*!
|
||||
\brief A abstract base class for drawing scales
|
||||
|
||||
QwtAbstractScaleDraw can be used to draw linear or logarithmic scales.
|
||||
|
||||
After a scale division has been specified as a QwtScaleDiv object
|
||||
using setScaleDiv(), the scale can be drawn with the draw() member.
|
||||
*/
|
||||
class QWT_EXPORT QwtAbstractScaleDraw
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
Components of a scale
|
||||
\sa enableComponent(), hasComponent
|
||||
*/
|
||||
enum ScaleComponent
|
||||
{
|
||||
//! Backbone = the line where the ticks are located
|
||||
Backbone = 0x01,
|
||||
|
||||
//! Ticks
|
||||
Ticks = 0x02,
|
||||
|
||||
//! Labels
|
||||
Labels = 0x04
|
||||
};
|
||||
|
||||
//! Scale components
|
||||
typedef QFlags<ScaleComponent> ScaleComponents;
|
||||
|
||||
QwtAbstractScaleDraw();
|
||||
virtual ~QwtAbstractScaleDraw();
|
||||
|
||||
void setScaleDiv( const QwtScaleDiv & );
|
||||
const QwtScaleDiv& scaleDiv() const;
|
||||
|
||||
void setTransformation( QwtTransform * );
|
||||
const QwtScaleMap &scaleMap() const;
|
||||
QwtScaleMap &scaleMap();
|
||||
|
||||
void enableComponent( ScaleComponent, bool enable = true );
|
||||
bool hasComponent( ScaleComponent ) const;
|
||||
|
||||
void setTickLength( QwtScaleDiv::TickType, double length );
|
||||
double tickLength( QwtScaleDiv::TickType ) const;
|
||||
double maxTickLength() const;
|
||||
|
||||
void setSpacing( double );
|
||||
double spacing() const;
|
||||
|
||||
void setPenWidth( int width );
|
||||
int penWidth() const;
|
||||
|
||||
virtual void draw( QPainter *, const QPalette & ) const;
|
||||
|
||||
virtual QwtText label( double ) const;
|
||||
|
||||
/*!
|
||||
Calculate the extent
|
||||
|
||||
The extent is the distance from the baseline to the outermost
|
||||
pixel of the scale draw in opposite to its orientation.
|
||||
It is at least minimumExtent() pixels.
|
||||
|
||||
\param font Font used for drawing the tick labels
|
||||
\return Number of pixels
|
||||
|
||||
\sa setMinimumExtent(), minimumExtent()
|
||||
*/
|
||||
virtual double extent( const QFont &font ) const = 0;
|
||||
|
||||
void setMinimumExtent( double );
|
||||
double minimumExtent() const;
|
||||
|
||||
protected:
|
||||
/*!
|
||||
Draw a tick
|
||||
|
||||
\param painter Painter
|
||||
\param value Value of the tick
|
||||
\param len Length of the tick
|
||||
|
||||
\sa drawBackbone(), drawLabel()
|
||||
*/
|
||||
virtual void drawTick( QPainter *painter, double value, double len ) const = 0;
|
||||
|
||||
/*!
|
||||
Draws the baseline of the scale
|
||||
\param painter Painter
|
||||
|
||||
\sa drawTick(), drawLabel()
|
||||
*/
|
||||
virtual void drawBackbone( QPainter *painter ) const = 0;
|
||||
|
||||
/*!
|
||||
Draws the label for a major scale tick
|
||||
|
||||
\param painter Painter
|
||||
\param value Value
|
||||
|
||||
\sa drawTick(), drawBackbone()
|
||||
*/
|
||||
virtual void drawLabel( QPainter *painter, double value ) const = 0;
|
||||
|
||||
void invalidateCache();
|
||||
const QwtText &tickLabel( const QFont &, double value ) const;
|
||||
|
||||
private:
|
||||
QwtAbstractScaleDraw( const QwtAbstractScaleDraw & );
|
||||
QwtAbstractScaleDraw &operator=( const QwtAbstractScaleDraw & );
|
||||
|
||||
class PrivateData;
|
||||
PrivateData *d_data;
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtAbstractScaleDraw::ScaleComponents )
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user