Results 1 to 2 of 2

Thread: Multi-column Q3ListView and horizontal scrolling

  1. #1
    Join Date
    Oct 2009
    Posts
    38
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Unhappy Multi-column Q3ListView and horizontal scrolling

    Hi all,

    Asked this on StackOverflow, but no bites. Thought I'd see if anyone here has knowledge of the Q3ListView class available in Qt 4.7. Looking for an answer to the question of getting horizontal scrolling to happen in a Q3ListView with multiple columns. I assume Q3ListView was used as a quick way to upgrade to 4.x. Legacy code, and I am tasked with making this thing horizontally scrollable.

    The list view has two columns, the first of which contains titles for the content to the right, and so it always shows full text, as none of the text is very long. The second column can have text that is wider than my 24" screen can show (seen when I roll over it and view the tool tip).

    The Q3ListView object was created in Designer with both vScrollBarMode and hScrollBarMode set as Auto (the default). Since the number of entries is quite large, the vertical scrollbar always shows and I can scroll up and down. When I see data in the second column that is too long for the width available, it always has an ellipsis (...) at the end with no horizontal scrollbar shown. If I change the definition of the horizontal scrollback in Designer to AlwaysOn, I see the horizontal scroll bar, but it's greyed, and has no handle, even though there is text too long for the viewable area.

    I'm just wondering how I can get a functioning horizontal scroll bar for my Q3ListView that will be able to scroll to show the full text of the second column. Any suggestions?

    --

    P.S. - Just tried something new. I called the setColumnWidthMode() function on the second column of the Q3ListView object as follows:
    Qt Code:
    1. myUi.myValueList->setColumnWidthMode(1, Q3ListView::Maximum);
    To copy to clipboard, switch view to plain text mode 
    Didn't make any difference. There is still an ellipsis applied at the end of long text. I tried putting this inside a QScrollArea, but still no go.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Multi-column Q3ListView and horizontal scrolling

    Have you tried changing the Q3ScrollView::ResizePolicy?

    Depending on how complicated the code around the view is, it might be worth to consider porting to QTreeWidget

    Cheers,
    _

Similar Threads

  1. QTableView and stylesheet horizontal scrolling problem
    By aphexgt in forum Qt Programming
    Replies: 0
    Last Post: 18th October 2012, 23:00
  2. Replies: 5
    Last Post: 15th October 2012, 13:14
  3. Replies: 4
    Last Post: 2nd January 2011, 07:46
  4. Horizontal Scrolling QListWidget
    By bl1nk in forum Qt Programming
    Replies: 1
    Last Post: 17th July 2010, 08:44
  5. Q3ListView highlight part of a column
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 5th May 2006, 09:26

Tags for this Thread

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.