pyside

How to get the row under the cursor for a QTableWidget

ぃ、小莉子 提交于 2020-02-03 13:25:47
问题 Is there a way to get the row number under the mouse pointer? I want to remove a row without knowing the row number, but with just the cursor position. EDIT: In This image you can add projects for the Asset Library. When the Delete Bin is clicked the row should be removed. The best way would be to query the ROW number under the Mouse pointer while the bin is clicked. Where the row number is parsed to the removeRow function. I dont know how to make use of the QPointer for that. And cellEntered

Setting up PySide/Qt for GUI development

拈花ヽ惹草 提交于 2020-02-03 10:45:16
问题 I have been trying to setup PySide/Qt for use with Python3.3. I have installed PySide-1.2.0.win32-py3.3.exe that I took from here and I have installed qt-win-opensource-4.8.5-vs2010 that I took from here. I generated .py files from .ui files (that I made using QtDesigner) using pyside-uic.exe as is explained in PySide Wiki. Making .py files was working when I was using Qt5.1/QtCreator. I stopped using it when I found that I need to use Qt4.8 as explained on Qt-forums. With Qt4.8 it isn't

Only move QGraphicsItem when mouse in specific region

雨燕双飞 提交于 2020-02-02 11:11:46
问题 I'm trying to create something similar to terragens node network view in python using PySide. I subclassed QGraphicsRectItem using this code. class Node(QGraphicsRectItem): def __init__(self,pos): QGraphicsRectItem.__init__(self,pos.x()-100,pos.y()-30,200,60) self.setFlag(QGraphicsItem.ItemIsMovable,True) (...) Which gives this (with some fancy painting): I'd like to implent connecting nodes by dragging the mouse from one small rectangle to another, but this results in moving the whole node.

Possible to install PySide or PyQt on Heroku?

孤人 提交于 2020-01-25 04:52:05
问题 I am not able to install PySide and cannot figure out how to install PyQt on Heroku. I need PySide in order to use Ghost.py. Here is what I include in my requirements.txt: Ghost.py==0.1b3 PySide==1.2.2 And here is the error when pushing to Heroku: Python architecture is 64bit error: Failed to find cmake. Please specify the path to cmake with --cmake parameter. ---------------------------------------- Cleaning up... Command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file_

Most efficient PyQt Model selection in big trees

你离开我真会死。 提交于 2020-01-25 04:48:09
问题 I'm currently selecting multiple rows in a model tree with the code below. But it can be really slow in big sessions with loads of nodes. I suspect this is not very efficient as it's probably selecting the rows one by one. Is there anything that could speed things up - for example don't refresh while selecting until the last one or select all in one call? selectionModel = self.tree.selectionModel() selectionModel.clear() for node, i in self.tree.model().iterNodeAndIndexs(): if nodeCondition:

QMetaObject::invokeMethod doesn't find the method

青春壹個敷衍的年華 提交于 2020-01-24 23:10:35
问题 I want to use QMetaObject::invokeMethod to call a method of an object (later it will run in another thread and then invokeMethod comes in handy). I use the Qt 4.8 bindings of PySide 1.2.1 on Python 3.3. The full example is: from PySide import QtCore class Tester(QtCore.QObject): def __init__(self): super().__init__() def beep(self): print('beep') if __name__ == '__main__': t = Tester() QtCore.QMetaObject.invokeMethod(t, 'beep', QtCore.Qt.AutoConnection) And the output is: QMetaObject:

How to update UI with output from QProcess loop without the UI freezing?

≡放荡痞女 提交于 2020-01-24 21:58:08
问题 I am wanting to have a list of commands being processed through a QProcess and have its output be appended to a textfield I have. I've found a these two pages that seems to do each of the things i need (updating the UI, and not freezing the UI via QThread): Printing QProcess Stdout only if it contains a Substring https://nikolak.com/pyqt-threading-tutorial/ So i tried to combine these two.... import sys from PySide import QtGui, QtCore class commandThread(QtCore.QThread): def __init__(self):

OS X + Qt: How to capture all key-press events in the entire GUI?

≯℡__Kan透↙ 提交于 2020-01-24 09:28:34
问题 I have a basic question about Qt and Mac OS X. If I define a QMainWindow class and define a keyPressEvent function as below, is it not supposed to enter this function whenever a key is pressed anywhere in the MyWindow ? I have some problems with it under Linux, where I do not get the keypress events if certain widgets were focused on (list views or edit boxes), but at least I get it if I focus on a button and then press a key. Under Mac OS X I do not get any response at all. class MyWindow

Python PySide (Internal c++ Object Already Deleted)

孤人 提交于 2020-01-24 02:04:08
问题 I recently decided to write my first app with Python and PySide. But I have a problem and hope you guys can help. Python keeps raising exceptions that the "Internal C++ Object" is deleted. From my limited experience with Python I figure that my object is going out of scope and being deleted by Python's Garbage Collector. So how would I go about designing a multi-page application in Python with PySide. And being able to keep my QWidgets so I can show the page again. Thanks for your time.

Can't use PySide with Anaconda

人走茶凉 提交于 2020-01-23 05:57:29
问题 I have just installed Anaconda for Python 3 and then installed PySide by sudo apt-get install python3-pyside Then I tried to use it throw Anaconda's version of python and typed import PySide but gave me this error ImportError: No module named 'PySide' But when I try the normal Interpreter of Python it works fine, So how could I make it work with Anaconda? 回答1: You need to install it with conda : conda install -c conda-forge pyside 来源: https://stackoverflow.com/questions/41708923/cant-use