Questions tagged [pyside2]

Questions about using PySide2, a Python Qt bindings project for Qt5.

0
votes
0answers
23 views

Force Python Application on top of other windows

I am using Python3 and PySide2 How do I freeze computer and only focus and activate my small python dialog user interface on top of all running application ? Here is my sample code from PySide2 ...
1
vote
1answer
24 views

PySide2 v5.12 : Creating a FileDialog on a click of a button

I designed a basic UI in the QtDesigner. Now i am trying to pop a simple file dialog on click of a button, below given is my GUI Code : from PySide2 import QtCore, QtGui, QtWidgets class ...
0
votes
0answers
19 views

Getting Text from Qtreewidget

I have a QTreeWidget that has three columns. When the user clicks a QPushButton, what they've selected on a QListWidget is added the the QTreeWidget. I want to check if the value selected on the ...
0
votes
0answers
38 views

reading dates with Qdatetime.fromString: what is my mistake? [on hold]

I'm trying to read date, but Qdatetime.fromString returns an invalid object. I don't understand what my mistake is. >>> from PySide2.QtCore import QDateTime >>> s ="2019/03/21 17:...
1
vote
1answer
21 views

How to execute a function on click of empty area of QTreeWidget

I am using Python3.6 and PySide2 I have a treewidget-A populated with employee list. on click on employee (treewidget-A item) a another treeWidget-B will populate. Now if I click on empty area (...
1
vote
1answer
18 views

Add multiple columns inside a tableview cell

I'm trying to create a table that have a column inside a cell. Is there an easy way to implement this design to the table view I'm working with? This is my code right now: class ColumnsLayout(...
0
votes
1answer
58 views

How can I get the maximum and current value of the verticalScrollBar when displaying html with QWebEngineView

I'm attempting to create a UI in Maya (Python 2.7.11 and Maya Qt 5.6.1. and PySide2) where the OK button is grayed out until the user scrolls to the bottom. I can do this easily with QTextEdit by ...
0
votes
0answers
19 views

Register Enums for QML in PySide2

I'd like to export enums from Python to QML using PySide2. It is possible using PyQt5 see PyQt5 && QML exporting enum However the required Q_ENUMS does not exist in PySide2. Is there another ...
1
vote
1answer
22 views

Error with multi column filtering in a QTableView loaded from a pandas dataframe

I'm trying to filter multiple columns with 1 QLineEdit box in a QTableView. I'm using a QAbstractTableModel to do the filtering and I've subclassed QSortFilterProxyModel to handle multiple columns. ...
1
vote
1answer
32 views

How can I change all the points in an XYSeries in qml or PySide2?

I'm kinda new to PySide2 and QML and I really need a way to replace all the points in an XYSeries at once. Since the QML item does not have a function that does so, I thought I had to create a custom ...
0
votes
0answers
19 views

printing QWebEnginePage in PySide2

I have noticed from this docs that the print function is not available in Qt for Python's QWebEnginePage. However it is still available in PyQt5 qtdocs. How do you then go about printing contents of ...
0
votes
0answers
32 views

With Qt is it possible to create a windows 10 apllication which has GTK style?

I'm migrating a python 2 and GTK 2 application to Qt and python 3 on Windows 10. I've converted .glade files to .ui files and dialogs initially look bad as the layout was designed for a gtk style and ...
1
vote
1answer
43 views

QSS not applied to first QSizeGrip in (composite widget) in QVBoxLayout

As shown below, the widget TestWidget contains a QFrame and a CSS-styled QSizeGrip. Several TestWidget instances are placed in a QVBoxLayout from PySide import QtGui, QtCore import sys class ...
0
votes
0answers
23 views

How to create a single-window GUI

What is the best way to accomplish a "Single-Window" GUI in PySide2 (or PyQt if that is more familiar), in the same vein as the old school installation wizards? The two approaches I have thought of ...
2
votes
1answer
37 views

PyQt5 to PySide2, loading UI-Files in different classes

I have a python application which runs under python3.6 and is using PyQt5 for loading Ui windows. These windows were created with Qt Designer 5.9.4. The Code below shows a working example with PyQt5. ...
0
votes
0answers
23 views

How to call a new window in Pyside2

I'm making a program where if you press the button, a new window opens which is located in the same directory as the main window, but I don't know how to connect them with a function. Do I have to ...
1
vote
1answer
19 views

PySide2 | Finding out which QKeySequence was pressed 2

I had a previous question about QKeySequence here. It worked but when I applied it to my code there seemed to be an error when the QKeySequence comes after line when the button click event goes before ...
1
vote
1answer
19 views

PySide2 | Finding out which QKeySequence was pressed

I'm using PySide2 and I want to have multiple shortcuts that carry out the same function but also would depend on which key was pressed. I tried to link the functions as such inside a QMainWindow: ...
1
vote
0answers
27 views

PySide2 with Pyinstaller: Failed to execute script pyi_rth_pkgres

so I have been using Pyinstaller the last couple of months to package and distribute my applications as single exe files, however I recently made the switch from using Tkinter in my GUI apps to using ...
0
votes
1answer
23 views

QMenu only showing on QPushButton when calling QPushButton.menu()

With the code from this example, I don't get the menu on the button. It will just remain a simple button. menu = QMenu() Act1 = QtWidgets.QAction("Action 1", menu) Act1.setCheckable(True)...
0
votes
0answers
34 views

Interacting with Folium Map embeded in PySide2 QWebEngineView

This is my working directory structure myProj folium_Map.py pysideGUI.py map.html So far what i have is , i am using folium to create a map and save it to an html file - map.py. Below is the code ...
0
votes
0answers
25 views

PyQt5 loading ui file directly vs converting ui file to py file

I am just starting with PyQT5 and it appears to me that there are two ways when working with QT designer to use the ui files. One is to load it directly using the uic.loadui() and the other is to use ...
0
votes
0answers
15 views

setProperty in PySide2 doesn't apply the property outside of the __init__ function [duplicate]

I am using a Qt stylesheet property for highlighting fields with invalid inputs. I have a separate validation function that is called on click of a submit button for checking if the inputs are valid. ...
0
votes
0answers
52 views

manipulating widget in PySide2 QThread causes python3 not responding

What I am trying to do is to update the QTreeWidget with another thread in order not to hang the UI. So I make a demo as followed: Environment: win10 x64, Python3.6.8 x32, PySide2 5.12.1 # -*- ...
0
votes
0answers
20 views

pyside2 QT I have a dotted, white line around the icon labels populating my QListwidget, and I would like to get rid of it

I am using Pyside2 and I have a QListWidget populated with icons. The icon labels have a dotted, white line around them. I was hoping to have a cleaner presentation and get rid of that line. I will ...
1
vote
1answer
23 views

would like not clickable/highlighted icons in listWidget

I have QListWidget in Pyside2 that has icons populating it. I dont like the icons taking on a shaded grey look when the mouse clicks them. Is there a way to disable this action? I will include a ...
0
votes
0answers
22 views

what is the syntax for setting the flow of QListWidget in PySide2?

I would like the icons in my QListWidget to go 3 across before dropping down a row. I believe I can do this using the setFlow method, but I am not sure the syntax for PySide2.
1
vote
1answer
28 views

How to access QML\QtQuick controls from PySide?

I'm trying to access a FileDialog control from the python file that starts the QQmlApplication engine in order to retrieve the file path property. I have set up a signal in the .qml file, however I ...
1
vote
2answers
23 views

PySide2 Non-Blocking QMessageBox doesn't show text

While my application does some time-consuming stuff, I want to display a message box to the user while the applications is busy. I don't want any buttons (like OK or Cancel) and I can't call exec_() ...
0
votes
0answers
15 views

Pyside2 - How to group two widgets together?

I need to find a way to group two widgets together, so that if I have one widget, I can easily call for the other widget it is linked to. I have a bunch of QSliders and a QLineEdits, and when one of ...
1
vote
1answer
26 views

How to automatically set rect correctly in QGraphicsView?

I have a couple of different issues that I am trying to solve and I cannot figure out. I have not worked with QGraphicsView etc much before but I created a QGraphicsView that I am trying to load ...
0
votes
0answers
30 views

How do I add the default glowing selection border to a custom QWidget?

I have a custom widget comprised of a QFrame housing a QWebEngineView, which displays a <textarea/> in its HTML. In the following picture, the top widget is a QComboBox, the middle widget is my ...
0
votes
0answers
103 views

MacOS Pyside2 QSystemTrayIcon, left click/right different functions

I would like to know how to do in python/Pyside2: Create a QSystemTrayIcon with a custom icon, in which: If I click left button on it, I do a custom action (just print “left click pressed”). No menu ...
1
vote
1answer
30 views

QSortFilterProxyModel creates blank items

What I'm trying to do: Take items from a model and sort them using a sorting proxy by a different role: Expected output: Real output contains blank lines which shouldn't be there: You can see the ...
1
vote
1answer
35 views

Extending a Widget Loaded from a UI File

I'd like to be able to load a widget (QMainWindow in this case) from a .ui file, but also be able to extend the class so that I can do things like catch keyboard events. For example, I have the ...
0
votes
0answers
25 views

Qt: Installing global event filter when the UI contains a QWebEngineView?

I'm trying to install a global event filter to my application. The eventfilter works fine, as long as there are no QWebEngineView's used. Minimal example: import sys from PySide2 import QtCore, ...
0
votes
1answer
53 views

PyQt5 & PySide2 / Could not load the Qt platform plugin “windows” in “” even though it was found

Development environment 1. Windows 10 / Python 3.6.8 / Pyinstaller 3.4 / PyQt5 5.10 2. Windows 10 / Python 3.6.8 / Pyinstaller 3.4 / PySide2 5.11.0 3. Windows 10 / Python 3.6.8 / Pyinstaller 3.4 / ...
0
votes
0answers
22 views

QGraphicsView behaving differently when mouse is held over a QGraphicsProxyWidget

I have a pyside2 GUI that uses QGraphicsView. I use setDragMode(QGraphicsView.ScrollHandDrag) to make the view dragable, but i override the cursor with viewport().setCursor(Qt.ArrowCursor) on ...
2
votes
1answer
31 views

background color of cells in QTableview, PySide2

Is it possible to conditionally change the background color of items in a QTableView, using PySide2? I've read a lot on the model view framework . I cannot figure out if it is necessary to use a ...
0
votes
0answers
63 views

Python: How to add hooks for controlling (stop/start/pause/resume) an endless loop from a second program?

I have code that starts a while loop and runs until I hard kill it with Control-C. I'd like to make this a bit nicer by adding some way to communicate with the code to make it stop a bit more ...
1
vote
1answer
26 views

difficulty in print(“ok”) whenever I click anywhere in the APP GUI

I used QT Designer to design a GUI, I then imported the .ui file into my python code via : ui_file = QFile(ui_file) ui_file.open(QFile.ReadOnly) loader = QUiLoader() self....
0
votes
1answer
44 views

Python Qt QImage is brightening or darkening the image depending on its contents

I'm using Pyside2, where I am displaying images on the screen as well as editing the images. I'm doing this by creating a QImage object by passing an OpenCV image. The following is the code I'm ...
1
vote
1answer
34 views

How can I send a python dictionary to a QML interface with a Signal?

I want to send dictionaries, containing data that I need to use to dynamically create qml objects, from a PySide2 class to a QML interface and since I need to do it in response to certain events, I ...
0
votes
0answers
42 views

Deploy PySide 2 application

I tried to follow this tutorial to create a portable PySide application. Unfortunately it doesn't work for me. The resulting .exe program won't start with the error message "Failed to execute script ...
0
votes
0answers
22 views

PySide2 Qt5 How to remove window resizing mouse pointer when window size is fixed?

When I create a window in "Qt Designer" (PySide2 Qt5) and set the size of the fixed window, this is not possible to resize the height or width, even if it is not possible for the user to resize the ...
0
votes
0answers
39 views

AttributeError: 'PySide2.QtCore.Qt.Alignment' object has no attribute 'testFlag'

I am using Pyside2. I get the error AttributeError: 'PySide2.QtCore.Qt.Alignment' object has no attribute 'testFlag' for this piece of code if (self.m_alignment.testFlag(Qt.AlignTop)): The ...
1
vote
1answer
18 views

QFileDialog create a filter for all supported image formats

I would like to open a QFileDialog.getOpenFileName with all supported image formats (all file types that I could used to instantiate a QIcon) I already know that I can get all supported image formats ...
3
votes
1answer
49 views

Adding and removing dynamically generated QLineEdit widgets based off of user input from a QComboBox

I'm building an app to 'roll' multiple die of the same face, so if I need to roll 5 8 sided die I select 5 in the QComboBox under the label D8, then 5 QLineEdit widgets pop up with the values of the ...
0
votes
1answer
21 views

Getting a Qt Widget to update a mouse event inside a Qt form made with Qt Designer

I have made a custom QGraphicsView that I'm adding as a widget into an app form I made using Qt Designer. Everything appears to be working including the mouse clicks. The method that does the ...
1
vote
1answer
40 views

How to prevent crashing when running multi-threaded calculations then plotting the emitted results

I am writing a PySide2 app that plots the results to a certain calculation and trying to multithread the calculation to avoid locking up the GUI. I am trying to use QThreadPool to, upon interacting ...

http://mssss.yulina-kosm.ru