mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58: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:
136
libs/qwt-6.1.5/include/qwt_plot_legenditem.h
Normal file
136
libs/qwt-6.1.5/include/qwt_plot_legenditem.h
Normal file
@ -0,0 +1,136 @@
|
||||
/* -*- 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_LEGEND_ITEM_H
|
||||
#define QWT_PLOT_LEGEND_ITEM_H
|
||||
|
||||
#include "qwt_global.h"
|
||||
#include "qwt_plot_item.h"
|
||||
#include "qwt_legend_data.h"
|
||||
|
||||
class QFont;
|
||||
|
||||
/*!
|
||||
\brief A class which draws a legend inside the plot canvas
|
||||
|
||||
QwtPlotLegendItem can be used to draw a inside the plot canvas.
|
||||
It can be used together with a QwtLegend or instead of it
|
||||
to have more space for the plot canvas.
|
||||
|
||||
In opposite to QwtLegend the legend item is not interactive.
|
||||
To identify mouse clicks on a legend item an event filter
|
||||
needs to be installed catching mouse events ob the plot canvas.
|
||||
The geometries of the legend items are available using
|
||||
legendGeometries().
|
||||
|
||||
The legend item is aligned to plot canvas according to
|
||||
its alignment() flags. It might have a background for the
|
||||
complete legend ( usually semi transparent ) or for
|
||||
each legend item.
|
||||
|
||||
\note An external QwtLegend with a transparent background
|
||||
on top the plot canvas might be another option
|
||||
with a similar effect.
|
||||
*/
|
||||
|
||||
class QWT_EXPORT QwtPlotLegendItem: public QwtPlotItem
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
\brief Background mode
|
||||
|
||||
Depending on the mode the complete legend or each item
|
||||
might have an background.
|
||||
|
||||
The default setting is LegendBackground.
|
||||
|
||||
\sa setBackgroundMode(), setBackgroundBrush(), drawBackground()
|
||||
*/
|
||||
enum BackgroundMode
|
||||
{
|
||||
//! The legend has a background
|
||||
LegendBackground,
|
||||
|
||||
//! Each item has a background
|
||||
ItemBackground
|
||||
};
|
||||
|
||||
explicit QwtPlotLegendItem();
|
||||
virtual ~QwtPlotLegendItem();
|
||||
|
||||
virtual int rtti() const;
|
||||
|
||||
void setAlignment( Qt::Alignment );
|
||||
Qt::Alignment alignment() const;
|
||||
|
||||
void setMaxColumns( uint );
|
||||
uint maxColumns() const;
|
||||
|
||||
void setMargin( int );
|
||||
int margin() const;
|
||||
|
||||
void setSpacing( int );
|
||||
int spacing() const;
|
||||
|
||||
void setItemMargin( int );
|
||||
int itemMargin() const;
|
||||
|
||||
void setItemSpacing( int );
|
||||
int itemSpacing() const;
|
||||
|
||||
void setFont( const QFont& );
|
||||
QFont font() const;
|
||||
|
||||
void setBorderDistance( int );
|
||||
int borderDistance() const;
|
||||
|
||||
void setBorderRadius( double );
|
||||
double borderRadius() const;
|
||||
|
||||
void setBorderPen( const QPen & );
|
||||
QPen borderPen() const;
|
||||
|
||||
void setBackgroundBrush( const QBrush & );
|
||||
QBrush backgroundBrush() const;
|
||||
|
||||
void setBackgroundMode( BackgroundMode );
|
||||
BackgroundMode backgroundMode() const;
|
||||
|
||||
void setTextPen( const QPen & );
|
||||
QPen textPen() const;
|
||||
|
||||
virtual void draw( QPainter *,
|
||||
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
|
||||
const QRectF &canvasRect ) const;
|
||||
|
||||
void clearLegend();
|
||||
|
||||
virtual void updateLegend( const QwtPlotItem *,
|
||||
const QList<QwtLegendData> & );
|
||||
|
||||
virtual QRect geometry( const QRectF &canvasRect ) const;
|
||||
|
||||
virtual QSize minimumSize( const QwtLegendData & ) const;
|
||||
virtual int heightForWidth( const QwtLegendData &, int width ) const;
|
||||
|
||||
QList< const QwtPlotItem * > plotItems() const;
|
||||
QList< QRect > legendGeometries( const QwtPlotItem * ) const;
|
||||
|
||||
protected:
|
||||
virtual void drawLegendData( QPainter *painter,
|
||||
const QwtPlotItem *, const QwtLegendData &, const QRectF & ) const;
|
||||
|
||||
virtual void drawBackground( QPainter *, const QRectF &rect ) const;
|
||||
|
||||
private:
|
||||
class PrivateData;
|
||||
PrivateData *d_data;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user