Skip to content

Commit c0cbde5

Browse files
committed
docs: port to PyQt6
1 parent c9ca98b commit c0cbde5

10 files changed

Lines changed: 41 additions & 41 deletions

docs/src/gui/filter-programs.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ for i in range(0,100):
9292
----
9393

9494
Here is a similar program but it actually could filter.
95-
It puts up a PyQt5 dialog with a cancel button.
95+
It puts up a PyQt6 dialog with a cancel button.
9696
Then it reads the program line by line and passes it to standard output.
9797
As it goes along, it updates any process listening to standard error output.
9898

@@ -104,9 +104,9 @@ import sys
104104
import os
105105
import time
106106
107-
from PyQt5.QtWidgets import (QApplication, QDialog, QDialogButtonBox,
107+
from PyQt6.QtWidgets import (QApplication, QDialog, QDialogButtonBox,
108108
QVBoxLayout,QDialogButtonBox)
109-
from PyQt5.QtCore import QTimer, Qt
109+
from PyQt6.QtCore import QTimer, Qt
110110
111111
class CustomDialog(QDialog):
112112

docs/src/gui/qtdragon.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,9 +1522,9 @@ It will be referred to as `_xx` in this document, so `qtdragon_xx.ts` in this do
15221522

15231523
The default locale for QtDragon is `_en` which means that any translation files created as `qtdragon_en.*` will not be used for translations.
15241524

1525-
If any of the required utilities (pyuic5, pylupdate5, linguist) are not installed then the user will need to install the required development tools:
1525+
If any of the required utilities (pyuic6, pylupdate6, linguist) are not installed then the user will need to install the required development tools:
15261526
----
1527-
sudo apt install qttools5-dev-tools pyqt5-dev-tools
1527+
sudo apt install qt6-tools-dev-tools pyqt6-dev-tools
15281528
----
15291529

15301530
Change to the languages directory:
@@ -1534,7 +1534,7 @@ cd ~/linuxcnc-dev/share/qtvcp/screens/qtdragon/languages
15341534

15351535
If any text changes have been made to the GUI then run the following to update the GUI Python file:
15361536
----
1537-
pyuic5 ../qtdragon.ui > qtdragon.py
1537+
pyuic6 ../qtdragon.ui > qtdragon.py
15381538
----
15391539

15401540
The user can either create a new translation source file for a non-existing language translation
@@ -1547,7 +1547,7 @@ Create or edit a .ts file:
15471547
----
15481548

15491549
[NOTE]
1550-
this command is a script which runs the following: $ pylupdate5 *.py ../*.py ../../../../../lib/python/qtvcp/lib/qtdragon/*.py -ts qtdragon_xx.ts
1550+
this command is a script which runs the following: $ pylupdate6 *.py ../*.py ../../../../../lib/python/qtvcp/lib/qtdragon/*.py -ts qtdragon_xx.ts
15511551

15521552
The editing of the translation is done with the linguist application:
15531553
----

docs/src/gui/qtvcp-code-snippets.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@ First we must import the libraries we need, if they're not already imported in t
563563
# **** IMPORT SECTION **** #
564564
############################
565565
566-
from PyQt5 import QtWidgets
567-
from PyQt5.QtGui import QColor
566+
from PyQt6 import QtWidgets
567+
from PyQt6.QtGui import QColor
568568
from qtvcp.widgets.state_led import StateLED as LED
569569
from qtvcp.core import Status, Info
570570
----
@@ -675,7 +675,7 @@ def make_corner_widgets(self):
675675
*`self.PREFS_`*:: the _instance of an optional preference file_
676676
*`self.SETTINGS_`*:: the `Qsettings` _object_
677677

678-
<5> Initializes a PyQt5 `QProgressBar`.
678+
<5> Initializes a PyQt6 `QProgressBar`.
679679
<6> Sets the max range of the progress bar to the max specified in the `INI`.
680680
<7> We create a QWidget +
681681
Since you can only add one widget to the tab corner and we want two there, we must add both into a *container*.

docs/src/gui/qtvcp-custom-widgets.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ This is where we import libraries that our widget class needs.
101101
###############################
102102
# Imports
103103
###############################
104-
from PyQt5 import QtWidgets # <1>
104+
from PyQt6 import QtWidgets # <1>
105105
from qtvcp.widgets.widget_baseclass \
106106
import _HalWidgetBase, _HalSensitiveBase # <2>
107107
import hal # <3>
@@ -171,7 +171,7 @@ This LED indicator widget will respond to selectable LinuxCNC controller states.
171171
###############################
172172
# Imports
173173
###############################
174-
from PyQt5.QtCore import pyqtProperty
174+
from PyQt6.QtCore import pyqtProperty
175175
from qtvcp.widgets.led_widget import LED
176176
from qtvcp.core import Status
177177
@@ -252,7 +252,7 @@ This is where we import libraries that our widget class needs.
252252
###############################
253253
# Imports
254254
###############################
255-
from PyQt5.QtCore import pyqtProperty # <1>
255+
from PyQt6.QtCore import pyqtProperty # <1>
256256
from qtvcp.widgets.led_widget import LED # <2>
257257
from qtvcp.core import Status # <3>
258258
----
@@ -457,9 +457,9 @@ It changes:
457457
import os
458458
import hal
459459
460-
from PyQt5.QtWidgets import QWidget, QToolButton, QMenu, QAction
461-
from PyQt5.QtCore import Qt, QEvent, pyqtProperty, QBasicTimer, pyqtSignal
462-
from PyQt5.QtGui import QIcon
460+
from PyQt6.QtWidgets import QWidget, QToolButton, QMenu, QAction
461+
from PyQt6.QtCore import Qt, QEvent, pyqtProperty, QBasicTimer, pyqtSignal
462+
from PyQt6.QtGui import QIcon
463463
464464
from qtvcp.widgets.widget_baseclass import _HalWidgetBase
465465
from qtvcp.widgets.dialog_widget import EntryDialog
@@ -659,8 +659,8 @@ Then `qtvcp/plugins/qtvcp_plugin.py` would need to be adjusted to _import_ them.
659659
----
660660
#!/usr/bin/env python3
661661
662-
from PyQt5 import QtCore, QtGui
663-
from PyQt5.QtDesigner import QPyDesignerCustomWidgetPlugin
662+
from PyQt6 import QtCore, QtGui
663+
from PyQt6.QtDesigner import QPyDesignerCustomWidgetPlugin
664664
from qtvcp.widgets.simple_widgets import Lcnc_GridLayout
665665
from qtvcp.widgets.qtvcp_icons import Icon
666666
ICON = Icon()
@@ -704,8 +704,8 @@ class LcncGridLayoutPlugin(QPyDesignerCustomWidgetPlugin):
704704
----
705705
#!/usr/bin/env python3
706706
707-
from PyQt5 import QtCore, QtGui
708-
from PyQt5.QtDesigner import QPyDesignerCustomWidgetPlugin
707+
from PyQt6 import QtCore, QtGui
708+
from PyQt6.QtDesigner import QPyDesignerCustomWidgetPlugin
709709
from qtvcp.widgets.system_tool_button import SystemToolButton
710710
from qtvcp.widgets.qtvcp_icons import Icon
711711
ICON = Icon()
@@ -756,8 +756,8 @@ This is the plugin used for _action buttons_.
756756
#!/usr/bin/env python3
757757
758758
import sip
759-
from PyQt5 import QtCore, QtGui, QtWidgets
760-
from PyQt5.QtDesigner import QPyDesignerCustomWidgetPlugin, \
759+
from PyQt6 import QtCore, QtGui, QtWidgets
760+
from PyQt6.QtDesigner import QPyDesignerCustomWidgetPlugin, \
761761
QPyDesignerTaskMenuExtension, QExtensionFactory, \
762762
QDesignerFormWindowInterface, QPyDesignerMemberSheetExtension
763763
from qtvcp.widgets.action_button import ActionButton

docs/src/gui/qtvcp-vcp-panels.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ Here is a sample to change the circle color in cam_align: +
509509
import sys
510510
import os
511511
import importlib
512-
from PyQt5.QtCore import Qt
512+
from PyQt6.QtCore import Qt
513513
from qtvcp.core import Path
514514
515515
PATH = Path()

docs/src/gui/qtvcp-vismach.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ part1 = Translate([dogs],-1,49,0)
585585
# create a top-level model
586586
model = Collection([base, saddle, head, carousel])
587587
588-
# we want to either embed into qtvcp or display directly with PyQt5
588+
# we want to either embed into qtvcp or display directly with PyQt6
589589
# so build a window to display the model
590590
591591
class Window(QWidget):
@@ -624,7 +624,7 @@ class Window(QWidget):
624624
mainLayout.addWidget(self.glWidget)
625625
self.setLayout(mainLayout)
626626
627-
# if you call this file directly from python3, it will display a PyQt5 window
627+
# if you call this file directly from python3, it will display a PyQt6 window
628628
# good for confirming the parts of the assembly.
629629
630630
if __name__ == '__main__':

docs/src/gui/qtvcp-widgets.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2903,7 +2903,7 @@ def _releasedOutput(self, btncode):
29032903
self['joy_{}_pressed'.format(btncode.lower())].emit(False)
29042904
----
29052905

2906-
As coded these function _issue (emit) PyQt5 signals (joy_btn_pressed and joy_<letter>_pressed) for the any button pressed or released_.
2906+
As coded these function _issue (emit) PyQt6 signals (joy_btn_pressed and joy_<letter>_pressed) for the any button pressed or released_.
29072907

29082908
Signal 'joy_btn_pressed' outputs a string code for the button. +
29092909
Signal 'joy_<letter>_pressed' outputs a bool value.

docs/src/gui/qtvcp.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ Normally QtVCP uses the stock UI and handler file, but you can specify QtVCP to
5757
A *'local' file* is one that is in the _configuration folder_ that defines the rest of the machine's requirements.
5858

5959
One is not restricted to adding a custom panel on the right or a custom tab as QtVCP leverages _Qt Designer_ (the editor)
60-
and _PyQt5_ (the widget toolkit).
60+
and _PyQt6_ (the widget toolkit).
6161

6262
QtVCP has some added *special LinuxCNC widgets and actions*. +
6363
There are special widgets to bridge third party widgets to HAL pins. +
6464
It's possible to create widget responses by connecting signals to Python code in the handler file.
6565

6666
=== QtVCP Widgets
6767

68-
QtVCP uses the *PyQt5 toolkit's widgets* for LinuxCNC integration.
68+
QtVCP uses the *PyQt6 toolkit's widgets* for LinuxCNC integration.
6969

70-
*Widget* is the _general name for user interface objects_ such as buttons and labels in PyQt5.
70+
*Widget* is the _general name for user interface objects_ such as buttons and labels in PyQt6.
7171

7272
You are free to use any available *default widgets* in the Qt Designer editor.
7373

@@ -145,7 +145,7 @@ If the update time is not set right the screen can become unresponsive or very j
145145

146146
A Qt Designer file is a text file organized in the _XML_ standard that describes the *layout and widgets* of the screen.
147147

148-
_PyQt5_ uses this file to build the display and react to those widgets.
148+
_PyQt6_ uses this file to build the display and react to those widgets.
149149

150150
The Qt Designer editor makes it relatively easy to build and edit this file.
151151

@@ -525,7 +525,7 @@ First you must have the *Qt Designer installed*. +
525525
The following commands should add it to your system, or use your package manager to do the same:
526526

527527
----
528-
sudo apt-get install qttools5-dev-tools qttools5-dev libpython3-dev
528+
sudo apt-get install pyqt6-dev-tools libpython3-dev
529529
----
530530

531531
////
@@ -577,14 +577,14 @@ You may need to create the `plugins/python` folder.
577577
+
578578
----
579579
. scripts/rip-environment <1>
580-
designer -qt=5 <2>
580+
designer -qt=6 <2>
581581
----
582582

583583
* For a _package install_: +
584584
Open a terminal and type:
585585
+
586586
----
587-
designer -qt=5
587+
designer -qt=6
588588
----
589589

590590
If all goes right, Qt Designer will launch and you will see the selectable LinuxCNC widgets on the left hand side.
@@ -734,7 +734,7 @@ import sys
734734
import os
735735
import linuxcnc
736736
737-
from PyQt5 import QtCore, QtWidgets
737+
from PyQt6 import QtCore, QtWidgets
738738
739739
from qtvcp.widgets.mdi_line import MDILine as MDI_WIDGET
740740
from qtvcp.widgets.gcode_editor import GcodeEditor as GCODE

docs/src/plasma/qtplasmac.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4240,9 +4240,9 @@ It will be referred to as `_xx` in this document, so `qtplasmac_xx.ts` in this d
42404240

42414241
The default locale for QtPlasmaC is `_en` which means that any translation files created as `qtplasmac_en.*` will not be used for translations.
42424242

4243-
If any of the required utilities (pyuic5, pylupdate5, linguist) are not installed then the user will need to install the required development tools:
4243+
If any of the required utilities (pyuic6, pylupdate6, linguist) are not installed then the user will need to install the required development tools:
42444244
----
4245-
sudo apt install qttools5-dev-tools pyqt5-dev-tools
4245+
sudo apt install qt6-tools-dev-tools pyqt6-dev-tools
42464246
----
42474247

42484248
Change to the languages directory:
@@ -4252,7 +4252,7 @@ cd ~/linuxcnc-dev/share/qtvcp/screens/qtplasmac/languages
42524252

42534253
If any text changes have been made to the GUI then run the following to update the GUI Python file:
42544254
----
4255-
pyuic5 ../qtplasmac.ui > qtplasmac.py
4255+
pyuic6 ../qtplasmac.ui > qtplasmac.py
42564256
----
42574257

42584258
The user can either create a new translation source file for a non-existing language translation
@@ -4265,7 +4265,7 @@ Create or edit a .ts file:
42654265
----
42664266

42674267
[NOTE]
4268-
this command is a script which runs the following: $ pylupdate5 *.py ../*.py ../../../../../lib/python/qtvcp/lib/qtplasmac/*.py -ts qtplasmac_xx.ts
4268+
this command is a script which runs the following: $ pylupdate6 *.py ../*.py ../../../../../lib/python/qtvcp/lib/qtplasmac/*.py -ts qtplasmac_xx.ts
42694269

42704270
The editing of the translation is done with the linguist application:
42714271
----

docs/src/user/user-intro.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ TkLinuxCNC:: <<sec:tklinuxcnc-intro,TkLinuxCNC>>, another interface based on Tcl
139139
.TkLinuxCNC graphical interface
140140
image::images/tkemc.png["TkLinuxCNC graphical interface",align="center"]
141141

142-
QtDragon:: <<cha:qtdragon-gui,QtDragon>>, a touch screen GUI based on QtVCP using the PyQt5 library.
142+
QtDragon:: <<cha:qtdragon-gui,QtDragon>>, a touch screen GUI based on QtVCP using the PyQt6 library.
143143
It comes in two versions 'QtDragon' and 'QtDragon_hd'.
144144
They are very similar in features but QtDragon_hd is made for larger monitors.
145145

146146
[[fig:QtDragon-graphical-interface]]
147147
.QtDragon, a touch screen GUI based on QtVCP
148148
image::images/qtdragon.png["QtDragon, a touch screen GUI based on QtVCP",align="center"]
149149

150-
QtPlasmaC:: <<cha:qtplasmac,QtPlasmaC>>, a touch screen plasma cutting GUI based on QtVCP using the PyQt5 library.
150+
QtPlasmaC:: <<cha:qtplasmac,QtPlasmaC>>, a touch screen plasma cutting GUI based on QtVCP using the PyQt6 library.
151151
It comes in three aspect ratios, 16:9, 4:3, and 9:16.
152152

153153
[[fig:QtPlasmaC-graphical-interface]]
@@ -184,7 +184,7 @@ GladeVCP:: <<cha:glade-vcp,'GladeVCP'>>, a Glade-based virtual control panel tha
184184
.GladeVCP Example Embedded Into AXIS GUI
185185
image::../gui/images/axis-gladevcp.png["GladeVCP embedded into AXIS",align="center"]
186186

187-
QtVCP:: <<cha:qtvcp,'QtVCP'>>, a PyQt5-based virtual control panel that can be added to most GUIs or run as a standalone panel.
187+
QtVCP:: <<cha:qtvcp,'QtVCP'>>, a PyQt6-based virtual control panel that can be added to most GUIs or run as a standalone panel.
188188
QtVCP has the advantage over PyVCP in that it is not limited to the display or control of HAL virtual signals,
189189
but can include other external interfaces outside LinuxCNC such as window or network events by extending with python code.
190190
QtVCP is also more flexible in how it may be configured to appear on the GUI with many special widgets:

0 commit comments

Comments
 (0)