mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 17:18:00 +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:
171
libs/qwt-6.1.5/include/qwt_plot_canvas.h
Normal file
171
libs/qwt-6.1.5/include/qwt_plot_canvas.h
Normal file
@ -0,0 +1,171 @@
|
||||
/* -*- 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_PLOT_CANVAS_H
|
||||
#define QWT_PLOT_CANVAS_H
|
||||
|
||||
#include "qwt_global.h"
|
||||
#include <qframe.h>
|
||||
#include <qpainterpath.h>
|
||||
|
||||
class QwtPlot;
|
||||
class QPixmap;
|
||||
|
||||
/*!
|
||||
\brief Canvas of a QwtPlot.
|
||||
|
||||
Canvas is the widget where all plot items are displayed
|
||||
|
||||
\sa QwtPlot::setCanvas(), QwtPlotGLCanvas
|
||||
*/
|
||||
class QWT_EXPORT QwtPlotCanvas : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius )
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
\brief Paint attributes
|
||||
|
||||
The default setting enables BackingStore and Opaque.
|
||||
|
||||
\sa setPaintAttribute(), testPaintAttribute()
|
||||
*/
|
||||
enum PaintAttribute
|
||||
{
|
||||
/*!
|
||||
\brief Paint double buffered reusing the content
|
||||
of the pixmap buffer when possible.
|
||||
|
||||
Using a backing store might improve the performance
|
||||
significantly, when working with widget overlays ( like rubber bands ).
|
||||
Disabling the cache might improve the performance for
|
||||
incremental paints (using QwtPlotDirectPainter ).
|
||||
|
||||
\sa backingStore(), invalidateBackingStore()
|
||||
*/
|
||||
BackingStore = 1,
|
||||
|
||||
/*!
|
||||
\brief Try to fill the complete contents rectangle
|
||||
of the plot canvas
|
||||
|
||||
When using styled backgrounds Qt assumes, that the
|
||||
canvas doesn't fill its area completely
|
||||
( f.e because of rounded borders ) and fills the area
|
||||
below the canvas. When this is done with gradients it might
|
||||
result in a serious performance bottleneck - depending on the size.
|
||||
|
||||
When the Opaque attribute is enabled the canvas tries to
|
||||
identify the gaps with some heuristics and to fill those only.
|
||||
|
||||
\warning Will not work for semitransparent backgrounds
|
||||
*/
|
||||
Opaque = 2,
|
||||
|
||||
/*!
|
||||
\brief Try to improve painting of styled backgrounds
|
||||
|
||||
QwtPlotCanvas supports the box model attributes for
|
||||
customizing the layout with style sheets. Unfortunately
|
||||
the design of Qt style sheets has no concept how to
|
||||
handle backgrounds with rounded corners - beside of padding.
|
||||
|
||||
When HackStyledBackground is enabled the plot canvas tries
|
||||
to separate the background from the background border
|
||||
by reverse engineering to paint the background before and
|
||||
the border after the plot items. In this order the border
|
||||
gets perfectly antialiased and you can avoid some pixel
|
||||
artifacts in the corners.
|
||||
*/
|
||||
HackStyledBackground = 4,
|
||||
|
||||
/*!
|
||||
When ImmediatePaint is set replot() calls repaint()
|
||||
instead of update().
|
||||
|
||||
\sa replot(), QWidget::repaint(), QWidget::update()
|
||||
*/
|
||||
ImmediatePaint = 8
|
||||
};
|
||||
|
||||
//! Paint attributes
|
||||
typedef QFlags<PaintAttribute> PaintAttributes;
|
||||
|
||||
/*!
|
||||
\brief Focus indicator
|
||||
The default setting is NoFocusIndicator
|
||||
\sa setFocusIndicator(), focusIndicator(), drawFocusIndicator()
|
||||
*/
|
||||
|
||||
enum FocusIndicator
|
||||
{
|
||||
//! Don't paint a focus indicator
|
||||
NoFocusIndicator,
|
||||
|
||||
/*!
|
||||
The focus is related to the complete canvas.
|
||||
Paint the focus indicator using drawFocusIndicator()
|
||||
*/
|
||||
CanvasFocusIndicator,
|
||||
|
||||
/*!
|
||||
The focus is related to an item (curve, point, ...) on
|
||||
the canvas. It is up to the application to display a
|
||||
focus indication using f.e. highlighting.
|
||||
*/
|
||||
ItemFocusIndicator
|
||||
};
|
||||
|
||||
explicit QwtPlotCanvas( QwtPlot * = NULL );
|
||||
virtual ~QwtPlotCanvas();
|
||||
|
||||
QwtPlot *plot();
|
||||
const QwtPlot *plot() const;
|
||||
|
||||
void setFocusIndicator( FocusIndicator );
|
||||
FocusIndicator focusIndicator() const;
|
||||
|
||||
void setBorderRadius( double );
|
||||
double borderRadius() const;
|
||||
|
||||
void setPaintAttribute( PaintAttribute, bool on = true );
|
||||
bool testPaintAttribute( PaintAttribute ) const;
|
||||
|
||||
const QPixmap *backingStore() const;
|
||||
void invalidateBackingStore();
|
||||
|
||||
virtual bool event( QEvent * );
|
||||
|
||||
Q_INVOKABLE QPainterPath borderPath( const QRect & ) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void replot();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * );
|
||||
virtual void resizeEvent( QResizeEvent * );
|
||||
|
||||
virtual void drawFocusIndicator( QPainter * );
|
||||
virtual void drawBorder( QPainter * );
|
||||
|
||||
void updateStyleSheetInfo();
|
||||
|
||||
private:
|
||||
void drawCanvas( QPainter *, bool withBackground );
|
||||
|
||||
class PrivateData;
|
||||
PrivateData *d_data;
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotCanvas::PaintAttributes )
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user