pyside

How to sort items in Qt QListview using Qt.UserRole

穿精又带淫゛_ 提交于 2020-01-06 01:51:54
问题 I'm having some problem sorting the items in my QListView using values in a field I specified. Basically what I'm trying to do is this: Detect faces in a collection of photos and display them in a QListView Cluster the faces (images) Update the view by placing items in the list (which are face images) belonging to the same cluster in together. Concretely, if item 1, 3, 5 are in one cluster and items 2, 4, 6 are in another, then items 1, 3, 5 should be displayed (in whatever permutations)

Issue while trying to copy pyside object

蓝咒 提交于 2020-01-05 02:36:08
问题 I am having a rather frustrating problem using pyside and I would welcome any advice. First, some context I have created a simple GUI using Qt Designer and I have used pyside-uic.exe onto my .ui file in order to generate the associated Python file. I am using Python 3.3 and pyside 1.2.1 with Qt Designer 4 ( Qt 4.8.5 ). I am using the following code to launch my GUI: class my_dialog(QMainWindow, my_gui.Ui_main_window): def __init__(self, parent=None): super(my_dialog, self).__init__(parent)

Disabled QToolButtons inside QScrollArea prevent scrolling (PySide)

邮差的信 提交于 2020-01-04 05:57:10
问题 I would like to be able to scroll with the mouse inside QScrollArea regardless if the mouse is positioned above disabled QToolButton or not. The documentation mentions disabled widgets don't propagate mouse events to parents and i figured it out i need to install event filter to overcome this issue i am experiencing. This is how far i managed to do it. I think the event filter is installed as wheel event is detected but i am not sure what should be the next steps: from PySide import QtGui

reading pyqt stylesheet from external qss file

谁都会走 提交于 2020-01-03 16:14:26
问题 I have made a qss file of pyqt stylsheet and how am i supposed to call the file content and fed to self.setStylesheet(..) from PyQt4 import QtCore s = QtCore.QString('c:\myProject\darkFantasy.stylesheet') the above code loads the path string rather than the actual stylesheet. So how do I load the actual content of the stylesheet file..? should I read it using the open file in read mode ? 回答1: alright figured out the answer myself I hope it helps everyone: sshFile="darkorange.stylesheet" with

reading pyqt stylesheet from external qss file

浪尽此生 提交于 2020-01-03 16:13:52
问题 I have made a qss file of pyqt stylsheet and how am i supposed to call the file content and fed to self.setStylesheet(..) from PyQt4 import QtCore s = QtCore.QString('c:\myProject\darkFantasy.stylesheet') the above code loads the path string rather than the actual stylesheet. So how do I load the actual content of the stylesheet file..? should I read it using the open file in read mode ? 回答1: alright figured out the answer myself I hope it helps everyone: sshFile="darkorange.stylesheet" with

PySide/PyQt Overlay widget

若如初见. 提交于 2020-01-03 03:18:14
问题 I am trying to achieve something like this in PySide: https://codepen.io/imprakash/pen/GgNMXO What I want to do is create a child window frameless with a black overlay below. I didn't succeed to create a child window frameless and the overlay... This is a base code to replicate the HTML: from PySide import QtCore, QtGui import sys class MainWindow(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) self.resize(800, 500) self.button = QtGui.QPushButton("Click Me") self.setLayout

Qt - pyside - saveGeometry() saveState()

谁都会走 提交于 2020-01-02 16:01:24
问题 I have a Qt program and currently I use the Qsettings.saveGeometry() and Qsettings.saveState() functions to allow the program to restore the layout that the user set in the previous session. However not all geometry is saved, only the main window and not the children especially floating position of docked windows and table column widths within docked windows. This thread seems to attempt to provide an answer (but in C++ and not python): http://www.qtforum.org/article/38362/save-geometry-of

Qt - pyside - saveGeometry() saveState()

僤鯓⒐⒋嵵緔 提交于 2020-01-02 16:01:20
问题 I have a Qt program and currently I use the Qsettings.saveGeometry() and Qsettings.saveState() functions to allow the program to restore the layout that the user set in the previous session. However not all geometry is saved, only the main window and not the children especially floating position of docked windows and table column widths within docked windows. This thread seems to attempt to provide an answer (but in C++ and not python): http://www.qtforum.org/article/38362/save-geometry-of

How to use multiprocessing.Pool correctly with PySide to create a non-blocking GUI

戏子无情 提交于 2020-01-02 07:13:45
问题 I am try to use multiprocessing to create a non-blocking GUI. The function Multiprocessing.Pool.appy_async() allows a callback function to be added, making it easy to update the main GUI after a time-intensive operation has been completed. However, the following code still blocks when clicking on button1. How can I modify this so that while the button1 callback is executing, button2 still responds. I am running python 2.7 and multiprocessing 0.70a1. from PySide.QtCore import * from PySide

PySide SVG image formats not found?

可紊 提交于 2020-01-02 02:51:49
问题 I am using PyDev plugin for Eclipse with Qt integration. I have PySide installed and I am having trouble with SVG image formats. I know when I run my application the formats located in C:\Python27\Lib\site-packages\PySide\plugins\imageformats are found. All but the SVG format. I can remove the qico4.dll and it no longer finds them and put it back in and it finds them again. I am using this line in my code: plugs = QtGui.QImageReader.supportedImageFormats() It finds all of the formats except