pyside

PySide import error Mac OS X El Capitan, Library not loaded: @rpath/libpyside.cpython-34m.1.2.dylib

不问归期 提交于 2019-12-03 20:16:29
ive been trying to run an application that was written on a Linux machine (and works without any issues), on my Mac running OS X El Capitan. the program utilizes PyQt4(4.11.4) and PySide (1.2.4), using Python 3.4.2. I created a virtualenv to guarantee that everything runs on the correct version of python. i have sip installed as well. However when i actually try to import anything from PySide it gives me the following error: Traceback (most recent call last): File "GUI.py", line 17, in <module> from PySide import QtCore, QtGui, QtNetwork ImportError: dlopen(/Users/mksmasr/.pyenv/versions/3.4.2

A QApplication instance already exists

主宰稳场 提交于 2019-12-03 18:05:45
问题 I'm doing some simple PySide on 3Dsmax 2015. This is my error: python.ExecuteFile "C:\Program Files\Autodesk\3ds Max 2015\scripts\Python\demoUniTest.py" -- Runtime error: Line 32 <module>() <type 'exceptions.RuntimeError'> A QApplication instance already exists. This is my code: import sys from PySide.QtCore import * from PySide.QtGui import * from math import * class Form(QDialog): def __init__(self,parent=None): super(Form,self).__init__(parent) self.browser = QTextBrowser() self.lineedit =

Installing pyside with python3 on os x

不想你离开。 提交于 2019-12-03 17:07:43
I have tried to install pyside together with python3 on osx mountain lion. I have been trying both brew install pyside But then it only works in python2. I have also tried using the buildscripts from the pyside github rep. Making the changes needed ./build_and_install fails however, with Linking CXX shared library libpyside.cpython-33m.dylib [ 4%] Built target pyside [ 4%] Running generator for QtCore... /bin/sh: /Users/einar/devel/pkg/pyside-sandbox-python3/bin/SHIBOKEN_GENERATOR-NOTFOUND: No such file or directory make[2]: *** [PySide/QtCore/PySide/QtCore/qabstracteventdispatcher_wrapper.cpp

Is deleteLater() necessary in PyQt/PySide?

雨燕双飞 提交于 2019-12-03 16:38:58
问题 Since there is already a Garbage Collector in Python, is deleteLater() necessary in PyQt/PySide? 回答1: It depends what you mean by "necessary". An application could potentially consume a lot of memory if (for example) care is not taken when closing widgets. The QObject-based classes are designed to be (optionally) linked together in a hierarchy. When a top-level object is deleted, Qt will automatically delete all its child objects as well. However, when closing widgets (which are sub-classes

Styling with classes in Pyside + Python

为君一笑 提交于 2019-12-03 16:34:46
How can I better style this app using classes rather than redefining the same styles for every label that should look the same. It makes it a pain to change a style because I then have to go through every label that is suppose to look the same and paste the code to match. #!/usr/bin/python # -*- coding: utf-8 -*- import sys from PySide import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): #Add all GUI Elements to Class self.amountLabel = QtGui.QLabel('Amount') self.counterLabel = QtGui.QLabel('Counter') self

PySide : How to get the clicked QPushButton object in the QPushButton clicked slot?

陌路散爱 提交于 2019-12-03 15:48:52
I am new to PySide. I want to get the QPushButton obj (such as use it to get its text) in its clicked slot. button = QtGui.QPushButton("start go") button.clicked.connect(self.buttonClick) def buttonClick(self): ... # How can I get the button object? # print button.text() how to get the text : 'start go' ? Thanks! qurban Here is what I did to solve the problem: button = QtGui.QPushButton("start go") button.clicked.connect(lambda: self.buttonClick(button)) def buttonClick(self, button): print button.text() You can just use self.sender() to determine the object that initiated the signal. In your

Chained QSortFilterProxyModels

末鹿安然 提交于 2019-12-03 14:54:42
Let's say I have a list variable datalist storing 10,000 string entities. The QTableView needs to display only some of these entities. That's is why QTableView was assigned QSortFilterProxyModel that does all the filtering. After all Proxy work is completed the QTableView "receives" 25 entities to display (so remaining 9,975 entities were "filtered out". Now, I create a QLineEdit to be used as a search field where the user can type a keyword to narrow down the list of the displayed 25 entities (items) even further. For this purpose I link QLineEdit 's textChanged signal to assigned to

How to pan beyond the scrollbar range in a QGraphicsview?

坚强是说给别人听的谎言 提交于 2019-12-03 14:53:00
问题 I am building a node graph in a QGraphicsView and I am currently implementing panning. I used the following question "how to pan images in QGraphicsView" to start but the panning is limited by the scrollbar range. I also tried the translate method but it gives the same result. The view is limited to a certain rectangle. I would like to pan without limits, the graph can becomes quite large and it is useful to be able to work in different area of the scene (one graph here, another graph over

QSettings(): How to save to current working directory

倾然丶 夕夏残阳落幕 提交于 2019-12-03 14:19:35
For an app that can be run directly from a flash/pen/usb/jump/thumb drive, for portability in moving from one machine to another it can make sense for user settings to be stored on the memory stick in the same directory that the program is being run from (rather than Windows/Mac/Linux user or system dirs per machine). QSettings() is handy, however, can it be told to use the current working directory? Here's a little example program that keeps its screen position from run to run using QSettings(): from PySide import QtGui, QtCore from PySide.QtGui import QTabWidget, QApplication from PySide

How to crop a image and save?

孤街浪徒 提交于 2019-12-03 14:15:59
问题 I have opened a image in a QHBoxLayout . I need to crop the opened image and save the cropped image. How I can do this in PySide? import sys from PySide import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): hbox = QtGui.QHBoxLayout(self) pixmap = QtGui.QPixmap("re.png") lbl = QtGui.QLabel(self) lbl.setPixmap(pixmap) self.rect = QtCore.QRect() hbox.addWidget(lbl) self.setLayout(hbox) self.setGeometry(300, 300, 280