Results 1 to 5 of 5

Thread: Q3Table text alignment problem

  1. #1
    Join Date
    Jun 2008
    Posts
    64
    Thanks
    7
    Qt products
    Qt3 Qt4

    Default Q3Table text alignment problem

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q3Table text alignment problem

    You can sublass Q3TableItem and add a method for setting the alignment.

  3. #3
    Join Date
    Jun 2008
    Posts
    64
    Thanks
    7
    Qt products
    Qt3 Qt4

    Question Re: Q3Table text alignment problem

    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??

  4. #4
    Join Date
    Jun 2008
    Posts
    64
    Thanks
    7
    Qt products
    Qt3 Qt4

    Question Furthermore Q3Table problem

    Furthermore, if I want to switch the QT3 Q3Table code to QT4 QTableWidget, what changes should I make to the following methods?

    Qt Code:
    1. setResizePolicy( Q3Table::Default );
    2. setReadOnly( TRUE );
    3. setTopMargin(31);
    4. setLeftMargin(-1);
    5. setFocusStyle( Q3Table::FollowStyle );
    6. updateCell( 1, 0 );
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q3Table text alignment problem

    Quote Originally Posted by batileon View Post
    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.


    Quote Originally Posted by batileon View Post
    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.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  3. QTableWidget setSpan text display problem
    By sureshbabu in forum Qt Programming
    Replies: 3
    Last Post: 8th May 2008, 16:14
  4. problem with reading text files
    By Axsis in forum Newbie
    Replies: 1
    Last Post: 25th April 2008, 12:29
  5. Replies: 1
    Last Post: 30th November 2007, 10:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.