Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
865 Topics 3.4k Posts
  • Integration QWebView into JavaFX 2/8 is possible?

    1
    0 Votes
    1 Posts
    735 Views
    No one has replied
  • Set waitcursor on qtextedit

    5
    0 Votes
    5 Posts
    3k Views
    B
    Switch to QProcess, which is what I intended to use from the start, and had some success. I can now set the wait cursor for the textWidget only. @def run_process(self): self.textEdit.viewport().setCursor(Qt.WaitCursor) self.textEdit.clear() self.textEdit.append("Standby, this proc takes time.") self.runner = QProcess(self) self.runner.readyReadStandardOutput.connect(self.GetStd) self.runner.start('ext_proc.sh') def GetStd(self) StdOut = str(self.runner.readAllStandardOutput()) self.textEdit.append(StdOut) self.textEdit.viewport().setCursor(Qt.IBeamCursor@ The problem now is that the Ibeam cursor is reset upon the first input of standard out. However, ext_proc.sh is still running. Tried some things with waitForFinished() but it froze the interface. Is there a way to keep the wait cursor until the external process is complete without locking the GUI? Thanks in advance, Cheers,
  • [PySide] QStyledItemDelegate ignores StyleSheet?

    2
    0 Votes
    2 Posts
    3k Views
    T
    After working with some examples found on the web, my paint function looks like this now. My understanding the below code should render - but respect the stylesheet. @ def paint(self, painter, option, index): super(MyStyleDelegate, self).paint(painter, option, index) modelIndex = index model = index.model() if isinstance(model, QtGui.QAbstractProxyModel): modelIndex = model.mapToSource(index) options = QtGui.QStyleOptionViewItemV4(option) self.initStyleOption(options, index) style = options.widget.style() if options.widget else QtGui.QApplication.style() style.drawControl(style.CE_ItemViewItem, options, painter, options.widget) QtGui.QStyledItemDelegate.paint(self, painter, option, modelIndex) @ Some thing of interest - my options.widget is always None. Would that have the the effect that I'm seeing?
  • Datachanged signal does not work

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Run Qt Jambi From Eclipse

    7
    0 Votes
    7 Posts
    10k Views
    Q
    Windows7 中文
  • Set widget style from a menu selection.

    3
    0 Votes
    3 Posts
    2k Views
    B
    Found the solution "here":http://stackoverflow.com/questions/1100775/create-pyqt-menu-from-a-list-of-strings. Change the triggered statement to "self.action.triggered.connect(lambda style=style self.changeStyle(self.action.text()))"
  • Qt Island in a C# application?

    1
    0 Votes
    1 Posts
    925 Views
    No one has replied
  • PySide - Source functions defined outside of a class

    10
    0 Votes
    10 Posts
    6k Views
    B
    Still new to PySide but learning. My motivation for this was to isolate the GUI/interface coding from the functional coding. I found a way to reference .ui xml files created in qt designer directly. Now I can easily make changes to the ui without having to touch the python code at all.
  • Type errors using QInputDialog()

    3
    0 Votes
    3 Posts
    3k Views
    B
    Replaced 'self' with 'MainWindow' and the function worked.
  • Changes to the model is not applied to the database.

    1
    0 Votes
    1 Posts
    706 Views
    No one has replied
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • QtJambi AWTBridge 64bit

    1
    0 Votes
    1 Posts
    815 Views
    No one has replied
  • PySideQwt revival

    10
    0 Votes
    10 Posts
    5k Views
    R
    http://www.pyqtgraph.org/ pyqtgraph is a good alternative!
  • Pyside - itemActivated not triggered on Mac Os X with return key

    1
    0 Votes
    1 Posts
    867 Views
    No one has replied
  • Why am I unable to run a PySide GUI in a spawned child process?

    5
    0 Votes
    5 Posts
    3k Views
    S
    Ahh, I didn't know about QLocalServer. I had originally looked at using python's socket library, but I didn't think about checking out Qt's. If it transparently handles signal/slots that might be the easiest approach. I'll give it a shot. Thanks! Edit: Okay, it looks like it doesn't handle signal/slots in the way I thought you meant. It doesn't transparently send them over the network. There does appear to be a third party library for that (QxtRPCPeer), but it doesn't have python bindings. I guess I'm stuck either going without a child GUI process or reimplementing the functionality provided by multiprocessing.Pipe.
  • DrawPixmapFragments in PySide

    1
    0 Votes
    1 Posts
    925 Views
    No one has replied
  • There is a V8 crashes Problem for binding to Node.js

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • PySide with Qt 5

    2
    0 Votes
    2 Posts
    13k Views
    R
    look at here http://lists.qt-project.org/pipermail/pyside/2013-November/001676.html
  • QTreeList Widget custom selection

    2
    0 Votes
    2 Posts
    3k Views
    jazzycamelJ
    The following is a simple attempt at what I think you want. This will allow the user to select multiple child items which have the same parent (top level item) but will only allow parents to be selected individually. It works by connecting to the "QTreeWidget":http://qt-project.org/doc/qt-4.8/qtreewidget.html itemSelectionChanged signal and inspecting newly selected indexes and comparing there relationship (if any) to the to the previously selected indexes, selecting and deselecting as appropriate: @ from PyQt4.QtGui import * from PyQt4.QtCore import * class TreeWidget(QTreeWidget): diff=staticmethod(lambda l1,l2: filter(lambda x: x not in l1, l2)) def __init__(self, parent=None, **kwargs): QTreeWidget.__init__( self, parent, selectionMode=QTreeWidget.ExtendedSelection, itemSelectionChanged=self._itemSelectionChanged, **kwargs) self._selected=[] @pyqtSlot() def _itemSelectionChanged(self): si=self.selectedIndexes() added=TreeWidget.diff(self._selected, si) block=self.blockSignals(True) self.selectionModel().clearSelection() for add in added: if add.parent().isValid(): # Must be a child item as it has a valid parent for index in self._selected: parent=add.parent() if (not index.parent().isValid()) or (index.parent()!=parent) or index==parent: try: si.remove(index) except ValueError: pass else: # Invalid parent therefore it is a toplevel (parent) item for index in self._selected: try: si.remove(index) except ValueError: pass for i in si: self.selectionModel().select(i, QItemSelectionModel.Select) self._selected=si self.blockSignals(block) class Widget(QWidget): def init(self, parent=None, **kwargs): QWidget.init(self, parent, **kwargs) l=QVBoxLayout(self) self._tree=TreeWidget(self, columnCount=1) l.addWidget(self._tree) for i in xrange(3): pItem=QTreeWidgetItem(self._tree, ['Parent {0}'.format(i)]) self._tree.addTopLevelItem(pItem) for j in xrange(3): cItem=QTreeWidgetItem(pItem, ['Child {0}.{1}'.format(i,j)]) pItem.addChild(cItem) if name=="main": from sys import argv, exit a=QApplication(argv) w=Widget() w.show() w.raise_() exit(a.exec_()) @ Hope this helps ;o)
  • Unable to compile/install PySide 1.2.1 with phonon

    2
    0 Votes
    2 Posts
    1k Views
    M
    Problem SOLVED. Make sure that you install prerequisites libphonon-dev!