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 custom QListView ?
QtWS25 Last Chance

How to custom QListView ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 2.8k Views
  • 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by
    #1

    alt text

    https://github.com/sonichy

    jsulmJ joeQJ 2 Replies Last reply
    0
    • sonichyS sonichy

      alt text

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @sonichy http://doc.qt.io/qt-5/model-view-programming.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • sonichyS sonichy

        alt text

        joeQJ Offline
        joeQJ Offline
        joeQ
        wrote on last edited by
        #3

        @sonichy As we all know. When we installed QtCreate App. we will find more example app under the QtXXXX folder. so, if we want to finished some functinos, please to search the demos or examples from internet first. then , if we get into trouble, we should to see the qt help manual second. at
        last, ask at here.

        Just do it!

        1 Reply Last reply
        0
        • sonichyS Offline
          sonichyS Offline
          sonichy
          wrote on last edited by
          #4

          alt text
          QListWidget is better than QlistView.
          Design a widget for item , then listWidget->setItemWidget .

          itemfind=new ItemFind;
          itemfind->ui->labelName->setText(name);
          itemfind->ui->labelSex->setText(sex);
          itemfind->ui->labelDomicile->setText(domicile);
          QListWidgetItem *LWI = new QListWidgetItem(ui->listWidget);
          ui->listWidget->addItem(LWI);
          ui->listWidget->setItemWidget(LWI,itemfind);
          LWI->setSizeHint(QSize(140,70)); // Important ! No size will be invisible !

          https://github.com/sonichy

          mrjjM 1 Reply Last reply
          0
          • sonichyS sonichy

            alt text
            QListWidget is better than QlistView.
            Design a widget for item , then listWidget->setItemWidget .

            itemfind=new ItemFind;
            itemfind->ui->labelName->setText(name);
            itemfind->ui->labelSex->setText(sex);
            itemfind->ui->labelDomicile->setText(domicile);
            QListWidgetItem *LWI = new QListWidgetItem(ui->listWidget);
            ui->listWidget->addItem(LWI);
            ui->listWidget->setItemWidget(LWI,itemfind);
            LWI->setSizeHint(QSize(140,70)); // Important ! No size will be invisible !

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

            @sonichy
            Hi
            Just a note, setItemWidget is cool for composite creations but can suffer from performance issues
            on non Desktop class devices if the item count get high.
            In such use cases ( many items) , a Delegate is the normal way
            http://qt-articles.blogspot.dk/2010/07/how-to-customize-listview-in-qt-using.html

            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