[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Questions about protected slots.
From: "Robert Knight" <robertknight () gmail ! com>
Date: 2008-12-24 14:49:09
Message-ID: 13ed09c00812240649w164012dhd534d6a4d5d7725 () mail ! gmail ! com
[Download RAW message or body]
> Maybe you need a QTableWidget rather than a QTableView.
> QTableWidget inherits QTableView and has a variety of useful signals
> when the user selects cells and rows.
I would recommend avoiding QTable/Tree/ListWidget in most cases and
using QStandardItemModel instead with
QTable/Tree/ListView. The problem with 'QXYZWidget' classes is that
there is no model-view separation with them which gives you very
little flexibility in future if you need to change the view type, use
a custom model, show the same
data in different places, sort or filter the model data etc. My
understanding is that QTable/Tree/ListWidget were added as an aid to
porting from Qt 3 (or the Qt 3 support classes) and unless you have a
simple view with a small number of items which is unlikely to change
then I would advise against using them in new code.
Regards,
Robert.
2008/12/24 Magicloud <magicloud.magiclouds@gmail.com>:
> Richard Dale wrote:
>> You can connect to one of the signals emitted by the Qt::TableView,
>> such as
>> activated(), when a cell is selected and use the Qt::ModelIndex argument to
>> get the value of the cell, and set the text in the Qt::LineEdit.
>>
>> -- Richard
> I see. I was confused by currentChanged slot. Are they a little redundant?
>
>>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
>
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic