diff --git a/lib/jkqtplotter/jkqtplotter.cpp b/lib/jkqtplotter/jkqtplotter.cpp index 5857c8ab7b..faf01f7643 100644 --- a/lib/jkqtplotter/jkqtplotter.cpp +++ b/lib/jkqtplotter/jkqtplotter.cpp @@ -32,8 +32,17 @@ #include "jkqtplotter.h" -#define jkqtp_RESIZE_DELAY 100 +int JKQTPlotter::jkqtp_RESIZE_DELAY = 100; +void JKQTPlotter::setGlobalResizeDelay(int delayMS) +{ + jkqtp_RESIZE_DELAY=delayMS; +} + +int JKQTPlotter::getGlobalResizeDelay() +{ + return jkqtp_RESIZE_DELAY; +} @@ -42,6 +51,7 @@ /************************************************************************************************************************** * JKQTPlotter **************************************************************************************************************************/ + JKQTPlotter::JKQTPlotter(bool datastore_internal, QWidget* parent, JKQTPDatastore* datast): QWidget(parent, Qt::Widget), currentMouseDragAction(), @@ -1348,6 +1358,11 @@ QSize JKQTPlotter::sizeHint() const { return QWidget::sizeHint(); } +bool JKQTPlotter::isResizeTimerRunning() const +{ + return resizeTimer.isActive(); +} + void JKQTPlotter::synchronizeToMaster(JKQTPlotter *master, JKQTBasePlotter::SynchronizationDirection synchronizeDirection, bool synchronizeAxisLength, bool synchronizeZoomingMasterToSlave, bool synchronizeZoomingSlaveToMaster) { if (masterPlotterX) disconnect(masterPlotterX->getPlotter(), SIGNAL(plotScalingRecalculated()), this, SLOT(masterPlotScalingRecalculated())); diff --git a/lib/jkqtplotter/jkqtplotter.h b/lib/jkqtplotter/jkqtplotter.h index abee1272df..805be709bd 100644 --- a/lib/jkqtplotter/jkqtplotter.h +++ b/lib/jkqtplotter/jkqtplotter.h @@ -441,6 +441,15 @@ JKQTPLOTTER_LIB_EXPORT void initJKQTPlotterResources(); class JKQTPLOTTER_LIB_EXPORT JKQTPlotter: public QWidget { Q_OBJECT public: + /** \brief sets the global resize delay in milliseconds \a delayMS. After calling this function all plots will use the new delay + * + * \see jkqtp_RESIZE_DELAY, setGlobalResizeDelay(), getGlobalResizeDelay(), resizeTimer */ + static void setGlobalResizeDelay(int delayMS); + /** \brief returns the currently set global resize delay in milliseconds \a delayMS. + * + * \see jkqtp_RESIZE_DELAY, setGlobalResizeDelay(), getGlobalResizeDelay(), resizeTimer */ + static int getGlobalResizeDelay(); + /** \brief class constructor * * If \a datastore_internal \c ==false, you can supply an external JKQTPDatastore with the parameter \a datast @@ -553,6 +562,10 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPlotter: public QWidget { /** \brief returns the size of the widget */ QSize sizeHint() const; + /** \brief returns \c true, if the JKQTPlotter::resizeTimer is currently running and the widget is waiting for the resize-event to finish + * + * \see jkqtp_RESIZE_DELAY, setGlobalResizeDelay(), getGlobalResizeDelay(), resizeTimer */ + bool isResizeTimerRunning() const; @@ -1693,9 +1706,17 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPlotter: public QWidget { * \see delayedResizeEvent() * * \image html jkqtplotter_fastresizing.gif + * + * \see jkqtp_RESIZE_DELAY, setGlobalResizeDelay(), getGlobalResizeDelay(), resizeTimer */ QTimer resizeTimer; + /** \brief delay for resizing in milliseconds + * + * \see jkqtp_RESIZE_DELAY, setGlobalResizeDelay(), getGlobalResizeDelay(), resizeTimer + */ + static int jkqtp_RESIZE_DELAY; + /** \brief destroys the internal contextMenu and optionally creates a new one * * \param createnew if \c ==true, contextMenu is reinitialized with a (shiny) new QMenu,