Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to design the widget like this(1PassWord for PC);

How to design the widget like this(1PassWord for PC);

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 295 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • qazaq408Q Offline
    qazaq408Q Offline
    qazaq408
    wrote on last edited by
    #1

    I try to use QListWidget or QListView,but there's a problem. I don't know how to insert letter into the QListWidget(or QListView).At last ,i had to use twenty and seven(A-Z and digit) QListView...it looks a litte foolish...
    Any good idea to this
    password.jpg

    raven-worxR 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Do you mean the A,B,C letters for sort of group caption?

      In any case you should use a delegate to draw it as you want.
      https://doc.qt.io/qt-5/qstyleditemdelegate.html

      This is similar
      https://qt-articles.blogspot.com/2010/07/how-to-customize-listview-in-qt-using.html

      1 Reply Last reply
      1
      • qazaq408Q qazaq408

        I try to use QListWidget or QListView,but there's a problem. I don't know how to insert letter into the QListWidget(or QListView).At last ,i had to use twenty and seven(A-Z and digit) QListView...it looks a litte foolish...
        Any good idea to this
        password.jpg

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @qazaq408
        in QtWidgets there is directly no such feature. You could mimic it with a QTreeView and styled item delegate. The first level items are the sections and the second level items are the actual items in your list.

        The QML ListView supports such sections out of the box though.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved