The path you use begins with ":/". It seems to be a Qt resource path.
The current version of ChartDirector supports only file system paths (that is, the type of path you use to load a file from the hard disk). In our sample code, we usually put the image files in the same directory as the EXE and just use "ECG_Paper.png" as the path name.
The next minor release of ChartDirector (version 6.3) will support resources, including Qt resources. The updated DLL are mostly completely and we are now developing the sample code and documentation. If you would like to use Qt resources, I can ask our developer to send you the new DLL so you can use Qt resource paths.
thank you , but for pushbutton icon I use qt path and it's work
instead of this
QPushButton *pointerPB = new QPushButton(QIcon(":/pointer.png"), "Pointer", frame);
I use this
QPushButton *pointerPB = new QPushButton(QIcon(":/new/prefix1/pointer.png"), "Pointer", frame);
realtimezoomscroll has resource file, I think we can copy the path in qt!
I put the image files in the same directory as the EXE and program file
but when run the chart background doesn't change
I use the right command to change the chart background? is it in the right place?
I tried myself, and found that in my Qt on Windows, the "Qt Creator" will put the "realtimezoomscroll.exe" in a directory "build-realtimezoomscroll-Desktop_Qt_5_6_0_MinGW_32bit-Debug". So if the code is run in the "Qt Creator", the image file "ECG_Paper.png" would need to be in that directory too.
I have modified the Qt project file "realtimezoomscroll.pro" so that the "Qt Creator" will now put the "realtimezoomscroll.exe" in the same directory as the source code (that is, in the "realtimezoomscroll" directory). In this way, you can just put the "ECG_Paper.png" in the source code directory. I have attached the entire modified "realtimezoomscroll" Qt project for your reference, with the code modified to include a wallpaper. Please download it to try it. (Use the files inside to replace the files in the original "realtimezoomscroll" sample code.)
For the Qt resource path, it is supported by controls that come with Qt, such as QPushButton and QIcon. ChartDirector is a third party control, and the current version does not support Qt resource. If you want to use Qt resource, I can ask our developer to send the DLL for the next version to you, which supports Qt resources.
Thank you for your response ,It's worked but it's change the window background
I want to change the chart background (its from light blue to sky blue in default)
I asked before `I use the right command to change the chart background` ?Misunderstanding has happened!
I did not say it clearly! sorry!