×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Coimbatore
    Posts
    87

    Adding an Image to QListitemWidget

    Hi All,
    I am very new to QT and i am trying to develop an application where it should show an image at the left-hand corner side and the item name in remaining.
    I have seen many examples based on that but, i could not understand it properly or exactly.

    The link which i saw is:
    http://www.developer.nokia.com/Commu...ListWidgetItem

    and i am getting an error as this:-
    error: incomplete universal character name \U

    the problem is i could not declare the listitem and Iconlistview in that.

    thanks,
    If any answers on that will appreciated

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Adding an Image to QListitemWidget

    Try to avoid hard-coded path (referring to that article).

  3. #3
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Adding an Image to QListitemWidget

    Hi,
    this has some info re the icon stuff:
    http://tamss60.tamoggemon.com/2010/0...get-icon-size/

    Regarding unable to declare: did you add all relevant includes?
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  4. #4
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Coimbatore
    Posts
    87

    Re: Adding an Image to QListitemWidget

    Hi Tamhanna,
    I appreciate and thank you for your response.
    I need some syntax or examples in which i can get through and try to implement and check out!!!
    you had shown an basic idea for setting up an image or icon at the left corner.
    I had included all the header files and i am getting the error as stated earlier. Kindly provide me if there is any code or sample file where i can get some result from that.


    Regards and thanks once again.
    Naufal.A

  5. #5
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Coimbatore
    Posts
    87

    Re: Adding an Image to QListitemWidget

    Hi savaj,
    I am appreciating you for the response and a thanks.
    I am unable to get to you!!!
    I am not using any hard - coded path i guess!
    I just tried the sample one which is given in the article.
    Can you please specify or rectify me in that thing?
    I need some more examples or syntax to gain idea in that ., can you please explain me in detail?

    Thanks and Regards for Replying!!!!
    By,
    Naufal.A

  6. #6
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Adding an Image to QListitemWidget

    Read this article to bundle images in resource file and then use in application.

    After that you can directly use images like,

    Code:
    new QListWidgetItem(QIcon(":/myImage.PNG"),"ImageName",list);

  7. #7
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Coimbatore
    Posts
    87

    Re: Adding an Image to QListitemWidget

    Hi Savaj,
    Thanks for your piece of code that you had given !!!
    It really worked out and i am satisfied with that icon coming in front of the list.
    And one more doubt is that how to show that icon or image in little bigger manner.
    currently its very small to view and i need little more bigger!!!

    Thanks and Regards,
    Naufal.A

  8. #8
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Adding an Image to QListitemWidget

    Check setSizeHint() method of QListWidgetItem class. Just check this code example carefully.

  9. #9
    Regular Contributor
    Join Date
    Nov 2011
    Location
    Coimbatore
    Posts
    87

    Re: Adding an Image to QListitemWidget

    Hi Savaj,
    Thanks for your information!!! It worked


    Again Thanks and Regards,
    Naufal.A

Similar Threads

  1. Adding image to a button using Lwuit.
    By nirbhay007 in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2010-12-29, 08:03
  2. Adding an Image
    By neverma in forum Symbian
    Replies: 1
    Last Post: 2010-03-18, 14:48
  3. Adding image on container
    By devdattac in forum Symbian
    Replies: 4
    Last Post: 2008-12-26, 08:51
  4. Adding text to image:(
    By newbie2201 in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2008-06-18, 11:17
  5. Adding image using Vcard S40 3rd edition
    By vinay_parsi in forum Mobile Java General
    Replies: 0
    Last Post: 2007-05-24, 12:56

Posting Permissions

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