Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QListView / QListWidget with costum layout

    General and Desktop
    qlistview qlistwidget layout
    3
    5
    2139
    Loading More Posts
    • 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.
    • J
      joejoe last edited by

      Hello!

      I'm creating an application where I have a weather data and I want to create a listview with objects from the list . I want to dispaly a temperature, picture of the weather and for example a date...and for that I need something as is ArrayAdapter in Android but I cannot find anything like it. could you please tell me how can I create something like this? thank you.

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi and welcome
        It is not really clear if you mean for desktop or for mobile.

        For desktop, you can listview with a custom model
        http://doc.qt.io/qt-5.5/model-view-programming.html#creating-new-models

        If you are more into something less involved and not 10.000 items then
        using a scroll area widget with a layout and widgets as container for each row
        containing the Image, label and what you need.

        J 1 Reply Last reply Reply Quote 1
        • J
          joejoe @mrjj last edited by

          @mrjj Hello, thank you

          Right now desktop:)

          thank you again

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @joejoe last edited by

            @joejoe
            Hi
            The scroll area is/can become heavy on mobile devices where as model /view
            is super optimised. That said, I was very surprised on desktop that 5000
            rows was not really as heavy as expected.
            Also, to show image on screen. you can use a Qlabel. Im mention it as when I started
            i did not really think label would show image :)

            1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              Hi and welcome to devnet,

              Sounds like a job for QStyledItemDelegate

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply Reply Quote 0
              • First post
                Last post