pyside

How to create a filter for QTableWidget?

删除回忆录丶 提交于 2019-12-18 04:29:11
问题 I'm trying to create a filter for QTableWidget with QLineEdit in PySide. I've seen some tutorials using QSortFilterProxyModel for C++ but couldn't understood how to do it in Python. I need to search in 'VALUE' column. 回答1: A QSortFilterProxyModel is a proxy model, that means that you put it between the your complete data model and a view. The comment by titusjan is good, you can look in your local PySide/PyQt installation for basicsortfiltermodel.py to get an example in Python. Also, instead

PySide/PyQt - Starting a CPU intensive thread hangs the whole application

百般思念 提交于 2019-12-17 23:35:15
问题 I'm trying to do a fairly common thing in my PySide GUI application: I want to delegate some CPU-Intensive task to a background thread so that my GUI stays responsive and could even display a progress indicator as the computation goes. Here is what I'm doing (I'm using PySide 1.1.1 on Python 2.7, Linux x86_64): import sys import time from PySide.QtGui import QMainWindow, QPushButton, QApplication, QWidget from PySide.QtCore import QThread, QObject, Signal, Slot class Worker(QObject): done

How to undo an edit of a QListWidgetItem in PySide/PyQt?

Deadly 提交于 2019-12-17 21:10:45
问题 Short version How do you implement undo functionality for edits made on QListWidgetItems in PySide/PyQt? Hint from a Qt tutorial? The following tutorial written for Qt users (c++) likely has the answer, but I am not a c++ person, so get a bit lost: Using Undo/Redo with Item Views Longer version I am using a QListWidget to learn my way around PyQt's Undo Framework (with the help of an article on the topic). I am fine with undo/redo when I implement a command myself (like deleting an item from

Installing PySide for Python-3.6

若如初见. 提交于 2019-12-17 19:37:54
问题 When I try to install PySide for Python-3.6, it says it is only compatible until Python-3.4. Is there any work-around to get it installed for Python-3.6? Only these Python versions seem to be supported: [(2, 6), (2, 7), (3, 2), (3, 3), (3, 4)]. 回答1: Firstly, it should be pointed out that PySide depends on Qt4, which is no longer officially supported (as of December 2015). In consequence, all development efforts are now focused on PySide2 and Qt5. According to this tracker issue, there are no

How to insert a button inside a QLineEdit

人盡茶涼 提交于 2019-12-17 18:47:15
问题 I need help inserting a button inside in a QLineEdit that can call a function. For example, like this google image: 回答1: Below is a nearly direct translation of the Qt code from here. Differences: button is always visible clicking on the button emits buttonClicked(bool) signal Code: from PyQt4 import QtGui, QtCore class ButtonLineEdit(QtGui.QLineEdit): buttonClicked = QtCore.pyqtSignal(bool) def __init__(self, icon_file, parent=None): super(ButtonLineEdit, self).__init__(parent) self.button =

Unit and functional testing a PySide-based application?

空扰寡人 提交于 2019-12-17 17:32:17
问题 I'm building a PySide 1.1.0-based application, and have been looking for good examples to look at for unit and functional testing my application. I want to be able to do functional testing of the UI (simulating clicks, key presses, etc), unit testing of UI slots that alter the layout of the UI (presumably using a partially-mocked sender and receiver), as well as unit testing of code that involves widgets, but without requiring any windows to be rendered. As one example, I dynamically create

AttributeError: module 'subprocess' has no attribute 'mswindows'

大兔子大兔子 提交于 2019-12-16 01:43:04
subprocess.mswindows python2可以使用 >>> import subprocess >>> IS_WIN = subprocess.mswindows >>> IS_WIN False Python3 python3.5把mswindows改名_mswindows了。 >>> IS_WIN = subprocess._mswindows >>> IS_WIN False 参考 Python 3.5 renames subprocess.mswindows #18 https://github.com/PySide/pyside-setup/issues/53 来源: CSDN 作者: 初学编程请多指教 链接: https://blog.csdn.net/sworld_/article/details/103534779

在MacOS10.15上为Python2安装pip

萝らか妹 提交于 2019-12-15 03:44:16
安装过程很简单,两步就能处理: 第一步:下载get-pip.py文件 curl https://bootstrap.pypa.io/get-pip.py >> get-pip.py 第二步:执行安装 sudo python2 ./get-pip.py 顺便安装一个PySide brew install pyside 可以用pip安装PySide,但是中间会安装编译工具,如:cmake等。 来源: CSDN 作者: 天平座射手 链接: https://blog.csdn.net/gunnery/article/details/103462080

PySide. JavaScript. Execute js an get result as a pure text or html

百般思念 提交于 2019-12-14 03:14:22
问题 Would like to get calendar data from page like http://www.dukascopy.com/swiss/english/marketwatch/calendars/eccalendar/ The data is dynamic and loads with js-applet - "DukascopyApplet" I tried to extract data this way: app = QApplication(sys.argv) web = QWebView() web.page().mainFrame().loadFinished.connect(print_content) web.load(QUrl("http://www.dukascopy.com/swiss/english/marketwatch/calendars/eccalendar/")) web.show() frame = web.page().mainFrame() print(frame.evaluateJavaScript(

Unable to click on QRadioButton after linking it with QtCore.QEventLoop()

夙愿已清 提交于 2019-12-13 22:14:56
问题 Few days back i had situation where i had to check/uncheck QRadioButton in for loop. Here is the link Waiting in for loop until QRadioButton get checked everytime? After implementing QEventLoop on this, it worked fine until today. Now i have seen my QRadioButton(pass) button allow me to click on it but not the second QRadioButton(fail). Fail QRadioButton neither gets hang nor disable but its just i am not able to click on it. My QEventLoop code is : #QLoopEvent self.loop = QtCore.QEventLoop()