Questions tagged [pyside]

Questions about using PySide, a Python Qt bindings project.

The PySide project provides LGPL-licensed Python bindings for the Qt cross-platform application and UI framework. PySide Qt bindings allow both free open source and proprietary software development and ultimately aim to support all of the platforms as Qt itself.

3517 questions
1
vote
1 answer

How to modify the value from a QDataWidgetMapper

So I'm using a QDataWidgetMapper to map values from a QSqlQueryModel to widgets in my interface. This is working nicely, and each time my Model is updated or refreshed the widgets are updated too... Great! But let's say that I have a QLabel... and…
iGwok
  • 323
  • 5
  • 18
1
vote
1 answer

PyQt4 : How to use Qt.ItemIsTristate to automatically select children with QTreeView?

I've used in the past the Qt.ItemIsTristate flag with a QTreeWidget to automatically select children when an item is selected by the user. Here is an example with QTreeWidget : import sys from PyQt4 import QtGui, QtCore from PyQt4.QtCore import…
Elby
  • 11
  • 2
1
vote
1 answer

how to create new window with flask-desktop

Searching on GUI-based http server (as I need to do some GUI notification from my program, when rest GET would be catched). Found this solution. How to do something like this properly (variant below isn't work): @app.route('/') def main(): #…
Juriy
  • 565
  • 1
  • 5
  • 17
1
vote
1 answer

Basemap / PySide QWidget: Drawing text onto map

I'm having difficulty writing text onto a Basemap that is inside a PySide QWidget. From what I've found online, people do the following: import matplotlib.pyplot as plt ... plt.text(x, y, 'some text') But when I try something like that with my…
1
vote
1 answer

PySide / PyQt: How to auto-tab into the next entry field

How do you make a lineEdit widget automatically tab into the next lineEdit widget after you're done filling it? I've set a lineEdit widget to have a max length with self.lineEdit.setMaxLength(4)) so you can enter a maximum of 4 characters. Once this…
Arda Arslan
  • 1,331
  • 13
  • 24
1
vote
1 answer

PySide: Why is File Browser coming up automatically, not after button press?

I'm trying to implement a file browser by clicking on a button. My current problem is that when I run this code, the file browser automatically comes up. The relevant parts are: def myChanges(self, MainWindow): …
Arda Arslan
  • 1,331
  • 13
  • 24
1
vote
0 answers

qt MouseDoubleClickEvent doesn't work with QGraphicsView

I have this simple program in qt. It creates 2 small squares with qgraphicsview. One square is "Enabled" at initialization so it is painted blue and the other square is Disabled so it is white at the initialization. When I double click on the…
hiroro
  • 11
  • 1
1
vote
1 answer

QThread blocks in decoding UTF-16 when python code is freezed by cx_Freeze?

In fact, the problem is a serious bug in a huge system, and we simplifiy the problem into code snippet below. We wanna figure out why the thread behaviors are different in python code and exe file. The code includes two threads, and we expect both…
Azure
  • 154
  • 1
  • 10
1
vote
1 answer

PySide: method is not executed in thread context if method is invoked via lambda

I have a Worker object and use its method moveToThread to put it in a thread. Now i call its work method: If I invoke the method directly, it is executed in the thread its object is living in If I invoke the method using lambda, the method is…
johnson
  • 3,729
  • 3
  • 31
  • 32
1
vote
0 answers

Pyside: Updating icons when changing the themeSearchPaths()

I'm currently trying to enable switching the icon theme of an application during runtime. The problem is that I just cant figure out how to trigger the objects to "refresh" their icons and pick them from the new QIcon.themeSearchPaths(). def…
Nico
  • 11
  • 3
1
vote
1 answer

Python logging to PySide widget without delay

Problem: I have a PySide application that already uses logging for console output, but its logging should be extended in a way that LogRecords are also displayed immediately in a widget like a QTextBrowser. I am aware that this would usually be done…
timmwagener
  • 2,368
  • 2
  • 19
  • 27
1
vote
2 answers

When dragging multiple items from QListWidget, non-draggable items get removed

I have two QListWidgets. The user can select multiple items from one list and drag them to the other list. But within each list, some items are draggable and some are not. If the selection contains both draggable and non-draggable items, a…
Becca codes
  • 542
  • 1
  • 4
  • 14
1
vote
3 answers

How to fetch class instance from class variable (from outside the class)?

Let's say I have this: from PySide2 import QtWidgets class MyClass(object): def __init__(self, parent=None): self.class_variable = QtWidgets.QWidget() class_instance = MyClass() variable =…
fredrik
  • 9,631
  • 16
  • 72
  • 132
1
vote
0 answers

Run code in sequence when a worker thread calls a function from the main thread

I have in an application in python a worker thread that prevents the GUI from being frozen, since it requires continuous processing in the application. The worker thread calls the "doing" function on the main thread that often has heavy processing.…
1
vote
0 answers

PySide/PyQt: Keep size of element constant while scaling QGraphicsView

I'm trying to create small GUI application, where user will be able to draw points and curves. I implemented scale option. I would like to scale only paths, not graphic representations of the points (RBNode class). Is there way to scale…
Rafal
  • 83
  • 5