Hi all,
First, well done to the authors of the library, I'm impressed by its quality.
I've been using the library on a Windows CE 6 device and QT 4.8, without RTTI support. Because of this, I couldn't cross compile the library, as the dynamic_cast operator is not supported in my setup. I've found a workaround solution that may be useful for other people. I'm using version 1.0.0-beta, downloaded on July 11 2013.
I'm using virtual functions in order to replace the dynamic_cast
, as described in http://thewayofc.blogspot.ie/2007/09/alternative-ways-to-implement-downcasts.html.
I performed the following modifications:
qcustomplot.h:
class QCP_LIB_DECL QCPItemAnchor { public: ... virtual QCPItemPosition* isQCPItemPosition() { return 0; } ... }; ... class QCP_LIB_DECL QCPItemPosition : public QCPItemAnchor { public: ... virtual QCPItemPosition* isQCPItemPosition() { return this; } ... };
qcustomplot.cpp:
// Replace line: //if (QCPItemPosition *currentParentPos = dynamic_cast<QCPItemPosition*>(currentParent)) // by: if (QCPItemPosition *currentParentPos = currentParent->isQCPItemPosition())
Hope this helps someone.
The plot examples work perfectly on my Desktop machine.
For some reason examples 10 and 15 do not work properly on Windows CE, not sure why yet (cannot remote-debug). Any suggestion regarding this would be appreciated :)
Antony