Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 709343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:29:38+00:00 2026-05-14T04:29:38+00:00

Using a QListView, and QStandardItemModel, is it possible to display icons in the list

  • 0

Using a QListView, and QStandardItemModel, is it possible to display icons in the list view without displaying the associated text? QStandardItem is defined as so:

QStandardItem ( const QIcon & icon, const QString & text ) 

So it seems to require a text string of some sort – I only want the icon displayed. If I use the following code, I get the icons as requested, but I also get a blank text element underneath them. I don’t want this.

ImageListView->setViewMode( QListView::IconMode );
{
     QStandardItemModel *iStandardModel = new QStandardItemModel(this);
     QStandardItem* item1 = new QStandardItem(QIcon("images/shield-280x280.png"),"");
     QStandardItem* item2 = new QStandardItem(QIcon("images/shield-280x280.png"),"");

     iStandardModel->appendRow(item1);
     iStandardModel->appendRow(item2);
     ImageListView->setIconSize(QSize(100,100));
     ImageListView->setUniformItemSizes(true);
     ImageListView->setDragDropMode(QAbstractItemView::DropOnly);
     ImageListView->setModel(iStandardModel);
}

If I go to the trouble of building a custom model, can I resolve this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:29:38+00:00Added an answer on May 14, 2026 at 4:29 am

    Yes, you can do.

    first you create a delegate associated with the list-view.Then,

    While inserting the elements to the listview, use set-data function to insert the icon and in the paint event of delegate you handle the drawing icon. i hope its clear.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using listview to display three textviews(values for these text views where come
I have implemented a list of users in my Qt program, using the model/view
I'm using .NET 2.0 with standard controls. I want to display a simple list
I have been trying to display a list that I build using PySide. It
I am using listview in which each item (of list view) has a checkbox
Using Qt4's model/view framework, I have a list of items displayed as Foo (38
I'm using ClistView to display the content of a dataprovider. ClistView is supposed to
I am using Listview,the View selected is largeicon mode. The problem i am facing
I am using ListView's large icon view, to view database inserts with image per
I have ObservableCollection for my Collection og Movie files. Im using ListView to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.