Qt-interest Archive, May 2008
a question on QTableModel::insertRows
Message 1 in thread
Hi all,
I'm reimplementing QTableModel::insertRows for a customized class inheriting QAbstractTableModel.
I want the method to insert different things based on different parameters into my data model. However, I don't think this is
possible for insertRows since there is no place for me to pass any additional parameter to it
Could someone give me an advice?
Thanks
Yifei
Message 2 in thread
- Subject: RE: a question on QTableModel::insertRows
- From: ÐÐÑÐÐ ÐÐÑÐÑÐÐÐ <uksus70@xxxxxxxxx>
- Date: Fri, 16 May 2008 13:54:21 +0800
- Delivered-to: qt-interest@trolltech.com
- Disposition-notification-to: ÐÐÑÐÐ ÐÐÑÐÑÐÐÐ <uksus70@gmail.com>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:return-receipt-to:from:to:references:in-reply-to:subject:date:message-id:mime-version:content-type:x-mailer:thread-index:content-language:disposition-notification-to; bh=o/7q9S7hpGwDyR0znFGWBvKSb9DRuxuga7PnMPAcccU=; b=ksravdgYVyOKfjhsDbUcBq4ym9gLyj3ieLYu7SVPk6Wd6zeHVRFMVktuMmOBlraeqJMvqBw2ua+wLF2vdSgXGRrT4X4ZYMB5xrQltgm6xnoQEXwNEHH5KVtsf7pP16gLQHyqFyyRIMMzWHDxejb0pl7AS8Pwof/+ZgGERJ5LlZs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=return-receipt-to:from:to:references:in-reply-to:subject:date:message-id:mime-version:content-type:x-mailer:thread-index:content-language:disposition-notification-to; b=GAYKhyF+7Ashbvl292qreAvH119PrruoKIvc5RaCtUpnTVWiamvc4Jm0vtjLWM2gkULKDNtejpK3dq4cfwDuxiQWMEBAewXWC82cdF6XiTVvJ5J6bfiuixTf8IxgP7WULh6CHUfLPReMRMuZSKebV5k2YhBlgRTaYxwMQFPqrRA=
- List-help: <mailto:qt-interest-request@trolltech.com?subject=help>
- List-post: <mailto:qt-interest@trolltech.com>
- List-subscribe: <mailto:qt-interest-request@trolltech.com?subject=subscribe>
- List-unsubscribe: <mailto:qt-interest-request@trolltech.com?subject=unsubscribe>
- Resent-from: qt-interest@xxxxxxxxxxxxx
- Resent-message-id: <pOrc8B.A.vCH.nGSLIB@esparsett>
- Resent-sender: qt-interest-request@xxxxxxxxxxxxx
- Thread-index: Aci2+bbMa4CI9y1uSdKMiAhCvjFmfwAHrksQ
- To: <qt-interest@xxxxxxxxxxxxx>
What are those different things?
Perhaps, you should insert some abstract rows, and then call setData for those rows. And finally call submit(), where you can analyze rowâs data and submit âdifferentâ things.
From: Yifei Li [mailto:yifli@xxxxxxx]
Sent: Friday, May 16, 2008 10:08 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: a question on QTableModel::insertRows
Hi all,
I'm reimplementing QTableModel::insertRows for a customized class inheriting QAbstractTableModel.
I want the method to insert different things based on different parameters into my data model. However, I don't think this is
possible for insertRows since there is no place for me to pass any additional parameter to it
Could someone give me an advice?
Thanks
Yifei
Message 3 in thread
My table lets users view/edit input to the program. The first column in the table determines the data type in other columns.
For example, if the value of the first column is T, than other columns will have data of type MyClass<T> (a template class)
So I really can not insert any 'abstract' rows because even though I can make abstract values for columns other than the
first one, I still need specific type information from the first column. For example, only if I know the value of first column
is float, than I can use the default constructor of class MyClass<float> to initialize the value for other columns
Any ideas?
Thanks
Yifei
----- Original Message -----
From: ÐÐÑÐÐ ÐÐÑÐÑÐÐÐ
To: qt-interest@xxxxxxxxxxxxx
Sent: Friday, May 16, 2008 01:54
Subject: RE: a question on QTableModel::insertRows
What are those different things?
Perhaps, you should insert some abstract rows, and then call setData for those rows. And finally call submit(), where you can analyze rowâs data and submit âdifferentâ things.
From: Yifei Li [mailto:yifli@xxxxxxx]
Sent: Friday, May 16, 2008 10:08 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: a question on QTableModel::insertRows
Hi all,
I'm reimplementing QTableModel::insertRows for a customized class inheriting QAbstractTableModel.
I want the method to insert different things based on different parameters into my data model. However, I don't think this is
possible for insertRows since there is no place for me to pass any additional parameter to it
Could someone give me an advice?
Thanks
Yifei
Message 4 in thread
- Subject: RE: a question on QTableModel::insertRows
- From: ÐÐÑÐÐ ÐÐÑÐÑÐÐÐ <uksus70@xxxxxxxxx>
- Date: Mon, 19 May 2008 12:38:36 +0800
- Delivered-to: qt-interest@trolltech.com
- Disposition-notification-to: ÐÐÑÐÐ ÐÐÑÐÑÐÐÐ <uksus70@gmail.com>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:return-receipt-to:from:to:references:in-reply-to:subject:date:message-id:mime-version:content-type:x-mailer:thread-index:content-language:disposition-notification-to; bh=qJGbSUSLKSIR35pHwwh9IiLMjhfsufi9q1JDxBbjiUk=; b=gJxtgKTMnyQrBXXJDHIlojS1fkwgis0pqme3d3mPjWkpQi/1YPVU53QkjV1qk348zAI2c9ERQSjyf+ZxZyLjas6QyfrCtCIpXKevJ2sNvLqZLrDwa+tITTwNF978YuaQv2flzpn3UfZjquC3sKDmidZA9ZSpP6XvbrqXVDpNp8M=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=return-receipt-to:from:to:references:in-reply-to:subject:date:message-id:mime-version:content-type:x-mailer:thread-index:content-language:disposition-notification-to; b=kvTvY+JEstzHxUBz6xDjdyf+YBGQs1JUMNaTZEsbilTKvycsfScIRHaZ0B8vrPk56/hxuJyQfuIUz+X/lMrPdEmTmUwg0C4Yuj00alHsXM/Zt+IxOCMH+mcn5Vw/TS7fFY9GqisMArN6hbzyyLC4oCG2vwv4bXFRria8Gnvx3pw=
- List-help: <mailto:qt-interest-request@trolltech.com?subject=help>
- List-post: <mailto:qt-interest@trolltech.com>
- List-subscribe: <mailto:qt-interest-request@trolltech.com?subject=subscribe>
- List-unsubscribe: <mailto:qt-interest-request@trolltech.com?subject=unsubscribe>
- Resent-from: qt-interest@xxxxxxxxxxxxx
- Resent-message-id: <q_MZCB.A.teC.0RQMIB@esparsett>
- Resent-sender: qt-interest-request@xxxxxxxxxxxxx
- Thread-index: Aci3X4kZTkJpZ+GBSMOsylQzdHkJ6QCA/XRg
- To: <qt-interest@xxxxxxxxxxxxx>
I can suggest the following way.
Within insertRows() store somewhere new row with invalid variants in all columns â QVariant();
flags() should return no edition flag for all columns except first.
When user sets first column with setData(), you can initialize all other columns with appropriate objects and allow editing them via flags() .
From: Yifei Li [mailto:yifli@xxxxxxx]
Sent: Friday, May 16, 2008 10:16 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: a question on QTableModel::insertRows
My table lets users view/edit input to the program. The first column in the table determines the data type in other columns.
For example, if the value of the first column is T, than other columns will have data of type MyClass<T> (a template class)
So I really can not insert any 'abstract' rows because even though I can make abstract values for columns other than the
first one, I still need specific type information from the first column. For example, only if I know the value of first column
is float, than I can use the default constructor of class MyClass<float> to initialize the value for other columns
Any ideas?
Thanks
Yifei
----- Original Message -----
From: ÐÐÑÐÐ ÐÐÑÐÑÐÐÐ <mailto:uksus70@xxxxxxxxx>
To: qt-interest@xxxxxxxxxxxxx
Sent: Friday, May 16, 2008 01:54
Subject: RE: a question on QTableModel::insertRows
What are those different things?
Perhaps, you should insert some abstract rows, and then call setData for those rows. And finally call submit(), where you can analyze rowâs data and submit âdifferentâ things.
From: Yifei Li [mailto:yifli@xxxxxxx]
Sent: Friday, May 16, 2008 10:08 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: a question on QTableModel::insertRows
Hi all,
I'm reimplementing QTableModel::insertRows for a customized class inheriting QAbstractTableModel.
I want the method to insert different things based on different parameters into my data model. However, I don't think this is
possible for insertRows since there is no place for me to pass any additional parameter to it
Could someone give me an advice?
Thanks
Yifei
Message 5 in thread
My table lets users view/edit input to the program. The first column in the table determines the data type in other columns.
For example, if the value of the first column is T, than other columns will have data of type MyClass<T> (a template class)
So I really can not insert any 'abstract' rows because even though I can make abstract values for columns other than the
first one, I still need specific type information from the first column. For example, only if I know the value of first column
is float, than I can use the default constructor of class MyClass<float> to initialize the value for other columns
Any ideas?
Thanks
Yifei
----- Original Message -----
From: ÐÐÑÐÐ ÐÐÑÐÑÐÐÐ
To: qt-interest@xxxxxxxxxxxxx
Sent: Friday, May 16, 2008 01:54
Subject: RE: a question on QTableModel::insertRows
What are those different things?
Perhaps, you should insert some abstract rows, and then call setData for those rows. And finally call submit(), where you can analyze rowâs data and submit âdifferentâ things.
From: Yifei Li [mailto:yifli@xxxxxxx]
Sent: Friday, May 16, 2008 10:08 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: a question on QTableModel::insertRows
Hi all,
I'm reimplementing QTableModel::insertRows for a customized class inheriting QAbstractTableModel.
I want the method to insert different things based on different parameters into my data model. However, I don't think this is
possible for insertRows since there is no place for me to pass any additional parameter to it
Could someone give me an advice?
Thanks
Yifei