ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Unable to load a PNG icon from a Qt resource
Posted by DC Kelley on Jul-23-2019 00:54
When creating an logo/icon using Qt 5.9 and CDML ( Chart Director Markup Language ) it works fine with an external file specification in the normal way.  But I cannot seem to get to to work when pointing to any internal file resources for the project/program.

The two commented-out lines show what does not work as expected.  In deployment use we need to point to the bundled resource.  Can you provide an example of how to pass this type of Qt resource into CDML ?

QString iconText = "<*img=C:/icon.png*>";
//    iconText = "<*img=qrc:/icon/icon.png*>";
//    iconText = "<*img=:/icon/icon.png*>";
c->addText( (int)(c->getWidth()  - 32),
                  (int)(71),
                  (const char *)iconText.toLatin1(), "", 8,
                  Chart::TextColor, Chart::Center, 0, false);

  Re: Unable to load a PNG icon from a Qt resource
Posted by Peter Kwan on Jul-23-2019 04:02
Hi DC Kelley,

ChartDirector 6.3 or above supports resources, including Qt resources. See:

https://www.advsofteng.com/doc/cdcpp.htm#pathspec.htm

ChartDirector supports multiple programming languages and environments. For C++, it supports the Qt resource system and also the Windows resource system. For this reason, ChartDirector uses its own resource syntax which can support in different languages and environments. The syntax is:

QString iconText = "<*img=@/icon/icon.png*>";

The sample code that comes with ChartDirector 6.3 uses Qt resources for icons and images. For example, the "Icon Pie Chart" sample code (in the iconpie function in qtdemoqtdemodemocharts.cpp) uses Qt resources for the icons, and the icons are used in CDML.

Note that to use Qt resources, the ChartDirector DLL and header files must come from ChartDirector 6.3 or above. For Qt, the QChartViewer.cpp and QChartViewer.h must also come from ChartDirector 6.3 or above.

Hope this can help.

Regards
Peter Kwan

  Re: Unable to load a PNG icon from a Qt resource
Posted by DCKelley on Jul-23-2019 22:55
Thanks Peter.  That's the issue, we are using CD 6.0.1.0 here, will see what we need to do to move to 6.3 then in the next general release.


hausfrauen porno tube