pyside

PyQt or PySide - which one to use [closed]

霸气de小男生 提交于 2019-12-02 14:48:36
I started learning a bit of python and would now like to toy around a bit with gui-building. Qt seems to be a good choice because of its cross-platformishness. Now there seem to be two bindings available: PyQt by Riverbank Computing and PySide, originally developed by Nokia. So which one should I choose? All I can find are two year old feature comparisons, but what differences are there nowadays? Which one is easier to use, has more/better documentation? Are both still in active development? Licensing isn't of much concern to me since I don't intend to write commercial applications. Both

PYQT: How to capture output of python's interpreter and display it in QEditText?

自古美人都是妖i 提交于 2019-12-02 12:40:12
问题 With reference to the post here. Can someone give me a detailed explanation on how to append the print statement's output to the QEditext in PYQT... I tried the code given above but it was incomplete and I got: TypeError: connect() slot argument should be a callable or a signal, not 'QTextEdit' In the first file i wrote: from PyQt4 import QtCore class EmittingStream(QtCore.QObject): textWritten = QtCore.pyqtSignal(str) def write(self, text): self.textWritten.emit(str(text)) In a seperate file

QComboBox with autocompletion works in PyQt4 but not in PySide

自作多情 提交于 2019-12-02 12:29:02
问题 I've got a combo box with a custom completer that worked fine in PyQt4, but isn't working in PySide. I have verified that the new completer is replacing the QComboBox's built in completer because inline completion is no longer occurring. However when run with PySide, the completer doesn't popup with a filtered list of options. I've also tried ensuring that all text is all str or all unicode to avoid differences between the PyQt API 1 with QStrings and PySide's use of Python unicode types.

How can I send a list object from a QThread thread to the UI's main thread?

和自甴很熟 提交于 2019-12-02 11:58:41
问题 I have written this example code to try and figure out how to communicate between a background thread, and the main thread. As I understand it, a thread cannot simply interact with the UI or variables existing in a different thread. I would like to grab the list 'data' in the background thread, then display it on 'lbl2' in the UI. If this program is run as is, it will print the result I want on the command line. Data received in background thread = [1, 2, 3, 4, 5] Q1: What is the correct way

PyQt app doesn't exit when i close the window

时光总嘲笑我的痴心妄想 提交于 2019-12-02 10:32:02
问题 Whenever i execute the code and close the window, it closes,but the python console in the IDE doesn't return the exit code,when i try to run it again i get a warning dialog that says something like No python console is selected to run main.py So i have to close the IDE python console, and open a new one, then run the program in the new python console I'm using spyder IDE 64 bits on windows from PyQt4.QtCore import * from PyQt4.QtGui import * import sys if __name__ == "__main__": app =

How to get value from QDialog using multiple class

≡放荡痞女 提交于 2019-12-02 10:22:08
问题 I am currently working in a panel in Nuke 11 that opens a QDialog and I was wondering how to get a value from it into my main class when I close my QDialog ? The QDialog is in a different class. This is a simplified example that shows my problem : import nuke from nukescripts import panels try: ## < Nuke11 import PySide.QtGui as QtGui import PySide.QtCore as QtCore except: ## >= Nuke11 import PySide2.QtCore as QtCore import PySide2.QtGui as QtGui import PySide2.QtWidgets as QtGui from PySide2

How to show image to PYQT with opencv

社会主义新天地 提交于 2019-12-02 08:32:07
问题 Hello I'm new in python and opencv I want to ask, how to show my image in qlabel (pyqt) and i want to convert qlabel to grayscale. import sys from PyQt5.uic import loadUi from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog import cv2 from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import * from PyQt5.QtCore import * class UIProgram(QMainWindow): def __init__(self): super(UIProgram,self).__init__() loadUi("Backpro2.ui",self) #self.image=None self.trainLoadImgBtn

Duplicate stdout, stderr in QTextEdit widget

南楼画角 提交于 2019-12-02 07:39:11
问题 I've been having difficulty with my PySide program for a few days now. I don't think the problem is incredibly difficult because there are answer out there. Problem I have is none of them seem to work for me. I want to 'listen' to the file objects stdout and stderr and output the contents to QText Edit widget while my PySide program is running. Now, I already realise this question (or something similar) has been asked before on here but like I said, can't get it to work for me for some reason

set application name in pyside

喜欢而已 提交于 2019-12-02 07:20:53
I created an Application using Qt Creator/Designer under Windows 8 and Qt 5 it starts as follow class Ui_MainWindow(object): def setupUi(self, MainWindow): #MainWindow.setApplicationName("Facturo-Pro") # this doesn't work MainWindow.setWindowIcon(QtGui.QIcon('icons/app.png')) MainWindow.setObjectName("MainWindow") MainWindow.setMinimumSize(QtCore.QSize(800, 600)) MainWindow.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) i want to set the application name which should be shown on the window title and task bar i tried to use QtCore.QCoreApplication

Duplicate stdout, stderr in QTextEdit widget

不问归期 提交于 2019-12-02 07:17:43
I've been having difficulty with my PySide program for a few days now. I don't think the problem is incredibly difficult because there are answer out there. Problem I have is none of them seem to work for me. I want to 'listen' to the file objects stdout and stderr and output the contents to QText Edit widget while my PySide program is running. Now, I already realise this question (or something similar) has been asked before on here but like I said, can't get it to work for me for some reason and most other solutions out there are based on the one that I can't get working, so a very