Anyone have any UI modifying advice?

More
26 Oct 2023 18:12 #283875 by pferrick
Hi all,

I'm happy to report that I now have qtdragon configs copied and I'm able to modify them.   Here's what I've accomplished so far and where I'm a bit stuck on how to proceed:

1.  Editing the stylesheet - By changing the qss file (both within a running instance of qtvcp and separately) I've been able to modify lots of basic appearance stuff, like fonts, backgrounds etc.   That is a major step toward making qtdragon look the way I want it to.  

2.  Editing the UI file with QtDesigner - here's where things get a little weird.  I was hoping for a WYSIWYG editor, and while it sure beats hammering together Python/Gtk to create a GUI, it doesn't look much like the running qtvcp.  I'm assuming that this is because both the style sheet and the UI file have some influence on this, though it isn't clear to me how they are related.  Or maybe I don't have Designer installed correctly?

The bigger issue with using QtDesigner comes when I remove widgets that I do not need.  When I delete widgets, most of the time I get major complaints about code in the handler file or related Python.  For example, if I did not want a spindle speed slider and I delete it in QtD, all sorts of errors pop up.  I've tried commenting out offending lines in the handler file (that pertain to widget functions that no longer have a widget to respond to) but mostly that gets me really deep in the weeds...!   [Obviously part of the issue is my extremely underdeveloped Python skills!]

I'm hopeful that this approach can be made to work, though, because I'm positive that learning enough Qtvcp etc. to put together a completely custom (and functional) linuxcnc GUI from scratch would be a bit much at this point.

Anyone have any advice?  Thanks!
Patrick

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

More
27 Oct 2023 11:49 #283906 by pferrick
Thinking out loud here (maybe not the best idea in a public forum! But if anyone is on a similar quest, it might be helpful).

After another close read of the 'clean sheet QtVCP example' (linuxcnc.org/docs/html/gui/qtvcp.html) I've decided that I am going to try rolling my own linuxcnc GUI. Instead of trying to remove widgets from the qtdragon_hd ui (which is a lot more complicated than expected), I might as well buckle down and learn how to connect the (relatively few) HAL-ified qtvcp widgets I'm planning on using.

Between arranging widgets via QtDesigner and tweaking their appearance via stylesheets, I'm pretty sure I can at least get stuff looking the way I want. The real trick is going to be getting everything to 'do the right thing'. I'm hoping that by examining (and of course shamelessly copying) code from qtdragon_hd.py I can make it happen.

I have a feeling that some of the buttons (like the ones that control which tabs appear, or that change the view perspective) are going to fight back. And adding a probing tab that actually works should be lots of fun.

Wish me luck!

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

More
27 Oct 2023 16:16 #283911 by persei8
Generally, if you remove a widget in Designer, you want to remove all references to it in the handler and any other modules that refer to it. However, sometimes that widget is indirectly referenced, for example, if it's in a list and that list is used in an iterative loop. I know that sounds rather cryptic. I have found that people on this forum are generally very helpful if you post a specific problem.
Also, for stylesheets, I have been using qtsass . It makes creating and maintaining custom stylesheets much easier.
Jim
The following user(s) said Thank You: pferrick

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

More
27 Oct 2023 21:13 #283922 by cmorley
If you are going to build your own screen while learning qtvcp, I have a suggestion.
startoff by building the screen as a separate qtvcp panel.
then load linuxcnc with a default screen in the DISPLAY = section but also load your screen directly with qtvcp. (loadusr qtvcp -d PATH_T0_MY_SCREEN)

I did this a long time ago when building qtvcp. it allows you to use the working screen to do things that your development screen does not yet do.

I will be interested in your journey - we can update the docs as we discover helpful information.
The community is pretty good about help - just ask as specific questions as you can.
The following user(s) said Thank You: pferrick, tommylight, snowgoer540, onceloved

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

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