According to the docs “If source is zero, this probe will be deactivated” But calling setSource(0) gives the following exception: Im running my code on raspberry pi 4 with Rpi Os Bullseye 64bit and PySide2 version 5.15.2. Example code: Answer The source object can be cleared like this: In C++, passing zero to a pointer argument means the function will
Tag: pyqt5
How to call a function periodically while my MainWindow is active?
I have tried doing it with multiprocessing module to no avail. I get the following error: TypeError: cannot pickle ‘MainWindow’ object Answer the proper way to do this is to not use any sort of parallel mechanism, instead use QTimer.singleshot, as QT doesn’t work well with multiprocessing or threading, and if you want to repeat it then you can just
QDockWidget does not dock any longer on doubleclick in pyQt5
I had a solution in pyQt4 to undock-dock a tab from/to a QTabWidget by using QDockWidgets and the code below. After floating a tab, the re-docking was obtained by double clicking the titlebar of the QDockWidget. But it does not work any more in pyQt5 (the double-click does not seem to trigger a topLevelChanged event). Why? How to fix it
Trio + PyQT5 in one program?
How can I use trio in conjunction with PyQT5? The thing is that my program has interface written using PyQT5, and now I need to run eventloop trio, to work with the network, because I use trio WebSocket to connect to the server. I read that I should use trio.lowlevel.start_guest_run for this purpose. But in the documentation it says that
How to merge two images in openCv(python)? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 months ago. Improve this question I extracted Red channel at this image and I created a rectangle for this image I want to blending as merge this two images and
PyQt5/Pyqtgraph Get Numpy Array for What is Currently on the Scene
I have a pg.GraphicsLayoutWidget with some images and some ROIs displayed . I would like to get obtain a numpy array for what is currently on the scene, just like the export command in the context menu of the viewbox . Let an arbitrary RGB image (i.e. a numpy array) image be given. For example , I am using https://drive.google.com/drive/folders/1ejY0CjfEwS6SGS2qe_uRX2JvlruMKvPX?usp=sharing
how to do a pagination bar in PyQT?
I need to paginate data from SQL tables. I cant find any information about pagination in PyQT or Pyside. Can you help me pls? Answer One way to handle pagination is to use the QStackedWidget for emulating the pages themselves, and regular QLabels as the page links. Then you can override each labels mousePressEvent to emit a signal to the
Returning value from ListWidget Selection in another class – PyQt5
I’m working on a script where when a user clicks on a button, a pop-up window will appear that contains a list. When the user doubleclicks on an item from that list, a label will populate on the original window with the selection. I’ve got most of the code working, but I’m having trouble on returning the selected value from
How to switch off selection when QTableWidget loses focus
I’m making a GUI in PyQt5 which has a QTableWidget. Is there some way to get rid of the gray selection of the previous selected cell after moving focus from this QTableWidget to another widget in the GUI? Answer You can use the palette to control the colour of the inactive selection. Setting it to transparent would seem the best
Best way of getting Qt pushbuttons Icons information in python?
Im developing a PyQt application which modifies buttons icons dynamically. The icons are created with QStyle, stored as class parameters and then put into the buttons with the setIcon() method. Since the icons are modified dynamically, i want an elegant way of checking what is the current button icon. The original Qt documentation mentions the setIcon() method but i couldnt