Generating a own Popup

More
9 months 2 weeks ago #341487 by cmorley
Replied by cmorley on topic Generating a own Popup
Ok it doesn't matter, this works in master or 2.9

Add the file to qtvcp/screens/qtdragon/ it will be in your configuration folder.
name the file qtdragon_handler.py

Then in your ini add this under the [DISPLAY] heading (this is an example):

# optional tab showing an external qtvcp panel
EMBED_TAB_NAME=Vismach demo
EMBED_TAB_COMMAND=qtvcp vismach_mill_xyz
EMBED_TAB_LOCATION=DIALOG

The key thing is the location: DIALOG will make the panel be a popup dialog.
You will see an arrow button show on the top right of qtdragon.
pushing it will toggle the dialog. There is also a HAL pin you could use to do the same.



 

Please Log in or Create an account to join the conversation.

More
9 months 2 weeks ago #341488 by cmorley
Replied by cmorley on topic Generating a own Popup
So to use a custom panel you have made in Qt designer.
Say the panel name will be 'test.ui'
save the panel in your configuration folder in qtvcp/panels/test/ as test.ui

then in the ini under [DISPLAY]

EMBED_TAB_NAME=demo
EMBED_TAB_COMMAND=qtvcp test
EMBED_TAB_LOCATION=DIALOG

please give feedback on any problems or needs.

Chris

Please Log in or Create an account to join the conversation.

More
9 months 2 weeks ago #341551 by DemonClaW
Replied by DemonClaW on topic Generating a own Popup
Dear Chris,

i wanna thank you for your help at first.Ive put your file in the given path under the name vacuum_popup_handler.py as i thought its a own handler data for the popup, qtdragon_hd_handler.py is already the main handler data for the whole programm or did you mean to add it in the main code? Then i did the EMBED Part like

DISPLAY = qtvcp -d qtdragon_hd
EMBED_TAB_NAME = vacuum_popup
EMBED_TAB_COMMAND = qtvcp vacuum_popup
EMBED_TAB_LOCATION = DIALOG

I think this is the way u meant it. Ive also safed the vacuum_popup.ui under qtvcp/panels/vacuum_popup/vacuum_popup.ui.Ive posted the crash code. It tells me a TypeError "Wrong base class"

Please Log in or Create an account to join the conversation.

More
9 months 1 week ago #341579 by cmorley
Replied by cmorley on topic Generating a own Popup
No, we are customizing qtdragon to load a panel as a pop up and add a button to launch/hide it.
So to add a custom panel you need to add both files to the appropriate folders as I described.

I would suggest you add the qtdragon_handler changes then change the INI to this:

EMBED_TAB_NAME=Vismach demo
EMBED_TAB_COMMAND=qtvcp vismach_mill_xyz
EMBED_TAB_LOCATION=DIALOG

and test.
start qttdragon, on the top left you should see a arrow button - pressing it should show/hide the window that has a 3d milling machine graphic.

if that works then move on to adding the ui and handler of your custom panel (in the described different location) and changing the INI to load it instead.

if there are error messages please quote them exactly.
If you post your vacuum_pimp ui and handler files, I could test them on my end too.

Please Log in or Create an account to join the conversation.

More
9 months 1 week ago #341649 by DemonClaW
Replied by DemonClaW on topic Generating a own Popup
First thing is that my data path isnt /usr/share anymore, instead some documentations told me to get the file seperated copyed into the machine folder, for me i got the base ui and handler there : /home/.../linuxcnc/configs/.../qtvcp/screens/qtdragon_hd/. The second thing is your talking about taking your file name it "qtdragon_hd_handler.py", if i go like that i would override the current base handler, that doesnt make sence to me. What i exactly did know is

-Rename ur .py data to vacuum_popup.py (using it as a second handler)
-Implement your 3 lines to .ini like that:
EMBED_TAB_NAME=vacuum_popup
EMBED_TAB_COMMAND=qtvcp vacuum_popup
EMBED_TAB_LOCATION=DIALOG
-/home/.../linuxcnc/configs/.../qtvcp/panels/vacuum_popup/ is the path where the ui would be

If i start then it seems like it load but it cant cant work with the class: Like you will see in the error code i attached as .txt

I feel kind of sorry but i really want to learn the things, even if the start is currently kind of hard. But your help is getting me confident i can make it.
Thanks for your help

 

Please Log in or Create an account to join the conversation.

More
9 months 1 week ago #341658 by cmorley
Replied by cmorley on topic Generating a own Popup
DId you modify the qtdragon ui and handler fikes is that why you copied
the original files? I don't think you told me that.
The qtdragon_handler file that I posted creates an addition to the original. But you can't do both, either you copy the whole file and modify them or you set the file to extend the original.

Let me know what you want to do.
The following user(s) said Thank You: tommylight, DemonClaW

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.336 seconds
Powered by Kunena Forum