[PyQt] QTreeView and custom QStandardItemModel loses its Python counterparts

2013-04-29 Thread David Aguilar
We're seeing a change in behavior in the latest PyQt4. We have a custom QStandardItemModel with custom QStandardItems. It is being used by a QTreeView. When calling tree.invisibleRootItem().child(i) we are getting back QtGui.QStandardItem instances instead of our custom classes. This seemed

Re: [PyQt] QTreeView and custom QStandardItemModel loses its Python counterparts

2013-04-29 Thread David Aguilar
David Aguilar davvid at gmail.com writes: We're seeing a change in behavior in the latest PyQt4. We have a custom QStandardItemModel with custom QStandardItems. It is being used by a QTreeView. When calling tree.invisibleRootItem().child(i) we are getting back QtGui.QStandardItem

Re: [PyQt] QTreeView and custom QStandardItemModel loses its Python counterparts

2013-04-29 Thread David Aguilar
Phil Thompson phil at riverbankcomputing.com writes: On Mon, 29 Apr 2013 20:41:46 + (UTC), David Aguilar davvid at gmail.com wrote: We're seeing a change in behavior in the latest PyQt4. When calling tree.invisibleRootItem().child(i) we are getting back QtGui.QStandardItem instances

[PyQt] qtreeview vs qtreewidget selection model?

2012-10-04 Thread Jordan Olson
hey guys! I'm pretty fresh to this mailing list, but looking forward to being pointed in the right direction! So here's what's happening. I'm implementing a custom QTreeView model, and though I have it working pretty well, the one little peeve I haven't figured out is the way it handles

Re: [PyQt] qtreeview vs qtreewidget selection model?

2012-10-04 Thread Andreas Pakulat
Hi, On Fri, Oct 5, 2012 at 12:20 AM, Jordan Olson jorxs...@gmail.com wrote: So here's what's happening. I'm implementing a custom QTreeView model, and though I have it working pretty well, the one little peeve I haven't figured out is the way it handles selection- --any default

Re: [PyQt] qtreeview vs qtreewidget selection model?

2012-10-04 Thread Jordan Olson
Ah, cheers Andreas, figured it out! I was setting it to self.treeWidget.setSelectionMode( QAbstractItemView.MultiSelection ) but what I really wanted was self.treeWidget.setSelectionMode( QAbstractItemView.ExtendedSelection ) thanks again! On Fri, Oct 5, 2012 at 11:46 AM, Andreas Pakulat

Re: [PyQt] QTreeView DragDropMode (Code attached)

2012-04-26 Thread hosscomp
This is a zip file of the Exlipse project if anyone cares to take a look. At this point I am trying to figure out why the dragEnterEvent in compassTreeView.py doesn't cause a move action when source is self. http://python.6.n6.nabble.com/file/n4931964/CompassGui.zip CompassGui.zip -- View this

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-24 Thread hosscomp
No problem, Bart. Thanks for replying. I think I am on the right track (a right track) now. There seems to be many different ways to do what I am trying to accomplish, but I haven't gotten the hang of quickly figuring out the documentation and I am running out of time on this project. I think it

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-24 Thread Bart Kroon
When time is short I would say, add a method to the source model that you can call from the target model that removes the received items. That would make it work at least. It might even be the best way to do such a thing, but I'm not sure. It seems you handle the dragged in mimedata as the

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-21 Thread Bart Kroon
Sorry it took me so long, I was quite busy. My solution is used for moving items internally in one model. From your earlier mails I may have gotten the wrong idea. It seems you need to move the items from one model to another. Is this correct? Am I correct in assuming that your source model is

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-19 Thread hosscomp
More progress. I now have the two MineData types working so that a node dropped into the target tree is created with a different MIME_TYPE and in the dopMimeData method of the target model I have at the bottom: . . . if (mimedata.hasFormat('target_type')): self.removeRow(row,parentIndex) It

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-17 Thread hosscomp
I may be talking to myself only, but I am getting closer. I subclassed two models with different MimeData subclasses of QMimeData giving them different MIME_TYPE strings. I created two instances of QTreeView, one with each of the models. One of the models (say model B) is set to accept both of

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-12 Thread Bart Kroon
In my project I use a special mime type in DropMimeData() to recognise internal moves and handle them accordingly. I have set the view to handle drag and drop operations. You will need to subclass your model for this. ___ PyQt mailing list

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-04 Thread hosscomp
hosscomp wrote I am looking at the documentation for QAbstractItemView Class. I have created a tree view and I would like it to accept drops from a different view, but also be able to move items within itself. None of the DragDropMode settings seem to allow that. If I set it to

