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. QListView / QListWidget with costum layout
Forum Updated to NodeBB v4.3 + New Features

QListView / QListWidget with costum layout

Scheduled Pinned Locked Moved Unsolved General and Desktop
qlistviewqlistwidgetlayout
5 Posts 3 Posters 2.5k 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.
  • J Offline
    J Offline
    joejoe
    wrote on last edited by
    #1

    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
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      1
      • mrjjM mrjj

        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 Offline
        J Offline
        joejoe
        wrote on last edited by
        #3

        @mrjj Hello, thank you

        Right now desktop:)

        thank you again

        mrjjM 1 Reply Last reply
        0
        • J joejoe

          @mrjj Hello, thank you

          Right now desktop:)

          thank you again

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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
            0

            • Login

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