Hello,
I'm trying to understand the model/view programming while making a kind of
tag-based browser. I have some absoluteFilePath in a database associated to
one ore more tags (which are strings) . I'm trying to display those files
(or directories of course) in a view. Hence, I created a subclass
finally, I did it like that:
I don't know if it's a good way to access the model in the view, but it works
class CustomQTableView(QTableView):
def __init__(self):
super(CustomQTableView, self).__init__()
def show_hide_rows(self, choice):
"""choice comes from a checkox""
I have not yet found a better way to do this than by first building a
list of rows you want to be visible, then setting the model's filter
with setFilter().
On May 6, 2010, at 12:24 PM, Philippe Crave wrote:
Yes, I use that in the model also.
but now, I need to iterate over the row, in
Yes, I use that in the model also.
but now, I need to iterate over the row, in the tableView. I want to
hide row when the data is an empty string.
I found that I can get the string with self.currentIndex().data().toString()
so, I suppose that I have to find a way to modify the currentIndex
2010/5
On May 6, 2010, at 9:46 AM, Philippe Crave wrote:
actually, I just want to loop over the rows.
I do not find a max_row, or an iterator over the rows of a Table.
Take a look at your model's rowCount() and record() methods. I think
you'll want to be iterating over the records in your model,
actually, I just want to loop over the rows.
I do not find a max_row, or an iterator over the rows of a Table.
2010/5/6 Philippe Crave :
> thank you, both of you !
> I will check the filtering solution.
> I am now implementing the setColumnHidden. just have to customize a
> QTableView class. seems
thank you, both of you !
I will check the filtering solution.
I am now implementing the setColumnHidden. just have to customize a
QTableView class. seems simple.
by the way, do you know how to get the total number of row in a table ?
i must be blind, but I could not find it.
2010/5/6 Christian Br
perhaps setColumnHidden is what you seek?
http://doc.trolltech.com/4.6/qtableview.html#setColumnHidden
Am 06.05.2010, 17:15 Uhr, schrieb Philippe Crave
:
looks like that I have to do a QAbstractTableModel for each QTableView,
no ?
sounds strange, I thought that the idea was to have only o
looks like that I have to do a QAbstractTableModel for each QTableView, no ?
sounds strange, I thought that the idea was to have only one model
that will serve data to several views.
2010/5/6 Philippe Crave :
> Hello,
>
> I am reading the chapter 14 of Mark Summerfield.
> I work with custom model
Hello,
I am reading the chapter 14 of Mark Summerfield.
I work with custom model and custom delegate.
in the sample from the book, we have 1 tableView linked to one model.
It's simple to get 2 tableView linked to the same model.
my Model has got 4 columns.
I would like that TableView_1 show the
Hello,
thanks for your help again. It works like a charm now.
Lukas
Am Donnerstag 24 September 2009 21:11:34 schrieb David Boddie:
> On Tue Sep 22 01:37:33 BST 2009, David Boddie wrote:
> > I tried running your test case and found that the view displayed various
> > items in an incomplete way -
On Tue Sep 22 01:37:33 BST 2009, David Boddie wrote:
> I tried running your test case and found that the view displayed various
> items in an incomplete way - when you see trailing branches, it's a sure
> sign that something isn't quite right.
>
> I'll try and take a look at this tomorrow unless s
On Mon, 21 Sep 2009 13:20:33 +0200, Lukas Hetzenecker wrote:
> When I get a reply from the phone (some items) I don't know how to get the
> parent QModelIndex for the directory (internal pointer). Currently I store
> the index in my internal class and update it on every createIndex call - is
> the
Hello,
i have some problems with my first attempt to use Model/View programming:
I tried to create a Model for a directory list. The folders are located on a
mobile phone and I get the content over Obex and Bluetooth, so the
communication can be really slow -> The model should be asynchronous.
14 matches
Mail list logo