pyside

Python/Matplotlib/Pyside Fast Timetrace scrolling

有些话、适合烂在心里 提交于 2019-12-06 05:06:35
I have large time-traces that must be inspected visually, so I need a fast scrolling tool. How can I achieve the fastest Maplotlib/Pyside scrolling? Right know, I added a PySide scroll-bar to a MPL figure and update the x-range of the plot with set_xlim() method. This is not fast enough especially because in the final application I have at least 8 time-traces in different subplots that must all scroll together. A figure of the plot is attached . Is there room for improvement? Here I attach the demo code that demonstrate the relatively low scrolling. It's long but it's almost all boiler-plate

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

我的未来我决定 提交于 2019-12-06 04:18:20
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 from a base class that is derived from QObject, the receiver still receives the signal, but does so on the

Display PDF file with QWebView

断了今生、忘了曾经 提交于 2019-12-06 03:28:00
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, 20, 380, 270)) self.webView.setUrl(QtCore.QUrl("file:///C:/pdf_folder/test.pdf")) self.webView

Toggle QPen for selected items after QGraphicsScene selection change

守給你的承諾、 提交于 2019-12-06 03:27:30
How can I toggle the QPen color for the selected graphicsview items? Ideally I would like to handle this color change in the graphicsview or graphics scene objects rather than directly handling it in the main windows selection event. Any help is appreciated. Currently it will turn the pen color white when the object is selected. I'm not sure how to turn it back avoiding looping through all objects. Is there a way i could add a function in the MyGraphicsView class itself that would handle the color change of the pen for any and all selected items in the graph? Update: More detailed information

Optimising Python QT apps on retina displays

和自甴很熟 提交于 2019-12-06 01:38:09
Qt interfaces currently look horrible on a retina display as they scale up.Its possible to use an Info.Plist for a complied application but does anyone have a solution for dynamic python such as interfaces created in PySide? djf You didn't say what Qt version you're working with. Retina support is best in the latest release, Qt v5.1. but v5.0's is also pretty good. If you're still on Qt v4.8, you'll have to manually apply patches to enable high DPI. High DPI mode is controlled by the following keys in the Info.Plist file: <key>NSPrincipalClass</key> <string>NSApplication</string> <key

How to properly delete a matplotlib figure embedded in a child window in PySide to free memory

泄露秘密 提交于 2019-12-05 21:48:56
The Problem : I have an application, from which I open a modless child window by clicking on a button. This child window contains an embedded matplotlib figure. I would like this child window to be destroyed, along with the matplotlib figure, after is has been closed. The problem is that, even though the child window seems to be properly deleted on the Qt side, there seems to be no memory deallocated from the process. The problem seems to be cumulative, i.e. the memory taken up by my application increases if I open multiple child windows and then close them manually with 'X'. My system :

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

主宰稳场 提交于 2019-12-05 20:55:18
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.QtGui import * import multiprocessing import time import sys def f(x): '''This is a time-intensive

Pyside applications not closing properly

筅森魡賤 提交于 2019-12-05 18:26:55
I recently took up GUI programming in PySide and I'm having trouble with an oddity regarding exit commands. Sys.exit([x]) seems to be widely used to stop a PySide program; whenever I use it in a PySide program using classes, however, it doesn't return an exit code to PyCharm or stop the Python process in the task manager. Oddly enough it seems it's incredibly hard to do either of these things when using PySide; I could break out of the main loop, call sys.exit(0) , raise SystemExit(0) and it wouldn't stop running in the background. This only happens when using PySide, and only when using

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

送分小仙女□ 提交于 2019-12-05 16:30:24
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, Bundling data files with PyInstaller (--onefile) I have rtfm and most of it goes above my head unfortunately.

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

别来无恙 提交于 2019-12-05 12:05:21
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 = '' if wait: QTimer.singleShot(wait * SEC, app.quit) else: self.loadFinished.connect(app.quit) self