pyside

Getting PySide Hello App to run under Canopy

青春壹個敷衍的年華 提交于 2019-12-23 01:54:56
问题 A Canopy user here learning about PySide. When I run the demo code below, QApplication complains the event loop is already running.' import sys from PySide.QtCore import * from PySide.QtGui import * # Create a Qt application #app = QApplication(sys.argv) #QApplication complains an instance already exists app = QApplication.instance() #So we just ask for the instance. #app.aboutToQuit.connect(app.deleteLater) # Create a Label and show it label = QLabel("Hello World") label.show() # Enter Qt

QUiLoader.createWidget equivalent in PyQt

…衆ロ難τιáo~ 提交于 2019-12-22 23:42:28
问题 I have a PySide application that I'm investigating making compatible with PyQt4. Obviously this shouldn't be too difficult, but I'd like to minimise the number of code changes necessary. The biggest difference I've come across (which affects my program) is the fact that PyQt does not wrap the QUiLoader class. Now I realise that I can still load ui files with the uic module in PyQt, however I'm currently using a subclass of QUiLoader in PySide that implements some custom functionality that I'd

QUiLoader.createWidget equivalent in PyQt

家住魔仙堡 提交于 2019-12-22 23:42:03
问题 I have a PySide application that I'm investigating making compatible with PyQt4. Obviously this shouldn't be too difficult, but I'd like to minimise the number of code changes necessary. The biggest difference I've come across (which affects my program) is the fact that PyQt does not wrap the QUiLoader class. Now I realise that I can still load ui files with the uic module in PyQt, however I'm currently using a subclass of QUiLoader in PySide that implements some custom functionality that I'd

Derived classes receiving signals in wrong thread in PySide (Qt/PyQt)

折月煮酒 提交于 2019-12-22 09:50:45
问题 I'm having problems getting a derived class to receive signals properly in PySide. I'm using a transmitter and a receiver on two separate threads from the main (GUI or command-line application) thread. The threads are QThread objects. The transmitter and receiver are moved immediately after creation to their thread using QObject.moveToThread(). If the receiver is derived directly from QObject, all works fine, and the receiver receives within its thread. However, if the receiver is derived

Display PDF file with QWebView

你离开我真会死。 提交于 2019-12-22 09:26:56
问题 I would like to display a window with a QwebView widget in Pyside. For this I use some code generated by QtCreator: #code generated by QtCreator: from PySide import QtCore, QtGui class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(400, 300) self.centralWidget = QtGui.QWidget(MainWindow) self.centralWidget.setObjectName("centralWidget") self.webView = QtWebKit.QWebView(self.centralWidget) self.webView.setGeometry(QtCore.QRect(10,

Non-pixelized rounded corner for top-level window

二次信任 提交于 2019-12-22 08:41:01
问题 I want to set rounded corners on a QDialog. Since it is a top-level window, border-radius doesn't work, so I've to do this : QRegion EnterPinDialog::roundedRect(const QRect& rect, int r) { QRegion region; // middle and borders region += rect.adjusted(r, 0, -r, 0); region += rect.adjusted(0, r, 0, -r); // top left QRect corner(rect.topLeft(), QSize(r*2, r*2)); region += QRegion(corner, QRegion::Ellipse); // top right corner.moveTopRight(rect.topRight()); region += QRegion(corner, QRegion:

How to include icons in application when using Pyinstaller 2.0 ,PySide 1.1.2 Bindings and Qt 4.8

我是研究僧i 提交于 2019-12-22 08:40:01
问题 what script looks like what working app should look like Before posting I have looked at the following question and tried to use it as a guide to make my script work properly but it was of marginal use PyInstaller won't load the PyQt's images to the GUI the best it did was include my icons in the resulting directory as follows (icons included image here) and the following one I have no idea what it is even saying but I feel it can solve my problem if I knew what it was actually doing,

HTML page vastly different when using a headless webkit implementation using PyQT

三世轮回 提交于 2019-12-22 07:39:12
问题 I was under the impression that using a headless browser implementation of webkit using PyQT will automatically get me the html code for each URL even with heavy JS code in it. But I am only seeing it partially. I am comparing with the page I get when I save the page from the firefox window. I am using the following code - class JabbaWebkit(QWebPage): # 'html' is a class variable def __init__(self, url, wait, app, parent=None): super(JabbaWebkit, self).__init__(parent) JabbaWebkit.html = ''

HTML page vastly different when using a headless webkit implementation using PyQT

自古美人都是妖i 提交于 2019-12-22 07:38:27
问题 I was under the impression that using a headless browser implementation of webkit using PyQT will automatically get me the html code for each URL even with heavy JS code in it. But I am only seeing it partially. I am comparing with the page I get when I save the page from the firefox window. I am using the following code - class JabbaWebkit(QWebPage): # 'html' is a class variable def __init__(self, url, wait, app, parent=None): super(JabbaWebkit, self).__init__(parent) JabbaWebkit.html = ''

QLabel() won't load a pixmap if it is a JPG image

我怕爱的太早我们不能终老 提交于 2019-12-22 05:08:44
问题 I am trying to have a QLabel() display a pixmap JPG image from a file (which can't be in a resource file since it is downloaded from the web), but I am having problems loading it. The code is fairly simple: label = QLabel() label.setPixmap(QPixmap("image.jpg")) It works with PNG files, but it doesn't work with JPG files. I have Googled quite a bit and found that I needed to place the "imageformats" folder in the same folder where my script is located. However, even after doing this (and yes,