pyside

You need a shiboken-based type

妖精的绣舞 提交于 2020-06-27 03:59:17
问题 When i run the code i get the following error line 11: You need a shiboken-based type. Not sure what i am doing wrong here . When i run just the GetMayaWindow() its runs properly but when run it in init its gives me error import shiboken from PySide import QtGui import maya.OpenMayaUI as apiUI from cStringIO import StringIO import pysideuic import xml.etree.ElementTree as xml def GetMayaWindow(): ptr = apiUI.MQtUtil.mainWindow() if ptr is not None: return shiboken.wrapInstance(long(ptr),QtGui

You need a shiboken-based type

北城以北 提交于 2020-06-27 03:58:59
问题 When i run the code i get the following error line 11: You need a shiboken-based type. Not sure what i am doing wrong here . When i run just the GetMayaWindow() its runs properly but when run it in init its gives me error import shiboken from PySide import QtGui import maya.OpenMayaUI as apiUI from cStringIO import StringIO import pysideuic import xml.etree.ElementTree as xml def GetMayaWindow(): ptr = apiUI.MQtUtil.mainWindow() if ptr is not None: return shiboken.wrapInstance(long(ptr),QtGui

PySide make QDialog appear in main window

杀马特。学长 韩版系。学妹 提交于 2020-06-01 02:36:25
问题 I've created an app which has an main window and the possibility to open an dialog (question, error and so on). I'm not using QMessageBox.warning() or QMessageBox.question() and so on because I wanted to customize the dialogs a bit. But every time I open a new Dialog, in the Windows task bar (I'm working on Windows 10) a new 'tab' is opened, which is a little bit annoying. My code (shortened): from PySide import QtCore, QtGui import sys class MessageBox: def __init__(self, title, message):

PySide: QListWIdget item disappearing when I remove and add item sometimes

依然范特西╮ 提交于 2020-05-24 07:29:13
问题 The bounty expires in 2 days . Answers to this question are eligible for a +50 reputation bounty. Shock-o-lot wants to draw more attention to this question. I have a QListWidget with custom widgets. I am seeing an issue where if I do the following: add two items Remove the second item Add another item then the first item's widget contents disappears until I either resize the window, or add a third item. import sys from PySide.QtGui import * from PySide.QtCore import * class StagingWidget

connect function in pyqt5 does not work

坚强是说给别人听的谎言 提交于 2020-05-24 04:17:05
问题 I recently moved from pyside to pyqt5 and there is a problem. I looked it up online and apparently, it already happened to people who used pyqt4 and moved to pyqt5 . However, it didn't really help... I tried to add pyqtSignal after Qobject but it is still not working. Please help. these are my code lines: QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"),Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject) and this is what appears

Python 'called with the wrong argument type' error

こ雲淡風輕ζ 提交于 2020-05-23 21:36:10
问题 I understand why I am getting this error, it's looking for my object as an argument, and receiving a string value. But I'm confused as to what the solution would be? The following code snippet is simply trying to run this command; self.buttonGroup.addButton(self.ui.m001) x number of times: num = 0 range_ = 10 prefix = "m" for i in range (range_): if num <(range_-1): numString = "00"+str(num) if (num >9): numString = "0"+str(num) button = "self.ui."+prefix+numString self.buttonGroup.addButton

Pyside Qpixmap not working

こ雲淡風輕ζ 提交于 2020-05-23 11:37:45
问题 I am new to pyside and I am following a tutorial at http://zetcode.com/gui/pysidetutorial/widgets2/. I am trying to get an image to show in a window. It seems that I should be able to pass in a file location for a picture on my computer, but no matter what I do I can't seem to get it to display the file I pass in. Any help would be greatly appreciated. Thanks! import sys from PySide import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self

Pyside Qpixmap not working

北城以北 提交于 2020-05-23 11:37:08
问题 I am new to pyside and I am following a tutorial at http://zetcode.com/gui/pysidetutorial/widgets2/. I am trying to get an image to show in a window. It seems that I should be able to pass in a file location for a picture on my computer, but no matter what I do I can't seem to get it to display the file I pass in. Any help would be greatly appreciated. Thanks! import sys from PySide import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self

Signal a QTreeWidgetItem toggled checkbox

不问归期 提交于 2020-05-23 09:48:44
问题 How do I check if a checkbox is checked or unchecked? (In QTreeWidget) shows how to get the status of the checkbox on a qtreewidget item. Using that method, with a signal for itemClicked in the Tree, I can query if the selected item is checked or not. However, I then need to keep track of this item to see if it was previously checked or not. Is there a method for knowing that a QTreeWidgetItem, which may be at different levels from the parent items, has a toggled checkbox, without making a

Is there a way to overlay multiple items on a parent widget (PySide/Qt)

别来无恙 提交于 2020-05-15 04:05:25
问题 I have a main parent widget, and I want several layouts on top of the parent widget. Initializing a layout with a parent widget will place the layout on top of the parent widget. I like this and would like to do it multiple times (left, top, bottom, and right sides) for the same parent widget. I used a QGridLayout with different sub layouts, but this caused the layouts to resize and forced them to be small. Whatever Overlay is added last should be on top of the other items. Below is a very