From: <and...@us...> - 2011-11-24 20:09:22
|
Revision: 12037 http://plplot.svn.sourceforge.net/plplot/?rev=12037&view=rev Author: andrewross Date: 2011-11-24 20:09:15 +0000 (Thu, 24 Nov 2011) Log Message: ----------- Fix a couple of minor issues in the C++ examples where the C API was used rather than the C++ wrapper class. Modified Paths: -------------- trunk/examples/c++/x17.cc trunk/examples/c++/x20.cc trunk/examples/c++/x21.cc trunk/examples/c++/x30.cc Modified: trunk/examples/c++/x17.cc =================================================================== --- trunk/examples/c++/x17.cc 2011-11-24 19:20:27 UTC (rev 12036) +++ trunk/examples/c++/x17.cc 2011-11-24 20:09:15 UTC (rev 12037) @@ -163,7 +163,7 @@ # endif #endif t = (double) n * dt; - noise = plrandd() - 0.5; + noise = pls->randd() - 0.5; y1 = y1 + noise; y2 = sin( t * M_PI / 18. ); y3 = y2 * noise; Modified: trunk/examples/c++/x20.cc =================================================================== --- trunk/examples/c++/x20.cc 2011-11-24 19:20:27 UTC (rev 12036) +++ trunk/examples/c++/x20.cc 2011-11-24 20:09:15 UTC (rev 12037) @@ -335,7 +335,7 @@ } } - pls->imagefr( img_f, width, height, 0., width, 0., height, 0., 0., img_min, img_max, pltr2, &cgrid2 ); + pls->imagefr( img_f, width, height, 0., width, 0., height, 0., 0., img_min, img_max, pls->tr2, &cgrid2 ); pls->Free2dGrid( cgrid2.xg, width + 1, height + 1 ); pls->Free2dGrid( cgrid2.yg, width + 1, height + 1 ); Modified: trunk/examples/c++/x21.cc =================================================================== --- trunk/examples/c++/x21.cc 2011-11-24 19:20:27 UTC (rev 12036) +++ trunk/examples/c++/x21.cc 2011-11-24 20:09:15 UTC (rev 12037) @@ -300,7 +300,7 @@ pls->col0( 15 ); pls->lab( "X", "Y", title[alg - 1] ); pls->shades( zg, xp, yp, NULL, xm, xM, ym, yM, - clev, nl, 1, 0, 1, plfill, true, NULL, NULL ); + clev, nl, 1, 0, 1, pls->fill, true, NULL, NULL ); pls->col0( 2 ); } else Modified: trunk/examples/c++/x30.cc =================================================================== --- trunk/examples/c++/x30.cc 2011-11-24 19:20:27 UTC (rev 12036) +++ trunk/examples/c++/x30.cc 2011-11-24 20:09:15 UTC (rev 12037) @@ -177,7 +177,7 @@ py[2] = 1.; py[3] = 1.; - plgradient( 4, px, py, 90. ); + pls->gradient( 4, px, py, 90. ); delete pls; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2014-03-15 21:06:56
|
Revision: 13062 http://sourceforge.net/p/plplot/code/13062 Author: andrewross Date: 2014-03-15 21:06:52 +0000 (Sat, 15 Mar 2014) Log Message: ----------- Changes to qt_example so it works (in the build tree) with Qt5. Still need to fix the install tree case. Modified Paths: -------------- trunk/examples/c++/CMakeLists.txt trunk/examples/c++/qt_PlotWindow.h Modified: trunk/examples/c++/CMakeLists.txt =================================================================== --- trunk/examples/c++/CMakeLists.txt 2014-03-15 20:23:02 UTC (rev 13061) +++ trunk/examples/c++/CMakeLists.txt 2014-03-15 21:06:52 UTC (rev 13062) @@ -142,14 +142,17 @@ target_link_libraries(wxPLplotDemo plplotwxwidgets${LIB_TAG} plplotcxx${LIB_TAG} ${wxwidgets_LINK_FLAGS} ${MATH_LIB}) endif(ENABLE_wxwidgets) -## FIXME for the case when PLPLOT_USE_QT5 is ON. - if(ENABLE_qt AND NOT PLPLOT_USE_QT5) + if(ENABLE_qt) if(CORE_BUILD) set(BUILD_qt_example ON) - if(NOT QT_LIBRARIES) + if(NOT PLPLOT_USE_QT5 AND NOT QT_LIBRARIES) message(FATAL_ERROR "include(${QT_USE_FILE}) failed in core build examples/c++ subdirectory.") - endif(NOT QT_LIBRARIES) + endif(NOT PLPLOT_USE_QT5 AND NOT QT_LIBRARIES) else(CORE_BUILD) + if(PLPLOT_USE_QT5) + message(STATUS "WARNING: Not currently checking for Qt5 in install tree. qt_example not built") + set(BUILD_qt_example OFF) + else(PLPLOT_USE_QT5) # Must find Qt4 all over again here rather than simply copying variables # from the core build to this installed examples build so that we can # access the qt4_wrap_cpp macro here. @@ -166,8 +169,22 @@ message(STATUS "WARNING: Qt4 not found or wrong version. qt_example not built") set(BUILD_qt_example OFF) endif(QT4_FOUND AND QT_VERSION_MAJOR STREQUAL "${CORE_QT_VERSION_MAJOR}" AND QT_VERSION_MINOR STREQUAL "${CORE_QT_VERSION_MINOR}" AND QT_VERSION_PATCH STREQUAL "${CORE_QT_VERSION_PATCH}") + endif(PLPLOT_USE_QT5) endif(CORE_BUILD) if(BUILD_qt_example) + if(PLPLOT_USE_QT5) + qt5_wrap_cpp( + QT_MOC_OUTFILES + ${CMAKE_CURRENT_SOURCE_DIR}/qt_PlotWindow.h + ) + set_source_files_properties( + ${QT_MOC_OUTFILES} + PROPERTIES GENERATED "ON" + ) + add_executable(qt_example qt_example.cpp qt_PlotWindow.cpp ${QT_MOC_OUTFILES}) + qt5_use_modules(qt_example Svg Gui PrintSupport) + target_link_libraries(qt_example ${QT_LIBRARIES} plplotqt${LIB_TAG} plplot${LIB_TAG} ${qt_example_TARGETS}) + else(PLPLOT_USE_QT5) qt4_wrap_cpp( QT_MOC_OUTFILES ${CMAKE_CURRENT_SOURCE_DIR}/qt_PlotWindow.h @@ -181,6 +198,7 @@ target_link_libraries(qt_example ${QT_LIBRARIES} plplotqt${LIB_TAG} plplot${LIB_TAG}) # Update the target COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES set_qt_target_properties(qt_example) + endif(PLPLOT_USE_QT5) endif(BUILD_qt_example) - endif(ENABLE_qt AND NOT PLPLOT_USE_QT5) + endif(ENABLE_qt) endif(BUILD_TEST) Modified: trunk/examples/c++/qt_PlotWindow.h =================================================================== --- trunk/examples/c++/qt_PlotWindow.h 2014-03-15 20:23:02 UTC (rev 13061) +++ trunk/examples/c++/qt_PlotWindow.h 2014-03-15 21:06:52 UTC (rev 13062) @@ -28,14 +28,14 @@ #define PLD_qtwidget -#include <QtGui/QApplication> -#include <QtGui/QMainWindow> -#include <QtGui/QAction> -#include <QtGui/QMenuBar> -#include <QtGui/QFileDialog> -#include <QtGui/QPrintDialog> -#include <QtGui/QPrinter> -#include <QtGui/QMessageBox> +#include <QApplication> +#include <QMainWindow> +#include <QAction> +#include <QMenuBar> +#include <QFileDialog> +#include <QPrintDialog> +#include <QPrinter> +#include <QMessageBox> #include "qt.h" class PlotWindow : public QMainWindow This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |