Results 1 to 19 of 19

Thread: Need Image rightside of QListwidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Need Image rightside of QListwidget

    Geometry of painted item is passed in the style option. What are MyDelegate::x and MyDelegate::y? What's wrong with the approach I presented above?
    J-P Nurmi

  2. #2
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need Image rightside of QListwidget

    Hello sir,

    How to get geometry

    Sorry, I didn't get how to get geometry of painting item, So i used my own points to paint the items that x and y are my points, How can we get geometry from style option and what is style option ? Plese help me.

    Thaks for your response,

    Rajesh,S

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Need Image rightside of QListwidget

    Quote Originally Posted by rajeshs View Post
    How to get geometry

    [B]Sorry, I didn't get how to get geometry of painting item, So i used my own points to paint the items that x and y are my points, How can we get geometry from style option and what is style option ?
    A style option is used to pass information on how to render the corresponding item. A QStyleOptionViewItem is passed as second parameter to QItemDelegate::paint() (see the example in paint() docs). Use QStyleOption::rect to get the geometry.
    J-P Nurmi

  4. #4
    Join Date
    Oct 2012
    Location
    Gurgaon, Haryana, India
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Need Image rightside of QListwidget

    Can any one give me idea for the definition of this function plz
    Qt Code:
    1. calcDecorationRect(pixmap1, Qt::AlignLeft);
    To copy to clipboard, switch view to plain text mode 

    i also needed to display same type of view.
    As i am new user in qt so thats why i am not getting any idea how to write this function's definition.

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,330
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Need Image rightside of QListwidget

    i am not getting any idea how to write this function's definition.
    What do you think this function is supposed to do? How is its result used? What have you tried so far?

  6. #6
    Join Date
    Oct 2012
    Location
    Gurgaon, Haryana, India
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Need Image rightside of QListwidget

    May be this function is used for the alignment of Icons with respect to rect (item's Rect)

  7. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,330
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Need Image rightside of QListwidget

    May be this function is used for the alignment of Icons with respect to rect (item's Rect)
    Yes, so how have you tried to implement it? If you want the item to look like this: [Icon1][Item text][Icon2] how would you determine the size and position of the [Icon] rectangles?

    I'm not going to write the code for you. You have to make an attempt to do it yourself first, and if you fail, post the code you tried and we will help you get it right.

Similar Threads

  1. Help needed handling image data
    By toratora in forum General Programming
    Replies: 2
    Last Post: 11th May 2007, 09:24
  2. how i can add image in my toolbar
    By jyoti in forum Qt Tools
    Replies: 7
    Last Post: 19th December 2006, 14:39
  3. Replies: 13
    Last Post: 15th December 2006, 11:52
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 19:01

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
  •  
Qt is a trademark of The Qt Company.