Converting UI from Qt to wxPython?

I have source code from January 2008 for a no longer supported
application. The UI is written in a version of Qt that will not run in the
versions installed here. I'd like to get it working. Is there a procedure or
tool to convert files from Qt to wxPython?

   Some files are written in Python, others are XML. Not being familiar with
Qt I'm not sure how to translate, especially since Qt modules are imported.

   Your thoughts are appreciated.

Rich

Hi,
Is it written in plain QT or pyQT?

Thank you.

···

On Sep 14, 2015 8:31 PM, “Rich Shepard” rshepard@appl-ecosys.com wrote:

I have source code from January 2008 for a no longer supported

application. The UI is written in a version of Qt that will not run in the

versions installed here. I’d like to get it working. Is there a procedure or

tool to convert files from Qt to wxPython?

Some files are written in Python, others are XML. Not being familiar with

Qt I’m not sure how to translate, especially since Qt modules are imported.

Your thoughts are appreciated.

Rich

Hi,
Is it written in plain QT or pyQT?

Asking because maybe it is easier to convert to main wxWidgets rather
than wxPython...

Thank you.

···

On Mon, Sep 14, 2015 at 9:02 PM, Igor Korot <ikorot01@gmail.com> wrote:

Thank you.

On Sep 14, 2015 8:31 PM, "Rich Shepard" <rshepard@appl-ecosys.com> wrote:

  I have source code from January 2008 for a no longer supported
application. The UI is written in a version of Qt that will not run in the
versions installed here. I'd like to get it working. Is there a procedure
or
tool to convert files from Qt to wxPython?

  Some files are written in Python, others are XML. Not being familiar
with
Qt I'm not sure how to translate, especially since Qt modules are
imported.

  Your thoughts are appreciated.

Rich

Igor,

   PyQt4. Examples:

from PyQt4.QtGui import QDialog
from PyQt4.QtCore import pyqtSignature

from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import QDialog
from PyQt4.QtCore import pyqtSignature

   I have PyQt-4.11.1-i486-1python2and3 installed here.

Thanks,

Rich

···

On Mon, 14 Sep 2015, Igor Korot wrote:

Is it written in plain QT or pyQT?

Hi Rich,

···

On Monday, September 14, 2015 at 7:31:28 PM UTC-5, fuzzydoc wrote:

I have source code from January 2008 for a no longer supported

application. The UI is written in a version of Qt that will not run in the

versions installed here. I’d like to get it working. Is there a procedure or

tool to convert files from Qt to wxPython?

Some files are written in Python, others are XML. Not being familiar with

Qt I’m not sure how to translate, especially since Qt modules are imported.

Your thoughts are appreciated.

Rich

Hopefully your application was written using MVC principles. As long as the view is as separate as it can be from the actual business code / logic, then the transition shouldn’t be too bad. You’ll basically have to rewrite the user interface and wire it up to the backend code, but the backend code is usually the hardest part in my opinion.

If you posted screenshots of the application, we could tell you what widgets to use in wxPython.

  • Mike

Mike/Rich,

Hi Rich,

  I have source code from January 2008 for a no longer supported
application. The UI is written in a version of Qt that will not run in the
versions installed here. I'd like to get it working. Is there a procedure
or
tool to convert files from Qt to wxPython?

   Some files are written in Python, others are XML. Not being familiar
with
Qt I'm not sure how to translate, especially since Qt modules are
imported.

   Your thoughts are appreciated.

Rich

Hopefully your application was written using MVC principles. As long as the
view is as separate as it can be from the actual business code / logic, then
the transition shouldn't be too bad. You'll basically have to rewrite the
user interface and wire it up to the backend code, but the backend code is
usually the hardest part in my opinion.

If you posted screenshots of the application, we could tell you what widgets
to use in wxPython.

The widgets transition is usually pretty straightforward:

QApplication -> wx.App
QDialog -> wx.Dialog
QWindow -> wx.WIndow
etc.

···

On Tue, Sep 15, 2015 at 9:50 AM, Mike Driscoll <kyosohma@gmail.com> wrote:

