You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/gui/qtvcp-vcp-panels.adoc
+71Lines changed: 71 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -305,4 +305,75 @@ start
305
305
<1> In this case we load `qtvcp` using *`-Wn`* which waits for the panel to finish loading before continuing to run the next HAL command. +
306
306
This is to _ensure that the panel created HAL pins are actually done_ in case they are used in the rest of the file.
307
307
308
+
== Embedding QtVCP Virtual Control Panels into QtVCP Screens
309
+
Qtvcp panels can be embedded into most Qtvcp screens and avoids problems such as focus transferring that can be a problem in non-native embedding.
310
+
311
+
=== Embedding Commands
312
+
A typical screen such as QtDragon will search the INI file under the heading [DISPLAY] for commands to embed a panel.
313
+
314
+
[source,{ini}]
315
+
----
316
+
[DISPLAY]
317
+
EMBED_TAB_NAME=Embedding demo
318
+
EMBED_TAB_COMMAND=qtvcp simple_hal
319
+
EMBED_TAB_LOCATION=tabWidget_utilities
320
+
----
321
+
322
+
*'EMBED_TAB_NAME'*:: will typically be the title of the tab.
323
+
*'EMBED_TAB_LOCATION'*:: will be specific to the screen and specifies the tabWidget or stackedWidget to embed into.
324
+
*'EMBED_TAB_COMMAND'*:: is the command used to invoke loading of the panel. For native embedded panels the first word will always be 'qtvcp', the second will be the panel to load. You cannot currently add any switches to the command line. The panel will follow the debugging mode setting of the main screen.
325
+
326
+
=== Location of builtin Panels
327
+
There are panels available that are included with linuxcnc. To see a list open a terminal and type 'qtvcp' and press return. +
328
+
You will get a help printout and a list of builtin screen and panels. +
329
+
Pick any of the names from the panel list and add that to the COMMAND entry after 'qtvcp'. +
330
+
The builtin panel search path is 'share/qtvcp/panels/PANELNAME'. +
331
+
Run-In-Place and installed versions of linuxcnc have these in different locations on the system.
332
+
333
+
=== Location of Custom Panels
334
+
Custom panels can be embedded too -either a modified builtin panel or a new user-built one. +
335
+
When loading panels, QtVCP looks in the configuration folders path for 'qtvcp/panels/PANELNAME/PANELNAME.ui'. +
336
+
'PANNELNAME' being any valid string with no spaces. If no path is found there, then looks in the builtin file path. +
337
+
QtVCP will do the same process for the optional handler file: 'qtvcp/panels/PANELNAME/PANELNAME_handler.py'
338
+
339
+
=== Handler Programming Tips
340
+
In a screen handler file, the reference used for the window is 'self.w'. +
341
+
In QtVCP panels, that reference will refers to the panel's window. +
342
+
To reference the main window use 'self.w.MAIN'
343
+
If your panel is to be able to run independently and embedded, you must trap errors from referencing objects not available.
344
+
(ie main screen objects are not available in an independent panel.)
345
+
346
+
eg. This would use the panels preference file if there is one.
0 commit comments