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. Make a line break in a layout or container
Forum Updated to NodeBB v4.3 + New Features

Make a line break in a layout or container

Scheduled Pinned Locked Moved Solved General and Desktop
25 Posts 4 Posters 5.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.
  • E Offline
    E Offline
    EL-jos
    wrote on last edited by
    #21

    @mrjj said in Make a line break in a layout or container:

    A Delegate is a custem draw for a ListView ( or any view)
    So instead of drawing the normal cell, you make a small class where you use
    QPainter to draw the cell how you want it.
    Its much faster than having a tons of QLabels in a layout as
    Views has been optimized for having many items.
    so the clear benefit is that it works very fast and it can draw however you like.
    (well you have to program that part)
    Using html , you would have to construct the right html to have it look how u want.
    Some thing be much harder. Like the clock/time in the whatapps sample.
    With Delegate you can simply paint it there.
    However, learning to use Views and Delegates will take some practice.

    Thank you very much for the answer.
    but can you give me a training link on the view and the delegate?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #22

      Did you took a look at the documentation I linked to earlier ? It does explain everything with examples.

      There's the model view tutorial and the Item Views examples.

      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
      2
      • E Offline
        E Offline
        EL-jos
        wrote on last edited by
        #23

        @SGaist said in Make a line break in a layout or container:

        Did you took a look at the documentation I linked to earlier ? It does explain everything with examples.

        Yeah, but it's a little complicated for me.

        mrjjM 1 Reply Last reply
        0
        • E EL-jos

          @SGaist said in Make a line break in a layout or container:

          Did you took a look at the documentation I linked to earlier ? It does explain everything with examples.

          Yeah, but it's a little complicated for me.

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

          @EL-jos
          Hi
          maybe this is easier to follow ?
          https://www.bogotobogo.com/Qt/Qt5_QListView_QStringListModel_ModelView_MVC.php

          Try to follow the steps and build the same.
          It looks more complicated than it is.

          1 Reply Last reply
          0
          • E Offline
            E Offline
            EL-jos
            wrote on last edited by
            #25

            @mrjj said in Make a line break in a layout or container:

            Try to follow the steps and build the same.
            It looks more complicated than it is.
            All right, I'll take your advice, anyway, thank you for your answers and I can put the subject as resolved.

            1 Reply Last reply
            1

            • Login

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