Skip to content

Qt for Python

For discussion and questions about Qt for Python (PySide & Shiboken)

3.3k Topics 14.6k Posts
  • Tcp client is not able to recieve data from pthon server

    Moved Unsolved
    6
    0 Votes
    6 Posts
    621 Views
    JonBJ
    @daisyvish said in Tcp client is not able to recieve data from pthon server: problem is that i m not able to get data from server...In short Qt client is not able to display any data from server . And I wrote earlier: what have you done in the way of debugging to locate whatever problem you have? Reduce it to a minimal example of whatever your issue is. You haven't even told us what output you get/do not get.... [You have print() statements, yet do not bother to tell us which you do/do not see output from.]
  • 0 Votes
    2 Posts
    7k Views
    jeremy_kJ
    What imports and other code are executed before the QApplication is created? Does a minimal working example trigger the same behavior? Does the same code work when not part of a PyInstaller executable? If the problem only surfaces when using PyInstaller, look at the hooks that are executed. The problem is likely as the error message says: You might be loading two sets of Qt binaries into the same process. The first block of messages suggest it to be a conflict between PyQt5 and PhoneBot.app.
  • Developping in the Creator - embedded Terminal has no full keyboard processing

    Unsolved
    4
    0 Votes
    4 Posts
    486 Views
    sierdzioS
    @Andy314 said in Developping in the Creator - embedded Terminal has no full keyboard processing: Hello @sierdzio ! Ok, the "Run in terminal" works but it is not comfortable for developing. Does not work the keyboard input in the "console output" on principle ? The advantage of it is the very usefull integrated link to the the error line. Do you know a comfortable way for the Creator the for both features (Keybord input AND error-links) like in Visual Studio Code. Nope, I don't think Qt Creator supports such use case. You can try suggesting it on Qt bugtracker.
  • QStandardItemModel custom sorting rules

    Solved pyside2 python
    6
    0 Votes
    6 Posts
    1k Views
    JonBJ
    @QueTeeHelper Exactly right, those are the comments I would have typed if it were my code :)
  • multiple main windows

    Unsolved
    5
    0 Votes
    5 Posts
    709 Views
    A
    @JonB Understood, thank you for commenting and explaining. I was starting to wonder if it was a compatibility issue between QT and this API's code
  • Returning an object from function to the main window.

    Solved
    2
    0 Votes
    2 Posts
    259 Views
    eyllanescE
    @Krathyn Save as attribute: class Window(QMainWindow): def __init__(self, parent=None): super().__init__(parent) self.setWindowTitle("Grok it: v0.1") self.resize(400, 100) self.centralWidget = QWidget() self.setCentralWidget(self.centralWidget) self.layout = QGridLayout() self.centralWidget.setLayout(self.layout) self.setupUI() self.setTokenButton.clicked.connect(self.tokenButtonFunction) self.connectButton.clicked.connect(self.connectButtonFunction) self.disconnectButton.clicked.connect(self.disconnectButtonFunction) self._ngrok_tunnel = None @property def ngrok_tunnel(self): return self._ngrok_tunnel def tokenButtonFunction(self): set_token_default(self.authTokenField.text()) return def connectButtonFunction(self): self._ngrok_tunnel = open_tunnel( self.portField.text(), self.ip_addressField.text() ) def disconnectButtonFunction(self): if self.ngrok_tunnel is not None: tunnelname = get_tunnel(self.ngrok_tunnel) close_tunnel(tunnelname)
  • Pyside2 over LinuxFB/DRM

    Locked Unsolved
    2
    0 Votes
    2 Posts
    314 Views
    SGaistS
    Hi, Please do not post the same question in multiple sub forum, one is enough. Duplicate Closing this one
  • Odd issue, thread worker & timmer not running properly

    Unsolved pyside2 python
    10
    0 Votes
    10 Posts
    1k Views
    D
    @kshegunov said in Odd issue, thread worker & timmer not running properly: Does the timer start at all? Does the thread start at all? the timer.start() gets called. But after that silence... Maybe everything gets deleted somewhere?
  • QWidget is not updated at the right time

    Solved
    6
    0 Votes
    6 Posts
    875 Views
    jsulmJ
    @Mikeeeeee As @SGaist told you you are blocking the event loop. Please take time to learn event driven/asynchronous programming! The way you should do your task: Start your thread Emit signals from that thread every time you need to update UI and pass needed information as signal parameters In UI thread connect a slot to the above signal and update UI in that slot Do NOT wait for the thread (remove thtred.join()) No need for QCoreApplication.processEvents() with this approach
  • Pyside6 - QSqlRelationalTableModel issue updating a row.

    Solved
    2
    0 Votes
    2 Posts
    547 Views
    T
    I found the solution here: https://forum.qt.io/topic/75274/qsqlrelationaltablemodel-does-not-update/2 My table did not have a primary key so I added a column id integer primary key which fixed the problem.
  • Is there a way to set size hints?

    Unsolved
    8
    0 Votes
    8 Posts
    4k Views
    D
    I have reasons for using a grid that are not shown in this simple example. Widgets can be aligned vertically or horizontally. Some Labeled_Controls have more than 1 row of widgets. The flexibility of the grid layout makes this easier. I tried using combinations of horizontal and vertical box layouts. That turned out more complicated and the results were not good. I will investigate using setColumnWidth for the grid layout. I really wish I could find a way to tell the grid layout to update . This works but I cannot stand it. def same_as(self, pattern): """Make my layout like pattern""" self.size_ref = pattern self.prefix.setText(self.prefix.text()) # Yuck!
  • How to create an ImageProvider with PySide6?

    Solved pyside
    7
    0 Votes
    7 Posts
    2k Views
    X
    @JonB What makes you think that? Anyhow, behaviour is the same without the parent argument. PySide6.QtCore.QObject isn't a direct base class of GenericImageProvider.
  • How to change the order of row in QtableWidget.

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    jsulmJ
    @yashi95 said in How to change the order of row in QtableWidget.: Please can you suggest to me what I will do? You will hopefully read documentation: https://docs.python.org/3/tutorial/datastructures.html (hint: list.append(x)) And also keep in mind that Python is not strongly typed. The fact that you first assign an empty list to rowItems doesn't mean it will stay a list and you assign a value to it which is not a list as @JonB already explained.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • How to remove the "confirm save as dialog box" from QFileDialog

    Unsolved
    3
    0 Votes
    3 Posts
    850 Views
    D
    @mrjj, Thanks for the reply. defaultSaveDir is an argument passed during running the script. (Argument Parser). But I found another way to set the DefaultSaveDir. If anyone wants to eliminate this behavior: Go to the "OpenDirDialog" function and set defaultDirPath as targetDirPath. This will do the trick. This is only helpful though if you want to save the annotation files (XML files) in the same directory as that of images. This is a workaround.
  • shiboken2 DLL Loading Problem

    Solved
    7
    0 Votes
    7 Posts
    3k Views
    Andy314A
    @SGaist said in shiboken2 DLL Loading Problem: Try installing a previous version. I have tested a lot of PySide versions but nothing helps. Then in the source-code I found a hint to a libshiboken.dll. Under this topic you can find more in the net net. The solution was Python 3.8.7.
  • setVisible() doesn't occur immediately

    Solved
    2
    0 Votes
    2 Posts
    587 Views
    SGaistS
    Hi, setVisible will schedule an update to happen when the event loop can do it. Even loop that you block with your lengthy calculation. You might want to consider using QtConcurrent::run to avoid blocking your GUI.
  • Item gets duplicated in the model after drag-n-drop in QTreeView

    Unsolved
    2
    0 Votes
    2 Posts
    631 Views
    M
    Looks like this is the expected behavior, and it's described here: https://stackoverflow.com/questions/52873025/pyqt5-qlistview-drag-and-drop-creates-new-hidden-items When an item moves from position i to position j, what is done is: Insert an item in position j Copy the data to the new item, at this moment the itemChanged signal is emitted and therefore you see that there are elements of more Delete the item that was in the position i. So my question is: which method should I use to save the data after the item in the position i was deleted? At the moment it looks like I have to save the data in one of the 2 places: in dropEvent() of my TreeView in a method called by itemChanged() of the model, where I'll have to compare the model indexes to distinguish between the new and the old position of the element
  • application scripting with Python versus QJSEngine

    Unsolved
    1
    0 Votes
    1 Posts
    257 Views
    No one has replied
  • 0 Votes
    9 Posts
    3k Views
    JonBJ
    @jazzycamel Dear camel, Now that this topic is resolved.... In your signature you have: 3. I know how super() works I well-remember when and why you appended this over a year ago, because of a "difficult" Python/PyQt5 user we had on this site at the time! (I had had similar run-ins with that user.) Purely FYI, that user got "removed", so you could risk removing this from your sig now ;-) All the Best.