[PyQt] QTreeView DragDropMode

2012-04-02 Thread Shoemaker, Ronnie A (N-UNITED SPACE ALLIANCE, LLC)
I am looking at the documentation for QAbstractItemView Class. I have created a tree view and I would like it to accept drops from a different view, but also be able to move items within itself. None of the DragDropMode settings seem to allow that. If I set it to InternalMove it acts the way

[PyQt] QTreeView with floating background image

2012-01-16 Thread Marc Rossi
Hi. Want an image (QPixmap) as background of my QTreeView fixed in the lower right corner of the viewport at all times. Did this for a QTableView by installing an event filter and drawing the pixmap when I receive Paint events on the viewport. This doesn't seem to work for the QTreeView,

[PyQt] QTreeView with blue line cursor at init

2011-06-02 Thread David Boddie
On Wed, 1 Jun 2011 10:46:42 -0700, emmanuel_mayssat wrote: I have an application that run a sequence of tasks listed in a treeview. There is a run button. When the run button is pressed, it executes all the task in the subtree. Now, when the application open, it is not really clear what the

[PyQt] QTreeView with blue line cursor at init

2011-06-01 Thread emmanuel_mayssat
Hello, I have an application that run a sequence of tasks listed in a treeview. There is a run button. When the run button is pressed, it executes all the task in the subtree. Now, when the application open, it is not really clear what the run button would execute, because the line cursor in

[PyQt] QTreeView / QFileSystemModel : auto-expand to designated directory

2011-05-24 Thread James Polk
Howdy, Anybody have any experiences or words of wisdom to share concerning how to have a QTreeView/QFileSystemModel automatically expand from entirely closed (on startup) to a certain specified directory ? Was hoping for a single command,...but preliminary research looks like a recursive

[PyQt] Qtreeview with visible header but hidden columndata

2011-03-17 Thread F.A.Pinkse
Hi All, I have a Qtreeview with a QSortFilterProxyModel for filtering and sorting. I want to sort the data on more ways than there are columns visible. In order to do that I have the data to sort on in invisible columns adn a QButtonGroup to set the sorting column with

[PyQt] QTreeView filtering with QSortFilterProxyModel

