×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    89

    Question how to hide icon name in qlist widget?

    hi, i want to hide the name of the icon in the qlistwidget
    i have the following:

    ui->listWidget->setViewMode(QListWidget::IconMode);
    QListWidgetItem *itm = new QListWidgetItem(nm);
    itm->setIcon(QIcon(":/new/prefix1/image.jpg"));
    ui->listWidget->addItem(itm);

    now the list widget contains the icon and the text (image.jpg)below this icon
    how can i hide this text and only show the icon?
    Thank you

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: how to hide icon name in qlist widget?

    Well, the simplest thing to do is to create a QStringList that's the conceptual twin of the QListWidget, and then store the names in the QStringList.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    11

    Re: how to hide icon name in qlist widget?

    sometimes i add item text in item tooltip
    item->setTooltip("item text");

  4. #4
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    89

    Re: how to hide icon name in qlist widget?

    Quote Originally Posted by lol1 View Post
    sometimes i add item text in item tooltip
    item->setTooltip("item text");
    what should the toolTip do???
    i add it and nothing happened..still got the text below the image..

    Quote Originally Posted by danhicksbyron View Post
    Well, the simplest thing to do is to create a QStringList that's the conceptual twin of the QListWidget, and then store the names in the QStringList.
    do u mean to store the names in QStringList and to show only the icons in the QListWidget without names as QListWidgetItem *itm = new QListWidgetItem();??

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: how to hide icon name in qlist widget?

    Well, yes, more or less. You (as I understand it) have some text that you DON'T want presented on the screen. So put it somewhere else. Easy enough to keep a QStringList synchronized with your QListWidget -- when you add to one, add to the other, etc.

Similar Threads

  1. how to hidle midle icon and midlet name in j2me
    By shwetadseema in forum Mobile Java General
    Replies: 8
    Last Post: 2011-02-18, 07:03
  2. how to hide Access point name..??
    By nehasaxena in forum Symbian
    Replies: 3
    Last Post: 2009-10-16, 09:04
  3. Replies: 1
    Last Post: 2009-10-14, 05:22
  4. How to remove or hide icon
    By heroist in forum Symbian
    Replies: 12
    Last Post: 2007-08-09, 17:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×