Results 1 to 5 of 5

Thread: Anchoring a listview item to the right

  1. #1
    Join Date
    Jan 2010
    Posts
    95
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Anchoring a listview item to the right

    Hi All,

    I have a list model with items. The list view is a horizontal listview.

    If the width of the list view is less than the width of all the items, it shows a more button with a drop-down showing the remaining items.

    However I need to anchor one item permanently to the right of the view, even if the items are less in the list.

    Kindly advice.

  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: Anchoring a listview item to the right

    Maybe add it after the list view?

    Cheers,
    _

  3. #3
    Join Date
    Jan 2010
    Posts
    95
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Anchoring a listview item to the right

    Can it be part of the list view and be anchored programmatically at runtime??

  4. #4
    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: Anchoring a listview item to the right

    I am not sure I understand.

    You said this item is always there, always to the right of the list view.
    Which would make putting it into that position the most efficient solution.

    If it is part of the Flickable content of the ListView, it will move.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    volcano (31st March 2016)

  6. #5
    Join Date
    Mar 2016
    Location
    India
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt5
    Platforms
    Unix/X11

    Default Re: Anchoring a listview item to the right

    Please try once by using model's index.
    if you will get that item in the list always you can make a comparison based the item(ex. item name)

    you can try something like this.

    anchor.right: parent.right
    rightMargin: conditionAboutItem ? 0 : 10

    plz let me know in case if you need any further help

  7. The following user says thank you to mkreddy for this useful post:

    volcano (31st March 2016)

Similar Threads

  1. I want to edit listview's item using contextmenu. How to?
    By melody:p in forum Qt Programming
    Replies: 3
    Last Post: 6th August 2012, 02:40
  2. Replies: 2
    Last Post: 3rd August 2012, 12:05
  3. listview item focusing
    By addu in forum Qt Programming
    Replies: 7
    Last Post: 18th August 2009, 08:07
  4. Set default Selected item in ListView (QSqlQueryModel)
    By jeffpogo in forum Qt Programming
    Replies: 0
    Last Post: 26th May 2009, 23:12
  5. getting clicked item from listview
    By addu in forum Qt Programming
    Replies: 6
    Last Post: 14th May 2009, 11:33

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.