From 3a789250bec958578a5be255874ea64d5202ccde Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Fri, 21 Jul 2023 22:58:01 +0200 Subject: [PATCH] NEW: added variant of JKQTBasePlotter::setWidgetSize() which accepts QSize --- lib/jkqtplotter/jkqtpbaseplotter.cpp | 5 +++++ lib/jkqtplotter/jkqtpbaseplotter.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/lib/jkqtplotter/jkqtpbaseplotter.cpp b/lib/jkqtplotter/jkqtpbaseplotter.cpp index 4a76ce0c01..bae96c26c1 100644 --- a/lib/jkqtplotter/jkqtpbaseplotter.cpp +++ b/lib/jkqtplotter/jkqtpbaseplotter.cpp @@ -506,6 +506,11 @@ void JKQTBasePlotter::setWidgetSize(int wid, int heigh) { redrawPlot(); } +void JKQTBasePlotter::setWidgetSize(QSize size) +{ + setWidgetSize(size.width(), size.height()); +} + int JKQTBasePlotter::getWidth() { return widgetWidth; } diff --git a/lib/jkqtplotter/jkqtpbaseplotter.h b/lib/jkqtplotter/jkqtpbaseplotter.h index 1473300600..78a3bc4af6 100644 --- a/lib/jkqtplotter/jkqtpbaseplotter.h +++ b/lib/jkqtplotter/jkqtpbaseplotter.h @@ -1535,6 +1535,13 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject { * \see \ref jkqtplotter_base_plotsize */ void setWidgetSize(int width, int height); + /** \brief resize the plot + * + * \image html plot_widget_orientation.png + * + * \see \ref jkqtplotter_base_plotsize + */ + void setWidgetSize(QSize size); /** \brief sets the width of the plot widget *