Which Qt widget to use for implementing image thumbnail browser (displaying tiles)?

后端 未结 2 1582
囚心锁ツ
囚心锁ツ 2020-12-24 12:48

I\'m looking to essentially replicate this:

\"enter

What is the most appropria

相关标签:
2条回答
  • 2020-12-24 13:32

    definitly QTableView, Using custom itemDelegate to present every block, implements the custom widget to display the Image and Text Title

    0 讨论(0)
  • 2020-12-24 13:36

    You should use QListWidget (or QListView and subclass QAbstractItemModel) and set it's view mode to IconMode.

    Example :

    m_listeWidget->setViewMode(QListWidget::IconMode);
    
    m_listeWidget->setIconSize(QSize(200,200));
    
    m_listeWidget->setResizeMode(QListWidget::Adjust);
    
    m_listeWidget->addItem(new QListWidgetItem(QIcon("../earth.jpg"),"Earth"));
    m_listeWidget->addItem(new QListWidgetItem(QIcon("../tornado.jpg"),"Tornado"));
    m_listeWidget->addItem(new QListWidgetItem(QIcon("../ics.jpg"),"Wallpaper"));
    

    Result :

    enter image description here

    0 讨论(0)
提交回复
热议问题