On Monday, September 14, 2015 at 7:31:28 PM UTC-5, fuzzydoc wrote:

- Mike

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike,

   You're absolutely correct! :slight_smile:

   If I knew how the UI was written before it would be simple to recreate it
using wxPython. But, the application won't load:

$ python setup.py install
   File "setup.py", line 2
     cd src
          ^
SyntaxError: invalid syntax

   So, I cd to the src/ subdirectory and try again:

$ python pyBallisticsGUI.py Traceback (most recent call last):
   File "pyBallisticsGUI.py", line 166, in <module>
     ui = BallisticsMainWindow()
   File "pyBallisticsGUI.py", line 27, in __init__
     Ui_MainWindow.__init__(self, parent, name, fl)
TypeError: object.__init__() takes no parameters

   I think it's a syntax error because the application is not installed, but
why setup.py cannot find the src/ subdirectory remains a mystery. I've
drilled down in src/ and still cannot get it to load.

Rich

···

On Tue, 15 Sep 2015, Mike Driscoll wrote:

Hopefully your application was written using MVC principles. As long as
the view is as separate as it can be from the actual business code /
logic, then the transition shouldn't be too bad. You'll basically have to
rewrite the user interface and wire it up to the backend code, but the
backend code is usually the hardest part in my opinion.

If you posted screenshots of the application, we could tell you what
widgets to use in wxPython.

Igor,

   I'll try that, but I suspect there are other issues on top of this; e.g.,
