Results 1 to 6 of 6

Thread: QListWidgetItem's icon and text orientation

  1. #1
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default QListWidgetItem's icon and text orientation

    Hello,
    i searched the forum for this problem and tried the solution advices but no one of them worked.
    I am trying to set text under the icon in qlistwidgetitem. i tried so many thing but nothing happened.
    Is there anyone who is already solved this problem ?
    Thank you
    Circass

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QListWidgetItem's icon and text orientation

    show us your code, what you have tried!

  3. #3
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListWidgetItem's icon and text orientation

    imagePath = createThumbFromLoader(c->getLoader());
    QListWidgetItem *i = new QListWidgetItem();
    QIcon icon;
    icon.addPixmap(QPixmap(QString::fromUtf8(imagePath .toAscii())), QIcon::Normal, QIcon::Off);
    i->setIcon(icon);
    textWidget = QString("%1\n%2\n%3").arg(c->getLoader()->getID()).arg(c->getLoader()->getSID()).arg(c->getLoader()->getName());
    i->setText(textWidget);
    i->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
    ui.thumbnailWidget->addItem(i);

    this is my code.

    I tried to set maxwidth and height options manually and they didnt work.
    I tried to change viewmode to iconmode and it didnt work to (it changed something but not what i want.)

    These are the ways that i tried.
    Thank you.
    Circass

  4. #4
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListWidgetItem's icon and text orientation

    Any idea about the solution of my problem ?

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QListWidgetItem's icon and text orientation

    Your posted code does not say very much... Normally QListView::IconMode is what you are looking for, If it does not what you want, write your own delegate!

  6. #6
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListWidgetItem's icon and text orientation

    Hmm, after you wrote i did try the iconmode again and it worked. I think at first try i gave max size values so it didnt work as i want.
    Thank you
    Circass

Similar Threads

  1. Replies: 2
    Last Post: 14th June 2010, 09:40
  2. problem in presentation of text-icon QListWidgetItem
    By utopia500 in forum Qt Programming
    Replies: 4
    Last Post: 16th April 2010, 10:12
  3. QTabBar Text and Icon orientation
    By Gravis in forum Qt Programming
    Replies: 0
    Last Post: 16th December 2009, 08:55
  4. Replies: 2
    Last Post: 15th July 2009, 15:53
  5. Vertical Orientation of Text.
    By ashukla in forum Qt Programming
    Replies: 9
    Last Post: 28th January 2008, 12:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.