Menu

SourceCode Merge Request #25: Update dxf2gcode to run with Qt6 using a compatibility layer allowing Qt5 as well (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Richard Kenney wants to merge 13 commits from /u/richk1949/dxf2gcode/ to develop, 2026-08-13

I use dxf2gcode under Linux and Qt5 has now reached the point of retirement so, to continue using it I needed it to run under Qt6. I updated the code with a compatibility layer so it can still run with Qt5, but it would be trivial to remove this and make it Qt6 only.

I also checked that I can run it on a Windows PC and made a small change to setup.py to allow it to create the msi file running Python 3.14.

Commit Date  
[84a8ba] (qt6) by Richard Kenney Richard Kenney

Adjust windows release tools to work with current Python & Qt6

2026-08-11 22:05:04 Tree
[7944f4] by Richard Kenney Richard Kenney

Make make_tr.py compatible with both PyQt5 and PyQt6
Since pylupdate6 can't use a qmake file, manually generate the list of source & translation files.

2026-08-11 19:58:06 Tree
[4a2594] by Richard Kenney Richard Kenney

Make make_py_uic.py compatible with both PyQt5 and PyQt6
Change from pyrcc5 to rcc as there is no pyrcc6, this also requires modification of the resulting resource file as rcc is PySide compatible.

2026-08-04 22:43:29 Tree
[79402e] by Richard Kenney Richard Kenney

Add conditional code to canvas3d.py and dxf2gcode.py to cover PyQt5 and PyQt6

2026-08-04 21:10:41 Tree
[305477] by Richard Kenney Richard Kenney

Correct a couple of string issues in core functions

2026-08-04 20:49:16 Tree
[47cd91] by Richard Kenney Richard Kenney

Revert changes on example code

2026-08-04 20:13:20 Tree
[1001f6] by Richard Kenney Richard Kenney

Revert changes on example code

2026-08-04 20:11:27 Tree
[6fc6ea] by Richard Kenney Richard Kenney

Caught a couple more enums

2026-08-04 20:08:19 Tree
[a67d5a] by Richard Kenney Richard Kenney

Replace all instances of exec_ with exec

2026-08-04 20:02:15 Tree
[1ed07e] by Richard Kenney Richard Kenney

Update enums to Qt6 format in all .py files

2026-08-03 23:25:16 Tree
[29308e] by Richard Kenney Richard Kenney

Correct backslash escape sequences in strings

2026-08-03 22:09:39 Tree
[2944bc] by Richard Kenney Richard Kenney

Change imports to use compatibility layer

2026-08-03 20:42:27 Tree
[1ff81a] by Richard Kenney Richard Kenney

Add compatibility layer Qt5/6

2026-08-03 20:26:23 Tree

Discussion

  • chrisko

    chrisko - 2026-08-12
    • Status: open --> merged
     
  • chrisko

    chrisko - 2026-08-12

    Hi Richard, thank you way much for the very good merge request. I checkef the Code, it looks very good. But I had no time to tryto execute it.

     
  • Rainer Baumgaertner

    Hi Guys,
    i really appreciate that you are still improving!

    i am on ubuntu 26.04 LTS
    running dxf2gcode in a python venv with:

    • pip3 install pyqt5
    • pip3 install PyOpenGL
    • pip3 install configobj
    • pip3 install py2app
    • sudo apt-get install qttools5-dev-tools
    • sudo apt-get install pstoedit

    I cloned #25.
    The commit before the merge worked on my machine.

    with #25 the app starts but when i try to save an option it reproducible crashes:

    Traceback (most recent call last):
    File ".../bin/dxf2gcode", line 1131, in updateConfiguration
    if result == ConfigWindow.DialogCode.Applied or result == ConfigWindow.DialogCode.Accepted:
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: sip.enumtype object 'DialogCode' has no member 'Applied'

    I am not an expert in python.
    But i was looking for a quick fix:

    1. i found that in class "MainWindow(QMainWindow):"
      "self.config_window.finished.connect(self.updateConfiguration)" is called.

    It seems for me that the method "updateConfiguration" needs an argument (since the argument "result" is referenced).

    For a test i changed it to: "self.config_window.finished.connect(self.updateConfiguration(self.config_window))"

    This then leads to a immediate python runtime error:

    "Traceback (most recent call last):
    File ".../bin/dxf2gcode", line 1268, in <module>
    window = MainWindow(app)
    File ".../bin/dxf2gcode", line 95, in init
    self.config_window.finished.connect(self.updateConfiguration(self.config_window))
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
    File "/.../bin/dxf2gcode", line 1131, in updateConfiguration
    if result == ConfigWindow.DialogCode.Applied or result == ConfigWindow.DialogCode.Accepted:
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: sip.enumtype object 'DialogCode' has no member 'Applied'
    "</module>

    1. The main issue seems to be that ConfigWindow.DialogCode does not have a member member 'Applied'
     
  • Richard Kenney

    Richard Kenney - 2026-08-13

    Sorry about that. It was the last thing I changed, and like most last minute things it was wrong. the issue is that in line 1131, the attribute ConfigWindow.Applied is a class attribute of ConfigWindow, not inherited from QDialog and so shouldn't have been changed when updating the enums from Qt5 to Qt6. Line 1131 should have become

    if result == ConfigWindow.Applied or result == ConfigWindow.DialogCode.Accepted:

    Note that ConfigWindow.DialogCode.Accepted is inherited from QDialog and so has changed (Current versions of Qt5 are compatible with Qt6 enum definitions, so they work for both).

     
  • Richard Kenney

    Richard Kenney - 2026-08-13

    I have updated my fork, should I make a new merge request?

     
  • chrisko

    chrisko - 2026-08-13

    I think thats the easiest way ;-)

     

Log in to post a comment.