How to add picture graphic image to gui qtpyvcp

More
5 years 9 months ago #195404 by aleksamc
I want to add some help picture to gui linuxcnc in pyqtvcp.
I add it to recources file. Inside resources file I have
Code:
<RCC> <qresource lang="all" prefix="images"> <file>help_stone.png</file> </qresource> </RCC>

I tried 2 methods with Label:
1) In QSS stylesheet:
Code:
image: url(/":/images/help_stone.png");
2) Rigth bottom press on label > Change rich text > chouse picture

Both ways picture adds to QT Designer and it seen. But When I run linuxcnc, place where picture should be is blank.
What I do wrong? I see other configurations has picture and they are even can rotate (for example tool change), but I'm stuck on so basic problem:side:

Please Log in to join the conversation.

More
5 years 9 months ago #196129 by aleksamc
It's realy nobody knows what problem is?
I saw a lot of QtPyVCP guis and they had graphic, I don't know what I'm doing wrong.

Please Log in to join the conversation.

More
5 years 9 months ago #196143 by Lcvette

aleksamc wrote: It's realy nobody knows what problem is?
I saw a lot of QtPyVCP guis and they had graphic, I don't know what I'm doing wrong.

adding graphics requires the graphics to be in a directory specified for images with the correct path, you also need to add the image file path to the .qrc file, then you need to compile.

Attachment not found



Attachment not found



Attachment not found

Please Log in to join the conversation.

More
5 years 9 months ago #196439 by aleksamc
Unfortunatly doesn't work:
I wrote in terminal:

qcompile stonecnc
Compiling .ui files in package 'stonecnc':
mainwindow.ui => mainwindow_ui.py ... ok

Compiling .qrc files in package 'stonecnc':
resources.qrc => resources_rc.py ... ok


My file qrc

Attachment not found


Attachment not found



But when I run linuxcnc I don't see any picture. Could be problem with Language settings?

Please Log in to join the conversation.

More
5 years 9 months ago #196603 by Lcvette

aleksamc wrote: Unfortunatly doesn't work:
I wrote in terminal:

qcompile stonecnc
Compiling .ui files in package 'stonecnc':
mainwindow.ui => mainwindow_ui.py ... ok

Compiling .qrc files in package 'stonecnc':
resources.qrc => resources_rc.py ... ok


My file qrc

Attachment not found


Attachment not found



But when I run linuxcnc I don't see any picture. Could be problem with Language settings?


hmmm, not sure it should be working, how are you inserting the image into the ui?

Please Log in to join the conversation.

More
5 years 8 months ago #197479 by aleksamc
I use QLabel, then I change it's QSS an there I add image: url(":/images/help_stone.png".
I explained it in the 1-st topic.

Please Log in to join the conversation.

More
5 years 8 months ago #197519 by Lcvette
you need to place the label where you want it, then select it and in the property editor under QLabel/test/pixmap there is a drop down manu, select "choose resource" then in the new window that opens click on images, then select your image and click OK should be there, then you shouod run . qcompile and check your ui it should be there!

Please Log in to join the conversation.

More
5 years 8 months ago #197533 by aleksamc
I think you will not believe me, but I did everything as you said. And I see image in qtdevelopper, and compilling finished witout errors. But linuxcnc still opens with blank image.

Please Log in to join the conversation.

More
5 years 8 months ago #197553 by Lcvette
I just tested and it is working, im not sure why yours is not? what version of qtpyvcp do you have installed?

Please Log in to join the conversation.

More
5 years 8 months ago #197706 by aleksamc
In Qt Designer is evrything fine, I see picture well.
But in Linuxcnc it's blank.
So linuxcnc is 2.8.1 version
and QtDesigner version is 5.11.3 as same as Qt.
All plugins are run except libpyqt5_py3.so

Could you add here some of yours picture that I could try to add and to see if problem is not in file?

Please Log in to join the conversation.

Time to create page: 0.126 seconds
Powered by Kunena Forum