This commit is contained in:
jkriege2 2023-10-25 13:43:48 +02:00
commit 536a6e6d92
3 changed files with 10 additions and 5 deletions

View File

@ -110,7 +110,7 @@ endif()
if(JKQtPlotter_BUILD_STATIC_LIBS) if(JKQtPlotter_BUILD_STATIC_LIBS)
add_library(${lib_name} STATIC ${SOURCES} ${HEADERS}) add_library(${lib_name} STATIC ${SOURCES} ${HEADERS})
JKQtCommon_setDefaultLibOptions(${lib_name}) JKQtCommon_setDefaultLibOptions(${lib_name})
target_link_libraries(${libsh_name} PUBLIC JKQTCommonLib) target_link_libraries(${lib_name} PUBLIC JKQTCommonLib)
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}") set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake
VERSION ${PROJECT_VERSION} VERSION ${PROJECT_VERSION}

View File

@ -1370,9 +1370,14 @@ void JKQTPlotter::resizeEvent(QResizeEvent *event) {
sizeChanged=true; sizeChanged=true;
} }
if (sizeChanged) { if (sizeChanged) {
if (jkqtp_RESIZE_DELAY == 0) {
// Do this now
delayedResizeEvent();
} else {
resizeTimer.setSingleShot(true); resizeTimer.setSingleShot(true);
resizeTimer.start(jkqtp_RESIZE_DELAY); resizeTimer.start(jkqtp_RESIZE_DELAY);
} }
}
//updateGeometry(); //updateGeometry();
//qDebug()<<"resize DONE width()="<<width()<<" height()="<<height()<<" plotImageWidth="<<plotImageWidth<<" plotImageHeight="<<plotImageHeight<<" sizeChanged="<<sizeChanged<<"\n"; //qDebug()<<"resize DONE width()="<<width()<<" height()="<<height()<<" plotImageWidth="<<plotImageWidth<<" plotImageHeight="<<plotImageHeight<<" sizeChanged="<<sizeChanged<<"\n";

View File

@ -364,7 +364,7 @@ JKQTPLOTTER_LIB_EXPORT void initJKQTPlotterResources();
class JKQTPLOTTER_LIB_EXPORT JKQTPlotter: public QWidget { class JKQTPLOTTER_LIB_EXPORT JKQTPlotter: public QWidget {
Q_OBJECT Q_OBJECT
public: public:
/** \brief sets the global resize delay in milliseconds \a delayMS. After calling this function all plots will use the new delay. This function is thread-safe! /** \brief sets the global resize delay in milliseconds \a delayMS. After calling this function all plots will use the new delay. Setting the the delay to 0 disables the delayed resize feature. This function is thread-safe!
* *
* \see jkqtp_RESIZE_DELAY, setGlobalResizeDelay(), getGlobalResizeDelay(), resizeTimer */ * \see jkqtp_RESIZE_DELAY, setGlobalResizeDelay(), getGlobalResizeDelay(), resizeTimer */
static void setGlobalResizeDelay(int delayMS); static void setGlobalResizeDelay(int delayMS);
@ -1687,7 +1687,7 @@ class JKQTPLOTTER_LIB_EXPORT JKQTPlotter: public QWidget {
*/ */
QTimer resizeTimer; QTimer resizeTimer;
/** \brief delay for resizing in milliseconds /** \brief delay for resizing in milliseconds. If set to 0, resize delay is disabled and resizeTimer is unused.
* *
* \see jkqtp_RESIZE_DELAY, setGlobalResizeDelay(), getGlobalResizeDelay(), resizeTimer * \see jkqtp_RESIZE_DELAY, setGlobalResizeDelay(), getGlobalResizeDelay(), resizeTimer
*/ */