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?
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
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
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
Can any one give me idea for the definition of this function plz
Qt Code:
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.
What do you think this function is supposed to do? How is its result used? What have you tried so far?i am not getting any idea how to write this function's definition.
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?May be this function is used for the alignment of Icons with respect to rect (item's Rect)
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.
Bookmarks