why setup.py fails (and it's a binary rather than text file).

Thanks,

Rich

···

On Tue, 15 Sep 2015, Igor Korot wrote:

The widgets transition is usually pretty straightforward:

QApplication -> wx.App
QDialog -> wx.Dialog
QWindow -> wx.WIndow
etc.

How much code are we talking about here? Is it proprietary? I’m sure one of us could figure out how to get it to run.

Mike

···

On Tuesday, September 15, 2015 at 9:47:49 AM UTC-5, fuzzydoc wrote:

On Tue, 15 Sep 2015, Mike Driscoll wrote:

Hopefully your application was written using MVC principles. As long as

the view is as separate as it can be from the actual business code /

logic, then the transition shouldn’t be too bad. You’ll basically have to

rewrite the user interface and wire it up to the backend code, but the

backend code is usually the hardest part in my opinion.

If you posted screenshots of the application, we could tell you what

widgets to use in wxPython.

Mike,

You’re absolutely correct! :slight_smile:

If I knew how the UI was written before it would be simple to recreate it

using wxPython. But, the application won’t load:

$ python setup.py install

File “setup.py”, line 2

 cd src

      ^

SyntaxError: invalid syntax

So, I cd to the src/ subdirectory and try again:

$ python pyBallisticsGUI.py
Traceback (most recent call last):

File “pyBallisticsGUI.py”, line 166, in

 ui = BallisticsMainWindow()

File “pyBallisticsGUI.py”, line 27, in init

 Ui_MainWindow.__init__(self, parent, name, fl)

TypeError: object.init() takes no parameters

I think it’s a syntax error because the application is not installed, but

why setup.py cannot find the src/ subdirectory remains a mystery. I’ve

drilled down in src/ and still cannot get it to load.

Rich

Mike,

   Less than 500K, gpl3 licensing. Let me try a couple of things today before
making a tarball and sending it on. The author apparently used a versioning
system, but the directory structure is quite messy. I'll try to clean that
up as a first step.

Thanks,

Rich

···

On Tue, 15 Sep 2015, Mike Driscoll wrote:

How much code are we talking about here? Is it proprietary? I'm sure one
of us could figure out how to get it to run.

Rich Shepard wrote:

   If I knew how the UI was written before it would be simple to recreate it
using wxPython. But, the application won't load:

$ python setup.py install
   File "setup.py", line 2
     cd src
          ^
SyntaxError: invalid syntax

   So, I cd to the src/ subdirectory and try again:

That's not a Python file. It's a Windows batch file. Open it in
Notepad to see.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Notepad not available on linux systems. I can find strings in it, but
that's about all.

   I'm not surprised it's a Windows file; that's the platform used by the
developer.

Rich

···

On Tue, 15 Sep 2015, Tim Roberts wrote:

That's not a Python file. It's a Windows batch file. Open it in
Notepad to see.

Rich,

That's not a Python file. It's a Windows batch file. Open it in
Notepad to see.

  Notepad not available on linux systems. I can find strings in it, but
that's about all.

  I'm not surprised it's a Windows file; that's the platform used by the
developer.

In this case its most likely have a Windows EOL.
You can convert them to be a *nix EOL and try again.

Thank you.

···

On Tue, Sep 15, 2015 at 12:45 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Tue, 15 Sep 2015, Tim Roberts wrote:

Rich

Already ran dos2unix on all files; makes no difference:

$ ./pyballistics.sh Traceback (most recent call last):
   File "pyBallisticsGUI.py", line 166, in <module>
     ui = BallisticsMainWindow()
   File "pyBallisticsGUI.py", line 27, in __init__
     Ui_MainWindow.__init__(self, parent, name, fl)
TypeError: object.__init__() takes no parameters

   I'll work on this Real Soon Now.

Rich

···

On Tue, 15 Sep 2015, Igor Korot wrote:

In this case its most likely have a Windows EOL.
You can convert them to be a *nix EOL and try again.

Rich Shepard wrote:

That's not a Python file. It's a Windows batch file. Open it in
Notepad to see.

   Notepad not available on linux systems. I can find strings in it, but
that's about all.

What??? This is a plain text file.
    cat setup.py
If you don't recognize is, post the first few lines.

   I'm not surprised it's a Windows file; that's the platform used by the
developer.

I assumed you were on Windows. It could also be a Linux shell script.

···

On Tue, 15 Sep 2015, Tim Roberts wrote:

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

$ less setup.py "setup.py" may be a binary file. See it anyway?

pyBallisticsSF/trunk/pyballistics^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@0000644^@0^@^@^@^@^@^@^@0^@^@^@^@^@^@^@62^@^@^@^@^@^@^@^@^@^@10742715776^@15153
0^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@ustar^@00nobody^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@nobody^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@#!/bin/sh

cd src
python pyBallisticsGUI.py

etc.

Rich

···

On Tue, 15 Sep 2015, Tim Roberts wrote:

What??? This is a plain text file.
   cat setup.py
If you don't recognize is, post the first few lines.

Rich Shepard wrote:

···

On Tue, 15 Sep 2015, Tim Roberts wrote:

What??? This is a plain text file.
   cat setup.py
If you don't recognize is, post the first few lines.

$ less setup.py
"setup.py" may be a binary file. See it anyway?

pyBallisticsSF/trunk/pyballistics^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@0000644^@0^@^@^@^@^@^@^@0^@^@^@^@^@^@^@62^@^@^@^@^@^@^@^@^@^@10742715776^@15153

How, exactly, did you acquire this file? That's a "tar" archive. It's
like the Linux version of "zip". You can try renaming it and
extracting from the archive:
    mv setup.py pyball.tar
    tar xvf pyball.tar
Perhaps there will be an actual "setup.py" in there.

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

How, exactly, did you acquire this file?

   sourceforge.net

That's a "tar" archive.

   I've not looked in a tarball so I did not recognize that.

Rich

···

On Tue, 15 Sep 2015, Tim Roberts wrote:

Doesn't need to be renamed; tar xvf setup.py extracts it. There's another
copy of the path leading to the same file as the shell script. Really messy.
That file can be deleted; it will not work regardless.

Rich

···

On Tue, 15 Sep 2015, Tim Roberts wrote:

Perhaps there will be an actual "setup.py" in there.

Spent a little time cleaning out the cruft and fixed __init()__ so the
application now loads. Seeing the UI and finding the code for it in one of
the modules gives me the information I need to convert it to wxPython and
clean it up.

   Thanks to all who provided comments and suggestions.

Rich

···

On Mon, 14 Sep 2015, Rich Shepard wrote:

I have source code from January 2008 for a no longer supported
application. The UI is written in a version of Qt that will not run in the
versions installed here. I'd like to get it working. Is there a procedure or
tool to convert files from Qt to wxPython?