pyside

Loading QIcons using pkgutil

僤鯓⒐⒋嵵緔 提交于 2020-01-14 06:16:17
问题 I am attempting to load in images I can't figure out how to load the images using pkgutil.get_data() which I would prefer to use since I don't want to have fixed paths in my code. Currently, I have something like this, which works only when running out of the same folder. ... self.imagePixmap = QtGui.QPixmap("img/myImage.png") ... The issue then is, if you run the script from other folders the path is messed up and you get this error: QPixmap::scaled: Pixmap is a null pixmap I would like to

Set Vertical Alignment of QFormLayout QLabel

折月煮酒 提交于 2020-01-14 02:09:11
问题 I'm using PySide/PyQt, but this is a general Qt question. Is there a way to set up a QFormLayout so that labels are centered vertically without having to explicitly create the QLabel's and set their vertical size policy to expanding first? When the widget in column 2 is taller than my label, I want my label to be centered vertically with the widget, rather than aligned with it's top... Here's an example script that demonstrates the problem. I've colored the labels red to better demonstrate

Can't hide or disable the close button on QWizard

不想你离开。 提交于 2020-01-13 10:23:09
问题 A QWizard dialog by default has a context help [?] and a close [X] button in the top right corner. I can hide the context help button, but I can't get the close button to disappear using setWindowFlags . For example: # preserves current window flags but removes context help button self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) # has no effect self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowCloseButtonHint) Anyone know why this is? 回答1: The

PySide: How Could I trigger the current clicked QPushbutton, not other later added

南笙酒味 提交于 2020-01-13 07:12:32
问题 I am new to PySide. In my program, I encountered a problem that when I click one button, it triggers other button later added. Thanks! self.addContentButton = QtGui.QPushButton('Add') self.addContentButton.clicked.connect(self.addContent) def addContent(self): ''' slot to add a row that include a lineedit, combobox, two buttons ''' self.contentTabHBoxWdgt = QtGui.QWidget() self.contentName = QtGui.QLineEdit('line edit') self.conetentTypeBox = QtGui.QComboBox() self.conetentTypeBox.addItem(

Pyside with Python 3 Mac OS 10.8

♀尐吖头ヾ 提交于 2020-01-13 06:43:11
问题 I'm new at programing but I tried to find the answer for a week and could not solve my issue that seems to be easy. I have a Macbook air with OS 10.8 and installed via Brew Python3 and Pyside using: brew install pyside --with-python3 It install ok but when I try to import Pyside from terminal or from Pcharm it says: File "", line 1, in ImportError: No module named 'pyside' I know that it may seem simple, but I tried everything I found in the web but nothing works. This time I reinstall a

connection of Pyside QPushButton and matplotlib

你说的曾经没有我的故事 提交于 2020-01-13 05:01:19
问题 I'm trying to develop a very simple pyside/Qt program using matplotlib. I want that a graph is draw when a button is pressed. So far, I can draw something on the constructor, but I can't connect the Pyside event with matplotlib. Is there a way to do that? import sys import platform import numpy as np import PySide from PySide.QtGui import QApplication, QMainWindow, QTextEdit,\ QPushButton, QMessageBox, QWidget, QVBoxLayout from PySide import QtCore __version__ = '0.0.1' import matplotlib

connection of Pyside QPushButton and matplotlib

落爺英雄遲暮 提交于 2020-01-13 05:01:12
问题 I'm trying to develop a very simple pyside/Qt program using matplotlib. I want that a graph is draw when a button is pressed. So far, I can draw something on the constructor, but I can't connect the Pyside event with matplotlib. Is there a way to do that? import sys import platform import numpy as np import PySide from PySide.QtGui import QApplication, QMainWindow, QTextEdit,\ QPushButton, QMessageBox, QWidget, QVBoxLayout from PySide import QtCore __version__ = '0.0.1' import matplotlib

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

一笑奈何 提交于 2020-01-12 09:56:31
问题 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

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

江枫思渺然 提交于 2020-01-12 09:55:51
问题 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

How do I achieve consistent highlighting of QListWidget items across widget states?

早过忘川 提交于 2020-01-12 05:28:06
问题 I am using PyQT 4.8.3 to create a dialog with two QListWidgets both allowing multiple selection. I find that if these QListWidgets are enabled, the selected items are highlighted in blue only when the QListWidget has focus, without focus the highlight is light-grey. I also find that if the QListWidgets are disabled, the selected items are highlighted in blue despite lack of focus. As the users go from one list to the other they will find this very confusing. As a developer I find the light