Python Forum
[PyQt4] Is it right python coding scheme between TCP Server Thread and GUI class ?
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt4] Is it right python coding scheme between TCP Server Thread and GUI class ?
#2
Some improvements would be worthwhile before adding new features. First off, you should clean the imports and avoid using wildcards (from PyQt4.QtGui import *), as it makes the code harder to read and increase the risk of name collisions.

Also, you pass a QObject into your signals, but you don't use it in your slot. Instead, you can simply skip the arguments:

signal1 = QtCore.pyqtSignal()
self.signal1.emit()
Finally, you should move your TCP thread into a QThread, with Qt's moveToThread() method. As shown here.
Reply


Messages In This Thread
RE: [PyQt4] Is it right python coding scheme between TCP Server Thread and GUI class ? - by Alfalfa - Sep-17-2018, 11:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] PyQt4 dynamic QComboBox littleGreenDude 4 5,722 Jan-02-2019, 07:22 PM
Last Post: littleGreenDude
  [PyQt] PyQt4 handle dynamic checkbox click littleGreenDude 1 6,606 Dec-27-2018, 09:17 PM
Last Post: littleGreenDude
  PyQt4 installation frustration littleGreenDude 4 4,571 Dec-27-2018, 04:29 PM
Last Post: littleGreenDude
  How to Integrate PyQt4 Custom Widget with Qt Designer Zukias 1 3,932 Aug-29-2018, 05:33 PM
Last Post: Zukias
  Updating Python version from command prompt and Conversion from PyQt4 to PyQt5 Vysero 4 4,977 Jul-19-2018, 03:15 PM
Last Post: Vysero
  Trouble displaying an image in PyQt4 Vysero 2 3,124 Jul-01-2018, 05:25 PM
Last Post: Alfalfa
  [PyQt] problem with PyQt4 jss15497 0 2,779 Jan-16-2018, 08:32 AM
Last Post: jss15497
  [PyQt] Learn pyqt5 using pyqt4 jimclay75051 5 5,839 Nov-13-2017, 06:29 AM
Last Post: zykbee
  How to program PyQt4 from python? medic_ward 3 4,937 Feb-27-2017, 05:11 PM
Last Post: medic_ward
  PyQT4 only upper case text iFunKtion 1 3,703 Feb-27-2017, 01:13 PM
Last Post: Raures

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020