Re: [PyQt] Scroll QTableView beyond last column/row

2013-08-28 Thread Paul Du Bois
I do this: # somewhere in init self._last_vsb_height = None self.verticalScrollBar().rangeChanged[int,int].connect(self._on_range_changed) def _on_range_changed(self, min, max): # Try to prevent infinite recursion # Count is in rows if max !=

Re: [PyQt] get list of object

2011-10-11 Thread Paul Du Bois
for i,txt in enumerate(lst): edit = getattr(self, 'lineEdit_%d' % i) edit.settext(txt) -Original Message- From: pyqt-boun...@riverbankcomputing.com [mailto:pyqt-boun...@riverbankcomputing.com] On Behalf Of lucabe...@libero.it Sent: Tuesday, October 11, 2011 8:49 AM To:

Re: [PyQt] selecting an item in qtreeview

2011-06-29 Thread Paul Du Bois
I use QTreeView's selectionChanged signal. But you should also look at QAbstractItemView's signals; it has many for you to choose from: activated, clicked, doubleClicked, entered, pressed, ... p From: pyqt-boun...@riverbankcomputing.com [mailto:pyqt-boun...@riverbankcomputing.com] On

Re: [PyQt] Question on QTreeView, interactive expanding/collapsing

2011-04-19 Thread Paul Du Bois
If you need hotkey+click then this is the best way I've found to do it # Implement shift-click to expand/contract @pyqtSlot(QModelIndex) def _on_expanded(self, index): if self._in_shift_press: self._in_shift_press = False

Re: [PyQt] Signals

2011-02-09 Thread Paul Du Bois
You've probably forgotten to call your base class's __init__. p -Original Message- From: pyqt-boun...@riverbankcomputing.com [mailto:pyqt-boun...@riverbankcomputing.com] On Behalf Of Entity Reborn Sent: Wednesday, February 09, 2011 8:42 PM To: pyqt@riverbankcomputing.com Subject:

[PyQt] Undo/Redo and operator delete

2011-02-04 Thread Paul Du Bois
http://doc.qt.nokia.com/qq/qq25-undo.html has this snip of example code that demonstrates (among other things) how to back out commands that fail or otherwise do nothing so they don't clutter up the undo stack: bool UndoRedoProxy::setData( ... ){ if (!index.isValid() || index.data(role)

Re: [PyQt] how know when the number of rows change in QTableWidget ?

2011-01-26 Thread Paul Du Bois
I want know when the number of rows change in QTableWidget. Is there any signal or event in PyQt for that? widget.model() will emit rowsInserted/Moved/Removed signals. You could try connecting to those. See QAbstractItemModel for details. You may also need to connect to modelReset because

Re: [PyQt] QContextMenuEvent on a QTreeWidgetItem

2010-12-17 Thread Paul Du Bois
Well, I suppose you would start with class MainWindow(QMainWindow): def contextMenuEvent(self, event): item = self.tree_widget.itemAt(event.globalPos()) # create or fetch a QMenu that relates to your item menu.exec(event.globalPos()) or you could override the event on the

[PyQt] newly introduced bug in PyQt 4.8.1 uic.loadUi

2010-12-05 Thread Paul Du Bois
This change to PyQt4/uic/Loader/loader.py loadUi() breaks support for file-like objects, but uic.loadUi() is still documented as supporting them: # Allow the filename to be a QString. filename = str(filename) return self.parse(filename, os.path.dirname(filename)) The use