2011-03-04 Thread JediAce
Hi Everyone So I'm trying to filter a QFileSystemModel using QSortFilterProxyModel and displaying it with QTreeView. The filtering works fine, however, I'm having trouble setting the root index to the folder I want. To set the root index for QTreeView, I use: someTreeView.setRootIndex(

[PyQt] Qtreeview and Qt.AccessibleDescriptionRole

2011-02-16 Thread Gaëtan Podevijn
Hello, I have subclassed QAbstractTableModel. I have define my data method correctly. However, I would like to get a kind of hidden information when I double clicked on the view associated to my model (which is a qtreeview). Hence, I have decided to use Qt.AccessibleDescriptionRole. def

Re: [PyQt] QTreeView scrolling on selection

2010-11-22 Thread Yuya Nishihara
Steve Borho wrote: Hello, We use a QTreeView to present a list of files in our commit tool. The view has 4 columns, the largest of which is the file name. We don't really like Qt's behavior of scrolling horizontally when an item is selected, most of the time the user wants column 0

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread dizou
So this is what I did: class TreeWidget(QTreeWidgetItem): def __init__(self, parent=None): QTreeWidgetItem.__init__(self, parent) def key(self, col, asc): print col if col == 4: path = self.text(col).latin1() if path is not None and

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Reinaldo de Carvalho
On Thu, Nov 18, 2010 at 11:00 AM, dizou di_...@yahoo.com wrote: So this is what I did: class TreeWidget(QTreeWidgetItem):    def __init__(self, parent=None):        QTreeWidgetItem.__init__(self, parent)    def key(self, col, asc):        print col        if col == 4:            path =

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Di Zou
@riverbankcomputing.com Sent: Thu, November 18, 2010 9:07:13 AM Subject: Re: [PyQt] QTreeView and sorting I said 'QListViewItem' reimplemented as 'QListViewItemXX', but you must insert items with 'QListViewItemXX' on 'QTreeView'. -- Reinaldo de Carvalho http://korreio.sf.net http://python-cyrus.sf.net

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Reinaldo de Carvalho
On Thu, Nov 18, 2010 at 11:18 AM, Di Zou di_...@yahoo.com wrote: There is no QListViewItem, so I used QListWidgetItem. I cannot insert those into my QTreeView though and I am not going to turn my QTreeView into a QListView. You said 'I am using a QTreeView'. Check the first message. --

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Reinaldo de Carvalho
On Thu, Nov 18, 2010 at 11:18 AM, Di Zou di_...@yahoo.com wrote: There is no QListViewItem, so I used QListWidgetItem. I cannot insert those into my QTreeView though and I am not going to turn my QTreeView into a QListView. Sorry, QListViewItem is a QT3 object. -- Reinaldo de Carvalho

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Hans Meine
Op den Middeweken 17 November 2010 Klock 17:42:20 hett dizou schreven: I am using a QTreeView and I have sorting enabled. Sorting works great, but I want one column to be sorted a specific way that isn't how Qt does it by default. I took a look at QSortFilterProxyModel, but this class looks

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Di Zou
Sorry. I meant I am using a QTreeWidget and QTreeWidgetItems. From: Reinaldo de Carvalho reinal...@gmail.com To: Di Zou di_...@yahoo.com Cc: pyqt@riverbankcomputing.com Sent: Thu, November 18, 2010 9:22:37 AM Subject: Re: [PyQt] QTreeView and sorting On Thu

[PyQt] QTreeView and sorting

2010-11-17 Thread dizou
I am using a QTreeView and I have sorting enabled. Sorting works great, but I want one column to be sorted a specific way that isn't how Qt does it by default. I took a look at QSortFilterProxyModel, but this class looks more like a way to sort and filter data before the data is displayed in the

Re: [PyQt] QTreeView and sorting

2010-11-17 Thread Reinaldo de Carvalho
On Wed, Nov 17, 2010 at 1:42 PM, dizou di_...@yahoo.com wrote: I am using a QTreeView and I have sorting enabled. Sorting works great, but I want one column to be sorted a specific way that isn't how Qt does it by default. I took a look at QSortFilterProxyModel, but this class looks more like

[PyQt] qtreeview

2010-10-26 Thread lucabe...@libero.it
Hello i can use qtreeview with qtftp (there is some model ready) or i have to use qtreewidget with qftp? Thanks Luca ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] QTreeview does not show subrows correctly when the model is a Python list

2010-07-17 Thread Herbert Ruessink
Dear all, I am trying to use a Python list as a model for QTreeView, or to be precise, the model is a subclass of list, the daughter nodes are the elements on this list object, and they themselves are the same subclass of list. Somehow I cannot get the data to show correctly. Only the first

Re: [PyQt] Qtreeview/QDirmodel with check-boxes

2010-05-31 Thread David Boddie
On Mon May 31 02:15:32 BST 2010, Jon Noble wrote: Hope this helps someone as PyQt4 documentation/examples are sparse out there in the internet. I encourage you to add it to the Item Views section of the Sample Code page on the Wiki: http://www.diotavelli.net/PyQtWiki/SampleCode Hopefully

