Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Unsolved How to custom QListView ?

    General and Desktop
    4
    5
    2404
    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.
    • sonichy
      sonichy last edited by

      alt text

      https://github.com/sonichy

      jsulm joeQ 2 Replies Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @sonichy last edited by

        @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 Reply Quote 2
        • joeQ
          joeQ @sonichy last edited by

          @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 Reply Quote 0
          • sonichy
            sonichy last edited by

            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

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

              @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 Reply Quote 1
              • First post
                Last post