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. ItemView (QListView)
Forum Updated to NodeBB v4.3 + New Features

ItemView (QListView)

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 3.5k Views 1 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.
  • I Offline
    I Offline
    Immii
    wrote on last edited by
    #1

    Hi there I am trying to have my 3 customWidget shown to my list view but yet I have not found any solution.
    I want By default when my dialog with list view is shown it should show all items having CustomWidget1 when mouse is hovered on any of those item it should show customWidget2 and when mouse hover is out it should come back showing customWidget1. and the third one is when item is doubleClick it should show customWidget3.
    I tried doing this using itemdelegate createEditor() but dont know how to get mouse hover in my listview, I connected entered() signal but once item is set to my customWidget I am not getting entered() event at all.
    Please help

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      I am sorry, but the item views are really not suited for this use.
      For this use, I'd recommend to just put your items/widgets in a grid layout, and put that on a QScrollArea. If you expect to have many items (>100 or so) in your view, another solution may be needed.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        Immii
        wrote on last edited by
        #3

        Yes my view could be having more than 3k items. what other way could be best suited Andre?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Than, you simply cannot use widgets. You will have to use real delegates to do your rendering from scratch directly from the delegate. I don't know what you have in your widget, but if there are other widgets in there (buttons, checkboxes, or worse: even more complicated widgets), you have a real problem. You won't be able to replicate those properly on your own in a delegate.

          Or, alternatively, you might want to look into using QML (1) for this. In QML, it is easier to create items that behave dynamically (change appearance and / or size on hover, have buttons, etc) than it is in the widget world, but that has limitations of its own.

          1 Reply Last reply
          0
          • I Offline
            I Offline
            Immii
            wrote on last edited by
            #5

            Andre, thanx but unfortunately QML is not an option
            I do have some three to four widgets like lineEdit combo and button, let me see if I can do something using delegate

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              You are going to have a very hard time to get a delegate to work for such interactive widgets. Item views and using widgets for items just don't mix well. Creating 3000+ of your custom widgets x3 per state is never going to perform well. Note that you can use QML for only this item view. The rest of your application could still be widget based.

              1 Reply Last reply
              0
              • I Offline
                I Offline
                Immii
                wrote on last edited by
                #7

                we discussed your suggestion with team and we are kind of getting agreed on this.
                I will come back on this again when we need some help, Thank for help

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  Please take note that there are trade-offs with all of the possible approaches. QML isn't perfect either, but it might be enough for you. I cannot make that judgement for you.

                  1 Reply Last reply
                  0

                  • Login

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