PDA

View Full Version : Q3Table text alignment problem



batileon
27th August 2008, 10:38
Is there any way to set the text alignment of a Q3Table apart from using setItem?

The problem is that there is a clearCell() function called in setItem() which affect the performance a lot. (It's much slower........)

I tried to use setText() to solve the performance but the alignment is wrong.........
Can anyone help me? Thanks!

jacek
27th August 2008, 19:42
You can sublass Q3TableItem and add a method for setting the alignment.

batileon
28th August 2008, 02:51
Yes, I know that.
The problem is that how can I set the Q3TableItem to the Q3Table.
Is setItem(int, int, Q3TableItem *) the only way?
I found that the performance of this method is very slow in QT4 ......
What can I do to improve the performance??

batileon
28th August 2008, 06:48
Furthermore, if I want to switch the QT3 Q3Table code to QT4 QTableWidget, what changes should I make to the following methods?



setResizePolicy( Q3Table::Default );
setReadOnly( TRUE );
setTopMargin(31);
setLeftMargin(-1);
setFocusStyle( Q3Table::FollowStyle );
updateCell( 1, 0 );

jacek
28th August 2008, 18:04
The problem is that how can I set the Q3TableItem to the Q3Table.
Once you set the item, you don't have to invoke setItem() again. You can alter the item through its methods.



Furthermore, if I want to switch the QT3 Q3Table code to QT4 QTableWidget, what changes should I make to the following methods?
If you have problems with performance, maybe you should consider using QTableView and a custom model?

Also see QHeaderView.