Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PyQT4 App
Forum Updated to NodeBB v4.3 + New Features

PyQT4 App

Scheduled Pinned Locked Moved Unsolved Qt for Python
42 Posts 4 Posters 9.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mitko
    wrote on 4 Nov 2021, 17:41 last edited by
    #1

    Hi, i try to run this project, but can't install PyQT4. I use PyChram, i try with Python 3.8. and Python 2.7. but can't install PyQT4.
    Any help?
    https://github.com/molodoj88/xbee-gui

    J 1 Reply Last reply 4 Nov 2021, 17:57
    0
    • M Mitko
      4 Nov 2021, 17:41

      Hi, i try to run this project, but can't install PyQT4. I use PyChram, i try with Python 3.8. and Python 2.7. but can't install PyQT4.
      Any help?
      https://github.com/molodoj88/xbee-gui

      J Online
      J Online
      JonB
      wrote on 4 Nov 2021, 17:57 last edited by
      #2

      @Mitko
      It's a bad idea to try to go back to PyQt4/Qt4 now. How many instructions for installing PyQt4 did you try?

      Maybe you can find something for PyQt5. Somebody seems to be using that in https://ru.stackoverflow.com/questions/813834/Как-передать-параметры-в-поток-pyqt5. Or update what is at your link to PyQt5.

      M 1 Reply Last reply 5 Nov 2021, 13:08
      0
      • J JonB
        4 Nov 2021, 17:57

        @Mitko
        It's a bad idea to try to go back to PyQt4/Qt4 now. How many instructions for installing PyQt4 did you try?

        Maybe you can find something for PyQt5. Somebody seems to be using that in https://ru.stackoverflow.com/questions/813834/Как-передать-параметры-в-поток-pyqt5. Or update what is at your link to PyQt5.

        M Offline
        M Offline
        Mitko
        wrote on 5 Nov 2021, 13:08 last edited by
        #3

        @JonB
        So, can i use the example you gave me, to convert PyQT4 to 5?
        Or there is other options?

        J 1 Reply Last reply 5 Nov 2021, 13:11
        0
        • M Mitko
          5 Nov 2021, 13:08

          @JonB
          So, can i use the example you gave me, to convert PyQT4 to 5?
          Or there is other options?

          J Online
          J Online
          JonB
          wrote on 5 Nov 2021, 13:11 last edited by
          #4

          @Mitko
          I stated that the example I quoted seems already to be in PyQt5. I have no idea what it does, as I don't speak Russian.

          The github code you quoted is in PyQt4. Personally I would rather update that to PyQt5 than try to install and get PyQt4 working. Up to you.

          M 1 Reply Last reply 5 Nov 2021, 14:11
          0
          • J JonB
            5 Nov 2021, 13:11

            @Mitko
            I stated that the example I quoted seems already to be in PyQt5. I have no idea what it does, as I don't speak Russian.

            The github code you quoted is in PyQt4. Personally I would rather update that to PyQt5 than try to install and get PyQt4 working. Up to you.

            M Offline
            M Offline
            Mitko
            wrote on 5 Nov 2021, 14:11 last edited by
            #5

            @JonB
            Ok, if i can't use PyQt4, how can i convert this part of the project (that use PyQt4 ) to PyQt5 ?
            The project should establish zigbee topology, but i can't test it

            J 1 Reply Last reply 5 Nov 2021, 14:24
            0
            • M Mitko
              5 Nov 2021, 14:11

              @JonB
              Ok, if i can't use PyQt4, how can i convert this part of the project (that use PyQt4 ) to PyQt5 ?
              The project should establish zigbee topology, but i can't test it

              J Online
              J Online
              JonB
              wrote on 5 Nov 2021, 14:24 last edited by
              #6

              @Mitko
              I don't know if you mean by "part of the project" that you think you can have a project containing some PyQt5/Qt5 stuff and some PyQt4/Qt4 together in one app. If you do think that, you can't. So you have a couple of choices:

              • Continue your original route of trying to get PyQt4/Qt4 installed and running, using the various resources you were trying for PyQt4/Qt4, so that you can use xbee-gui as-is. I just think that's rather hard, and not good going forward if you intend to do further development, but I never did that so I don't know.

              • Change xbee-gui code to move to PyQt5/Qt5. I used https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5 and perhpas https://stackoverflow.com/questions/46554746/pyqt4-to-pyqt5-how for that.

              • Find some already-ported version of xbee-gui or ask the original developer. But I don't know that you will get much joy that way.

              As you please.

              M 1 Reply Last reply 7 Nov 2021, 14:43
              0
              • J JonB
                5 Nov 2021, 14:24

                @Mitko
                I don't know if you mean by "part of the project" that you think you can have a project containing some PyQt5/Qt5 stuff and some PyQt4/Qt4 together in one app. If you do think that, you can't. So you have a couple of choices:

                • Continue your original route of trying to get PyQt4/Qt4 installed and running, using the various resources you were trying for PyQt4/Qt4, so that you can use xbee-gui as-is. I just think that's rather hard, and not good going forward if you intend to do further development, but I never did that so I don't know.

                • Change xbee-gui code to move to PyQt5/Qt5. I used https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5 and perhpas https://stackoverflow.com/questions/46554746/pyqt4-to-pyqt5-how for that.

                • Find some already-ported version of xbee-gui or ask the original developer. But I don't know that you will get much joy that way.

                As you please.

                M Offline
                M Offline
                Mitko
                wrote on 7 Nov 2021, 14:43 last edited by
                #7

                @JonB

                I try to upgrade from PyQT4 to 5, but now i have other types of errors, that i don't understand.
                Can someone help me ?
                254295116_440010580821929_772944740554573543_n.jpg

                J 1 Reply Last reply 7 Nov 2021, 16:04
                0
                • M Mitko
                  7 Nov 2021, 14:43

                  @JonB

                  I try to upgrade from PyQT4 to 5, but now i have other types of errors, that i don't understand.
                  Can someone help me ?
                  254295116_440010580821929_772944740554573543_n.jpg

                  J Online
                  J Online
                  JonB
                  wrote on 7 Nov 2021, 16:04 last edited by
                  #8

                  @Mitko
                  I don't think this is actually anything to do with PyQt, or Qt. If you had copied and pasted the text instead of screenshot I could have quoted from it. But I see a Python3.8 json library loader complaining about some character in its JSON input.

                  M 1 Reply Last reply 23 Nov 2021, 17:18
                  0
                  • J JonB
                    7 Nov 2021, 16:04

                    @Mitko
                    I don't think this is actually anything to do with PyQt, or Qt. If you had copied and pasted the text instead of screenshot I could have quoted from it. But I see a Python3.8 json library loader complaining about some character in its JSON input.

                    M Offline
                    M Offline
                    Mitko
                    wrote on 23 Nov 2021, 17:18 last edited by
                    #9

                    @JonB

                    The error was, because part one of the files (the json), containing the xbee commands, has Russian in it, so the problem was with UTF-8 encoding, but i fix it.
                    But now i have the following problem:

                    File "C:/xbee-gui-master/MainForm.py", line 18, in <module>
                        class Block(QtGui.QMainWindow, QtGui.QTreeView):
                    NameError: name 'QtGui' is not defined
                    

                    How to solve it ?

                    J 1 Reply Last reply 23 Nov 2021, 17:23
                    0
                    • M Mitko
                      23 Nov 2021, 17:18

                      @JonB

                      The error was, because part one of the files (the json), containing the xbee commands, has Russian in it, so the problem was with UTF-8 encoding, but i fix it.
                      But now i have the following problem:

                      File "C:/xbee-gui-master/MainForm.py", line 18, in <module>
                          class Block(QtGui.QMainWindow, QtGui.QTreeView):
                      NameError: name 'QtGui' is not defined
                      

                      How to solve it ?

                      J Online
                      J Online
                      JonB
                      wrote on 23 Nov 2021, 17:23 last edited by JonB
                      #10

                      @Mitko
                      Qt5 moved widget code from QtGui to QtWidgets, change to that. You will have to do the same for any other widget stuff. I gave you reference to https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5 for this --- it's the very first item there --- and told you that's what I used to do the porting work.

                      M 1 Reply Last reply 25 Nov 2021, 12:18
                      1
                      • J JonB
                        23 Nov 2021, 17:23

                        @Mitko
                        Qt5 moved widget code from QtGui to QtWidgets, change to that. You will have to do the same for any other widget stuff. I gave you reference to https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5 for this --- it's the very first item there --- and told you that's what I used to do the porting work.

                        M Offline
                        M Offline
                        Mitko
                        wrote on 25 Nov 2021, 12:18 last edited by
                        #11

                        @JonB
                        I began to solve this problem, but now i have this error:

                         C:\xbee-gui-master\PyQT\Scripts\python.exe C:/xbee-gui-master/MainForm.py
                        Traceback (most recent call last):
                          File "C:/xbee-gui-master/MainForm.py", line 360, in <module>
                            main()
                          File "C:/xbee-gui-master/MainForm.py", line 355, in main
                            bl = Block()
                          File "C:/xbee-gui-master/MainForm.py", line 26, in __init__
                            self.setWindowIcon(QtWidgets.QIcon("zigbee.png"))
                        AttributeError: module 'PyQt5.QtWidgets' has no attribute 'QIcon'
                        
                        jsulmJ 1 Reply Last reply 25 Nov 2021, 12:50
                        0
                        • M Mitko
                          25 Nov 2021, 12:18

                          @JonB
                          I began to solve this problem, but now i have this error:

                           C:\xbee-gui-master\PyQT\Scripts\python.exe C:/xbee-gui-master/MainForm.py
                          Traceback (most recent call last):
                            File "C:/xbee-gui-master/MainForm.py", line 360, in <module>
                              main()
                            File "C:/xbee-gui-master/MainForm.py", line 355, in main
                              bl = Block()
                            File "C:/xbee-gui-master/MainForm.py", line 26, in __init__
                              self.setWindowIcon(QtWidgets.QIcon("zigbee.png"))
                          AttributeError: module 'PyQt5.QtWidgets' has no attribute 'QIcon'
                          
                          jsulmJ Online
                          jsulmJ Online
                          jsulm
                          Lifetime Qt Champion
                          wrote on 25 Nov 2021, 12:50 last edited by
                          #12

                          @Mitko said in PyQT4 App:

                          QIcon

                          This one is in gui module.
                          I guess in PyQt it is PyQt5.QtGui

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          M 1 Reply Last reply 25 Nov 2021, 13:24
                          0
                          • jsulmJ jsulm
                            25 Nov 2021, 12:50

                            @Mitko said in PyQT4 App:

                            QIcon

                            This one is in gui module.
                            I guess in PyQt it is PyQt5.QtGui

                            M Offline
                            M Offline
                            Mitko
                            wrote on 25 Nov 2021, 13:24 last edited by
                            #13

                            @jsulm

                            I change it, but now i have this:

                             C:\xbee-gui-master\PyQT\Scripts\python.exe C:/xbee-gui-master/MainForm.py
                            Traceback (most recent call last):
                              File "C:/xbee-gui-master/MainForm.py", line 360, in <module>
                                main()
                              File "C:/xbee-gui-master/MainForm.py", line 355, in main
                                bl = Block()
                              File "C:/xbee-gui-master/MainForm.py", line 26, in __init__
                                self.setWindowIcon(QtWidgets.QGui("zigbee.png"))
                            AttributeError: module 'PyQt5.QtWidgets' has no attribute 'QGui'
                            
                            jsulmJ 1 Reply Last reply 25 Nov 2021, 13:27
                            0
                            • M Mitko
                              25 Nov 2021, 13:24

                              @jsulm

                              I change it, but now i have this:

                               C:\xbee-gui-master\PyQT\Scripts\python.exe C:/xbee-gui-master/MainForm.py
                              Traceback (most recent call last):
                                File "C:/xbee-gui-master/MainForm.py", line 360, in <module>
                                  main()
                                File "C:/xbee-gui-master/MainForm.py", line 355, in main
                                  bl = Block()
                                File "C:/xbee-gui-master/MainForm.py", line 26, in __init__
                                  self.setWindowIcon(QtWidgets.QGui("zigbee.png"))
                              AttributeError: module 'PyQt5.QtWidgets' has no attribute 'QGui'
                              
                              jsulmJ Online
                              jsulmJ Online
                              jsulm
                              Lifetime Qt Champion
                              wrote on 25 Nov 2021, 13:27 last edited by
                              #14

                              @Mitko said in PyQT4 App:

                              PyQt5.QtWidgets' has no attribute 'QGui'

                              I did not suggest to write QtWidgets.QGui but PyQt5.QtGui

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              M 1 Reply Last reply 25 Nov 2021, 13:31
                              0
                              • jsulmJ jsulm
                                25 Nov 2021, 13:27

                                @Mitko said in PyQT4 App:

                                PyQt5.QtWidgets' has no attribute 'QGui'

                                I did not suggest to write QtWidgets.QGui but PyQt5.QtGui

                                M Offline
                                M Offline
                                Mitko
                                wrote on 25 Nov 2021, 13:31 last edited by
                                #15

                                @jsulm

                                 C:\xbee-gui-master\PyQT\Scripts\python.exe C:/xbee-gui-master/MainForm.py
                                Traceback (most recent call last):
                                  File "C:/xbee-gui-master/MainForm.py", line 360, in <module>
                                    main()
                                  File "C:/xbee-gui-master/MainForm.py", line 355, in main
                                    bl = Block()
                                  File "C:/xbee-gui-master/MainForm.py", line 26, in __init__
                                    self.setWindowIcon(PyQt5.QGui("zigbee.png"))
                                NameError: name 'PyQt5' is not defined 
                                
                                jsulmJ 1 Reply Last reply 25 Nov 2021, 13:37
                                0
                                • M Mitko
                                  25 Nov 2021, 13:31

                                  @jsulm

                                   C:\xbee-gui-master\PyQT\Scripts\python.exe C:/xbee-gui-master/MainForm.py
                                  Traceback (most recent call last):
                                    File "C:/xbee-gui-master/MainForm.py", line 360, in <module>
                                      main()
                                    File "C:/xbee-gui-master/MainForm.py", line 355, in main
                                      bl = Block()
                                    File "C:/xbee-gui-master/MainForm.py", line 26, in __init__
                                      self.setWindowIcon(PyQt5.QGui("zigbee.png"))
                                  NameError: name 'PyQt5' is not defined 
                                  
                                  jsulmJ Online
                                  jsulmJ Online
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on 25 Nov 2021, 13:37 last edited by
                                  #16

                                  @Mitko said in PyQT4 App:

                                  PyQt5.QGui("zigbee.png")

                                  What is this?! You want to use QIcon, right?
                                  It should be I guess

                                  QtGui.QIcon("zigbee.png")
                                  

                                  It is also shown in the documentation which you should consult: https://doc.qt.io/qtforpython-5/PySide2/QtGui/QIcon.html

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  M 1 Reply Last reply 25 Nov 2021, 13:40
                                  0
                                  • jsulmJ jsulm
                                    25 Nov 2021, 13:37

                                    @Mitko said in PyQT4 App:

                                    PyQt5.QGui("zigbee.png")

                                    What is this?! You want to use QIcon, right?
                                    It should be I guess

                                    QtGui.QIcon("zigbee.png")
                                    

                                    It is also shown in the documentation which you should consult: https://doc.qt.io/qtforpython-5/PySide2/QtGui/QIcon.html

                                    M Offline
                                    M Offline
                                    Mitko
                                    wrote on 25 Nov 2021, 13:40 last edited by
                                    #17

                                    @jsulm

                                     C:\xbee-gui-master\PyQT\Scripts\python.exe C:/xbee-gui-master/MainForm.py
                                    Traceback (most recent call last):
                                      File "C:/xbee-gui-master/MainForm.py", line 360, in <module>
                                        main()
                                      File "C:/xbee-gui-master/MainForm.py", line 355, in main
                                        bl = Block()
                                      File "C:/xbee-gui-master/MainForm.py", line 26, in __init__
                                        self.setWindowIcon(QtGui.QIcon("zigbee.png"))
                                    NameError: name 'QtGui' is not defined 
                                    
                                    jsulmJ 1 Reply Last reply 25 Nov 2021, 13:43
                                    0
                                    • M Mitko
                                      25 Nov 2021, 13:40

                                      @jsulm

                                       C:\xbee-gui-master\PyQT\Scripts\python.exe C:/xbee-gui-master/MainForm.py
                                      Traceback (most recent call last):
                                        File "C:/xbee-gui-master/MainForm.py", line 360, in <module>
                                          main()
                                        File "C:/xbee-gui-master/MainForm.py", line 355, in main
                                          bl = Block()
                                        File "C:/xbee-gui-master/MainForm.py", line 26, in __init__
                                          self.setWindowIcon(QtGui.QIcon("zigbee.png"))
                                      NameError: name 'QtGui' is not defined 
                                      
                                      jsulmJ Online
                                      jsulmJ Online
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on 25 Nov 2021, 13:43 last edited by
                                      #18

                                      @Mitko said in PyQT4 App:

                                      name 'QtGui' is not defined

                                      You of course have to import this module like any other module

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      M 1 Reply Last reply 25 Nov 2021, 13:50
                                      0
                                      • jsulmJ jsulm
                                        25 Nov 2021, 13:43

                                        @Mitko said in PyQT4 App:

                                        name 'QtGui' is not defined

                                        You of course have to import this module like any other module

                                        M Offline
                                        M Offline
                                        Mitko
                                        wrote on 25 Nov 2021, 13:50 last edited by
                                        #19

                                        @jsulm
                                        Via Interpreter ? I've try, it seems to installed, but i've got same error

                                        jsulmJ 1 Reply Last reply 25 Nov 2021, 13:52
                                        0
                                        • M Mitko
                                          25 Nov 2021, 13:50

                                          @jsulm
                                          Via Interpreter ? I've try, it seems to installed, but i've got same error

                                          jsulmJ Online
                                          jsulmJ Online
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on 25 Nov 2021, 13:52 last edited by
                                          #20

                                          @Mitko said in PyQT4 App:

                                          Via Interpreter ?

                                          Don't know what you mean.

                                          from PyQt5 import QtGui
                                          

                                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          M 1 Reply Last reply 25 Nov 2021, 13:57
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved