FIXED issue #80: "Bug with multiple inheritance with Q_GDAGET with CLANG", thanks to user:igormironchik, caused by QTBUG-104874

This commit is contained in:
jkriege2 2022-07-19 10:24:52 +02:00
parent ea6db847d8
commit ece49f2d2b
13 changed files with 101 additions and 29 deletions

View File

@ -20,6 +20,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
<li>JKQtPlotter:<ul>
<li>FIXED issue described in <a href="https://github.com/jkriege2/JKQtPlotter/pull/62">#62: Fix custom labels draw, because giving exactly two label-strings did not display all of them</a>, thanks to <a href="https://github.com/FalsinSoft">user:FalsinSoft</a></li>
<li>FIXED issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/70">#70: Typo in jkqtplotter/CMakeLists.txt</a>, thanks to <a href="https://github.com/tedlinlab">user:tedlinlab</a></li>
<li>FIXED issue <a href="https://github.com/jkriege2/JKQtPlotter/pull/80">#80: Bug with multiple inheritance with Q_GDAGET with CLANG</a>, thanks to <a href="https://github.com/igormironchik">user:igormironchik</a>, caused by <a href="https://bugreports.qt.io/browse/QTBUG-104874">QTBUG-104874</a></li>
<li>FIXED: styling was not properly applied to coordinate axes of colorbars outside the plot</li>
<li>IMPROVED: QT6-compatibility by removing deprecated warnings</li>
<li>NEW: JKQTPFilledCurveXGraph and JKQTPFilledCurveYGraph can now plot wiggle plots with different fill styles above and below the baseline (feature request <a href="https://github.com/jkriege2/JKQtPlotter/issues/68">#68 Wiggle Plots</a> from <a href="https://github.com/xichaoqiang">user:xichaoqiang</a> </li>

View File

@ -31,7 +31,6 @@
*/
class JKQTCOMMON_LIB_EXPORT JKQTPEnhancedPainter : public QPainter {
Q_GADGET
public:
JKQTPEnhancedPainter(QPaintDevice* device);
JKQTPEnhancedPainter();

View File

@ -25,6 +25,7 @@
#include <QPainter>
#include "jkqtplotter/jkqtptools.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
#include "jkqtplotter/jkqtpgraphsbase.h"
#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
@ -43,7 +44,9 @@
\image html test_styledboxplot.png
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGraphBoxplotStyleMixin: public JKQTPGraphLineStyleMixin, public JKQTPGraphFillStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class constructor */
JKQTPGraphBoxplotStyleMixin();

View File

@ -26,6 +26,7 @@
#include <QPainter>
#include "jkqtplotter/jkqtptools.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
#include "jkqtplotter/jkqtpgraphsbase.h"
#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
@ -40,7 +41,9 @@
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGraphViolinplotStyleMixin: public JKQTPGraphLineStyleMixin, public JKQTPGraphFillStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:

View File

@ -27,6 +27,7 @@
#include "jkqtplotter/jkqtpimagetools.h"
#include "jkqtplotter/jkqtpgraphsbasestyle.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
#include "jkqtcommon/jkqtpdrawingtools.h"
#include "jkqtcommon/jkqtpbasicimagetools.h"
#include <QColor>

View File

@ -25,6 +25,7 @@
#include <QColor>
#include "jkqtplotter/jkqtptools.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
class JKQTBasePlotterStyle; // forward

View File

@ -30,6 +30,7 @@
#include "jkqtplotter/jkqtptools.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtplotter/jkqtpimagetools.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
/*! \brief This mix-in class assembles all styling properties applicable to error indicators
@ -42,7 +43,9 @@
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGraphErrorStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class contructor */
JKQTPGraphErrorStyleMixin();
@ -192,7 +195,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphErrorStyleMixin {
\see JKQTPYGraphErrorData, \ref jkqtplotter_graphsgroup_classstructure_mixins
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPXGraphErrorData {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class contructor */
JKQTPXGraphErrorData();
@ -242,7 +247,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPXGraphErrorData {
\see JKQTPXGraphErrorData \ref jkqtplotter_graphsgroup_classstructure_mixins
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPYGraphErrorData {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class contructor */
JKQTPYGraphErrorData();
@ -290,7 +297,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPYGraphErrorData {
\see JKQTPXGraphErrorData, JKQTPGraphErrorStyleMixin, \ref jkqtplotter_graphsgroup_classstructure_mixins
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPXGraphErrors: public JKQTPXGraphErrorData, public JKQTPGraphErrorStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class contructor */
JKQTPXGraphErrors();
@ -312,7 +321,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPXGraphErrors: public JKQTPXGraphErrorData, pub
\see JKQTPYGraphErrorData, JKQTPGraphErrorStyleMixin, \ref jkqtplotter_graphsgroup_classstructure_mixins
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPYGraphErrors: public JKQTPYGraphErrorData, public JKQTPGraphErrorStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class contructor */
JKQTPYGraphErrors();
@ -336,7 +347,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPYGraphErrors: public JKQTPYGraphErrorData, pub
\see JKQTPXGraphErrorData, JKQTPYGraphErrorData, JKQTPGraphErrorStyleMixin, \ref jkqtplotter_graphsgroup_classstructure_mixins
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPXYGraphErrors: public JKQTPXGraphErrorData, public JKQTPYGraphErrorData, public JKQTPGraphErrorStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class contructor */
JKQTPXYGraphErrors();

View File

@ -28,6 +28,7 @@
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtcommon/jkqtpdrawingtools.h"
#include "jkqtcommon/jkqtpbasicimagetools.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
#include <QColor>
#include <QPainter>
#include <QString>
@ -45,7 +46,9 @@ class JKQTBasePlotterStyle; // forward
* \see JKQTBasePlotter, \ref jkqtpplotter_styling
*/
class JKQTPLOTTER_LIB_EXPORT JKQTGraphsSpecificStyleProperties {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief initializes the object for the given \a type and takes some properties from the \a parent */
JKQTGraphsSpecificStyleProperties(JKQTPPlotStyleType type, const JKQTBasePlotterStyle& parent);
@ -104,7 +107,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTGraphsSpecificStyleProperties {
protected:
/** \brief modifies some of the settings to match the defaults for the given JKQTPPlotStyleType (e.g. sets line-width for impulses ...) */
void modifyForDefaultStyle(JKQTPPlotStyleType type);
};
};
@ -113,9 +116,11 @@ class JKQTPLOTTER_LIB_EXPORT JKQTGraphsSpecificStyleProperties {
*
* \see JKQTBasePlotter, \ref jkqtpplotter_styling
*/
class JKQTPLOTTER_LIB_EXPORT JKQTGeometricSpecificStyleProperties: public JKQTGraphsSpecificStyleProperties {
Q_GADGET
public:
class JKQTPLOTTER_LIB_EXPORT JKQTGeometricSpecificStyleProperties: public JKQTGraphsSpecificStyleProperties {
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
JKQTGeometricSpecificStyleProperties(const JKQTBasePlotterStyle& parent);
JKQTGeometricSpecificStyleProperties(const JKQTBasePlotterStyle& parent, const JKQTGraphsSpecificStyleProperties& other);
JKQTGeometricSpecificStyleProperties(JKQTPPlotStyleType type, const JKQTBasePlotterStyle& parent);
@ -153,7 +158,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTGraphsSpecificStyleProperties {
Qt::BrushStyle defaultFillStyle;
};
};
/** \brief Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of annotation elements
@ -161,9 +166,11 @@ class JKQTPLOTTER_LIB_EXPORT JKQTGraphsSpecificStyleProperties {
*
* \see JKQTBasePlotter, \ref jkqtpplotter_styling
*/
class JKQTPLOTTER_LIB_EXPORT JKQTAnnotationsSpecificStyleProperties: public JKQTGeometricSpecificStyleProperties {
Q_GADGET
public:
class JKQTPLOTTER_LIB_EXPORT JKQTAnnotationsSpecificStyleProperties: public JKQTGeometricSpecificStyleProperties {
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
JKQTAnnotationsSpecificStyleProperties(const JKQTBasePlotterStyle& parent);
JKQTAnnotationsSpecificStyleProperties(const JKQTBasePlotterStyle& parent, const JKQTGraphsSpecificStyleProperties& other);
JKQTAnnotationsSpecificStyleProperties(const JKQTAnnotationsSpecificStyleProperties& other)=default;
@ -198,7 +205,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTGraphsSpecificStyleProperties {
QString defaultFontName;
};
};
@ -208,7 +215,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTGraphsSpecificStyleProperties {
* \see JKQTBasePlotter, \ref jkqtpplotter_styling
*/
class JKQTPLOTTER_LIB_EXPORT JKQTGraphsBaseStyle {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
JKQTGraphsBaseStyle(const JKQTBasePlotterStyle& parent);

View File

@ -30,6 +30,7 @@
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtplotter/jkqtpbaseplotter.h"
#include "jkqtcommon/jkqtpdrawingtools.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
class JKQTPlotter; // forward
@ -118,10 +119,12 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphLineStyleMixin {
QColor getHighlightingLineColor() const;
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_PROPERTY(QColor highlightingLineColor MEMBER m_highlightingLineColor READ getHighlightingLineColor WRITE setHighlightingLineColor)
Q_PROPERTY(QColor lineColor MEMBER m_lineColor READ getLineColor WRITE setLineColor)
Q_PROPERTY(Qt::PenStyle lineStyle MEMBER m_lineStyle READ getLineStyle WRITE setLineStyle)
Q_PROPERTY(double lineWidth MEMBER m_lineWidth READ getLineWidth WRITE setLineWidth)
#endif
private:
/** \brief graph line pen */
QPen m_linePen;
@ -156,7 +159,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphLineStyleMixin {
\see JKQTPGraphDecoratedLineStyleMixin for a Mix-In for both ends
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGraphDecoratedHeadLineStyleMixin: public JKQTPGraphLineStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class constructor */
JKQTPGraphDecoratedHeadLineStyleMixin();
@ -183,8 +188,10 @@ public:
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_PROPERTY(JKQTPLineDecoratorStyle headDecoratorStyle MEMBER m_headDecoratorStyle READ getHeadDecoratorStyle WRITE setHeadDecoratorStyle)
Q_PROPERTY(double headDecoratorSizeFactor MEMBER m_headDecoratorSizeFactor READ getHeadDecoratorSizeFactor WRITE setHeadDecoratorSizeFactor)
#endif
private:
/** \brief head decorator style */
JKQTPLineDecoratorStyle m_headDecoratorStyle;
@ -207,7 +214,9 @@ private:
\see JKQTPGraphDecoratedHeadLineStyleMixin for a Mix-In for one end (head) only
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGraphDecoratedLineStyleMixin: public JKQTPGraphLineStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class constructor */
JKQTPGraphDecoratedLineStyleMixin();
@ -247,10 +256,12 @@ public:
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_PROPERTY(JKQTPLineDecoratorStyle headDecoratorStyle MEMBER m_headDecoratorStyle READ getHeadDecoratorStyle WRITE setHeadDecoratorStyle)
Q_PROPERTY(JKQTPLineDecoratorStyle tailDecoratorStyle MEMBER m_tailDecoratorStyle READ getTailDecoratorStyle WRITE setTailDecoratorStyle)
Q_PROPERTY(double headDecoratorSizeFactor MEMBER m_headDecoratorSizeFactor READ getHeadDecoratorSizeFactor WRITE setHeadDecoratorSizeFactor)
Q_PROPERTY(double tailDecoratorSizeFactor MEMBER m_tailDecoratorSizeFactor READ getTailDecoratorSizeFactor WRITE setTailDecoratorSizeFactor)
#endif
private:
/** \brief head decorator style */
JKQTPLineDecoratorStyle m_headDecoratorStyle;
@ -278,7 +289,9 @@ private:
.
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGraphSymbolStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class constructor */
JKQTPGraphSymbolStyleMixin();
@ -314,11 +327,13 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphSymbolStyleMixin {
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_PROPERTY(JKQTPGraphSymbols symbolType MEMBER m_symbolType READ getSymbolType WRITE setSymbolType)
Q_PROPERTY(QColor symbolColor MEMBER m_symbolColor READ getSymbolColor WRITE setSymbolColor)
Q_PROPERTY(QColor symbolFillColor MEMBER m_symbolFillColor READ getSymbolFillColor WRITE setSymbolFillColor)
Q_PROPERTY(double symbolSize MEMBER m_symbolSize READ getSymbolSize WRITE setSymbolSize)
Q_PROPERTY(double symbolLineWidth MEMBER m_symbolLineWidth READ getSymbolLineWidth WRITE setSymbolLineWidth)
#endif
private:
/** \brief which symbol to use for the datapoints */
JKQTPGraphSymbols m_symbolType;
@ -393,7 +408,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphSymbolStyleMixin {
.
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGraphFillStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class constructor */
JKQTPGraphFillStyleMixin();
@ -434,8 +451,10 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphFillStyleMixin {
/** \brief sets a fill transformation */
void setFillTransform(const QTransform& b);
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_PROPERTY(Qt::BrushStyle fillStyle MEMBER m_fillStyle READ getFillStyle WRITE setFillStyle)
Q_PROPERTY(QColor fillColor MEMBER m_fillColor READ getFillColor WRITE setFillColor)
#endif
/** \brief constructs a QBrush from the graph fill styling properties */
QBrush getFillBrush(JKQTPEnhancedPainter &painter, JKQTBasePlotter* parent) const;
@ -453,7 +472,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphFillStyleMixin {
* \ingroup jkqtplotter_basegraphs_stylemixins
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGraphLineAndFillStyleMixin: public JKQTPGraphFillStyleMixin, public JKQTPGraphLineStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class constructor */
JKQTPGraphLineAndFillStyleMixin();
@ -473,8 +494,10 @@ public:
bool doFillCurve() const;
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_PROPERTY(bool drawLine MEMBER m_drawLine READ getDrawLine WRITE setDrawLine)
Q_PROPERTY(bool fillCurve MEMBER m_fillCurve READ getFillCurve WRITE setFillCurve)
#endif
private:
/** \brief indicates whether to draw a line on the circumference of the described area (i.e. along the data points from \c xColumn and \c yColumn as well as \c xColumn and \c yColumn2 or not */
bool m_drawLine;
@ -494,7 +517,9 @@ private:
.
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPGraphTextStyleMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
/** \brief class constructor */
JKQTPGraphTextStyleMixin(JKQTBasePlotter *parent);
@ -521,9 +546,11 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPGraphTextStyleMixin {
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_PROPERTY(QColor textColor MEMBER m_textColor READ getTextColor WRITE setTextColor)
Q_PROPERTY(double textFontSize MEMBER m_textFontSize READ getTextFontSize WRITE setTextFontSize)
Q_PROPERTY(QString textFontName MEMBER m_textFontName READ getTextFontName WRITE setTextFontName)
#endif
private:
/** \brief color of the text */
QColor m_textColor;

View File

@ -26,6 +26,7 @@
#include <QStringList>
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtcommon/jkqtpbasicimagetools.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
#include <cmath>
#include <cfloat>
#include <stdint.h>
@ -41,7 +42,9 @@ class JKQTBasePlotter; // forward
\ingroup jkqtplotter_imagelots_tools
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPColorPaletteStyleAndToolsMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:
JKQTPColorPaletteStyleAndToolsMixin(JKQTBasePlotter *parent);
@ -251,7 +254,9 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPColorPaletteStyleAndToolsMixin {
\ingroup jkqtplotter_imagelots_tools
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPColorPaletteWithModifierStyleAndToolsMixin : public JKQTPColorPaletteStyleAndToolsMixin {
Q_GADGET
#ifndef JKQTPLOTTER_WORKAROUND_QGADET_BUG
Q_GADGET
#endif
public:

View File

@ -22,6 +22,7 @@
#include "jkqtplotter/jkqtptools.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
#include <QColor>
#include <QString>
#include <QSettings>

View File

@ -21,6 +21,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGlobal>
/*! \def JKQTPLOTTER_COMPILE_WITHOUT_PRINTSUPPORT
\ingroup jkqtpplottersupprt
@ -44,7 +45,14 @@
# endif
#endif
#if defined(Q_CC_CLANG) && (QT_VERSION < QT_VERSION_CHECK(7, 0, 0))
# define JKQTPLOTTER_WORKAROUND_QGADET_BUG
# warning("deactivating some Q_GADGET-declarations due to a bug in Qt on CLANG: https://bugreports.qt.io/browse/QTBUG-104874")
#else
# ifdef JKQTPLOTTER_WORKAROUND_QGADET_BUG
# undef JKQTPLOTTER_WORKAROUND_QGADET_BUG
# endif
#endif
#endif // JKQTPLOTTER_CONFIGMACROS_H

View File

@ -22,6 +22,7 @@
#include "jkqtplotter/jkqtptools.h"
#include "jkqtplotter/jkqtplotter_imexport.h"
#include "jkqtplotter/jkqtplotter_configmacros.h"
#include <QColor>
#include <QPainter>
#include <QString>