[Interest] Regarding appending checkbox in QListView

Jha Sonakumar Sona.Jha at TechMahindra.com
Mon Feb 23 07:43:16 CET 2015


Hi all,

Is there anyway to append checkbox in each row of the QListView?

Checkbox can be added  using QStandardItem, but i want checkbox should be shown after the item .


code:

QStandardItemModel *model = new QStandardItemModel(this);
for (int i = 0; i < rowCount; ++i) {
        QString sNo = QString::number(i+1);
        QString str  = dHandler.m_infoData.at(i).event;

        QStandardItem *item = new QStandardItem(str.prepend(sNo));
        item->setCheckable(true);

        model->appendRow(item);
    }
    ui->listView->setModel(model);



Best Regards

Sona


============================================================================================================================
Disclaimer:  This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.
============================================================================================================================

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150223/addc3fa1/attachment.html>


More information about the Interest mailing list