Re: [PyQt] Qtreeview/QDirmodel with check-boxes

2010-05-31 Thread Jon Noble
On Monday 31 May 2010 16:55:29 David Boddie wrote: On Mon May 31 02:15:32 BST 2010, Jon Noble wrote: Hope this helps someone as PyQt4 documentation/examples are sparse out there in the internet. I encourage you to add it to the Item Views section of the Sample Code page on the Wiki:

[PyQt] Qtreeview/QDirmodel with check-boxes

2010-05-30 Thread Jon Noble
Hi, I'm trying to create a file-system tree-view with checkboxes yet i'm having great difficulties on doing so. I found a link (http://lists.trolltech.com/qt-interest/2005-08/msg00516.html) but I'm not really sure what the solution is. I've tried one solution which is to use

Re: [PyQt] Qtreeview/QDirmodel with check-boxes

2010-05-30 Thread Jon Noble
On Monday 31 May 2010 00:07:43 Jon Noble wrote: Hi, I'm trying to create a file-system tree-view with checkboxes yet i'm having great difficulties on doing so. I found a link (http://lists.trolltech.com/qt-interest/2005-08/msg00516.html) but I'm not really sure what the solution is. I've

Re: [PyQt] Qtreeview/QDirmodel with check-boxes

2010-05-30 Thread Jon Noble
On Monday 31 May 2010 01:10:12 Jon Noble wrote: On Monday 31 May 2010 00:07:43 Jon Noble wrote: Hi, I'm trying to create a file-system tree-view with checkboxes yet i'm having great difficulties on doing so. I found a link

[PyQt] QTreeView and ToolTip

2010-05-26 Thread Olivier Fournier
Hi, I would like add Tooltip to a QtreeView. I have reimplemented the event fonction for MyTreeView class And surprise: MyTreeView.indexAt() function doesn't return the good row. Could you tell me what is wrong in my code? For the test I have modified the simpletreemodel.pyw in samples who

[PyQt] QTreeView Drop Target: Between Rows, Column 1

2009-11-11 Thread Doogster
How do I set the drop target in my QTreeView to be between any row in Column 1? To set the drop target to be between rows, I have flags return ItemIsDropEnabled if the index is invalid. However, an invalid index has both the row and column set to -1. That prevents me from narrowing the drop

Re: [PyQt] qtreeview vs qtreewidget?

2009-10-21 Thread William
:05 PM Subject: Re: [PyQt] qtreeview vs qtreewidget? Ok, I figured out how to allow checkboxes in a qtreeview (using flags()) and how to set their state using QtCore.Qt.CheckStateRole in my data() method. However, I still need help on one thing: What is the signal that lets me know if someone

Re: [PyQt] qtreeview vs qtreewidget?

2009-10-21 Thread Chris Dunscombe
If you were to post an example I for one would find it helpful and I'm sure others would as well. Thanks, Chris --- On Wed, 10/21/09, William abecedarian314...@yahoo.com wrote: From: William abecedarian314...@yahoo.com Subject: Re: [PyQt] qtreeview vs qtreewidget? To: William abecedarian314

[PyQt] qtreeview vs qtreewidget?

2009-10-20 Thread William
A quick question--in the qtreewidget, one can make a checkbox for items (setting CheckState for a treewidget item). Is there a similar capability for the qtreeview if we are using qabstractitemmodel? Thanks! ___ PyQt mailing list

Re: [PyQt] qtreeview vs qtreewidget?

2009-10-20 Thread William
that, then I can change my data and I assume that the view will update. Thanks, William From: William abecedarian314...@yahoo.com To: pyqt@riverbankcomputing.com Sent: Tue, October 20, 2009 6:09:46 PM Subject: [PyQt] qtreeview vs qtreewidget? A quick question

Re: [PyQt] QTreeView Windows cell resizing issue

2009-05-29 Thread Peter Georges
No one has any ideas on this? Basically on Windows it does not pick up the size of a cell when using QTableView.setIndexWidget whereas it works on linux... Cheers On 28/05/09 15:12, Peter Georges wrote: I have a QTreeView with custom widgets in it and I use the 'resizeColumnsToContents' and

[PyQt] QTreeView Windows cell resizing issue

2009-05-27 Thread Peter Georges
I have a QTreeView with custom widgets in it and I use the 'resizeColumnsToContents' and 'resizeRowsToContents' functions to correctly size all the cells. This works correctly on Linux but not on Windows.. I am using v4.5-snapshot-20090409 which is a bit old now but I cannot see anything in

[PyQt] QTreeView: Deselection

2008-11-11 Thread Filip Gruszczyński
I have a following situation: there is a tree simple tree view with some folder-like structure. Any object may be chosen from this view or not. If anything is chosen, then the dialog returns the chosen index's internal pointer and if nothing was chosen it should return None. Except it doesn't.

[PyQt] qtreeview and custom display roles

2008-06-14 Thread Adam Tenderholt
Hi, I'm trying to creating something akin to an phonebook. For a given person, there are possibly two phone numbers listed (say work and cell). What I'm trying to implement is single model (PhoneModel) and two different views (WorkView and CellView). My initial thought was that I should use two

Re: [PyQt] qtreeview display speed

2008-02-04 Thread Babak Khataee
Hi Matt, Thanks for your response, I'm using Qt 4.2. cheers Babak On 04/02/2008, Matt Newell [EMAIL PROTECTED] wrote: On Monday 04 February 2008 08:52:44 Baba-k wrote: Hi everyone, I'm relatively new to pyqt and am encountering some problems while trying to make a custom tree widget

Re: [PyQt] qtreeview display speed

2008-02-04 Thread Matt Newell
On Monday 04 February 2008 08:52:44 Baba-k wrote: Hi everyone, I'm relatively new to pyqt and am encountering some problems while trying to make a custom tree widget (using the model/view classes) that i was hoping some one here might be able to help me with. Ive made a custom treewidget

[PyQt] qtreeview display speed

2008-02-04 Thread Baba-k
Hi everyone, I'm relatively new to pyqt and am encountering some problems while trying to make a custom tree widget (using the model/view classes) that i was hoping some one here might be able to help me with. Ive made a custom treewidget which is using a custom view and model. The view is a

[PyQt] QTreeView: inserting and removing rows in view and underlying data...

2007-11-09 Thread Dirk Wagener
Hi I am experiencing some confusion regarding the model/view architecture when using a QTreeView with a custom QAbstractItemModel. This is the bigger picture of what I am doing: * I use a tree view to browse and edit a bunch of object. * I have a data class (TreeNode) used to store my data.

Re: [PyQt] QTreeView: inserting and removing rows in view and underlying data...

2007-11-09 Thread Mark Summerfield
On 2007-11-09, Dirk Wagener wrote: Hi I am experiencing some confusion regarding the model/view architecture when using a QTreeView with a custom QAbstractItemModel. [snip] Can somebody please give me some advice. Where can I learn how to do this model/view interaction properly? Are there

Re: [PyQt] QTreeView: inserting and removing rows in view and underlying data...

2007-11-09 Thread Andreas Pakulat
On 09.11.07 10:02:31, Mark Summerfield wrote: On 2007-11-09, Dirk Wagener wrote: Hi I am experiencing some confusion regarding the model/view architecture when using a QTreeView with a custom QAbstractItemModel. [snip] Can somebody please give me some advice. Where can I learn how to

Re: [PyQt] QTreeView: inserting and removing rows in view and underlying data...

2007-11-09 Thread Andreas Pakulat
On 09.11.07 10:58:08, Dirk Wagener wrote: At this stage I am doing something wrong regarding this. Now and then (sporadically) I get access violations when getting the underlying data from a QModelIndex(): tmpTreeNode = currentModelIndex.internalPointer() To test to a certain extent that