Hello,
I have a problem with painting pushbutton with icon in delegate. The problem is that when I pain Icon with pushbutton left margin/"left position value" is set to 0 = left side of the column in view, but when I don't paint Icon everything is good and I can set left margin to some other value i.e. 10 (with is equal to left value of the CE_PushButton).
The painting looks like this:
Qt Code:
  1. pb_Style.state = option.state;
  2. pb_Style.rect = option.rect;
  3. // pb_Style.icon = QIcon( ":/icon.png" );
  4. // pb_Style.iconSize = QSize( 12, 12 );
  5.  
  6. /** when Icon is drawn delegate calculate wrong left pos with is equal to the row left */
  7. QApplication::style()->drawControl( QStyle::CE_PushButton, &pb_Style, painter );
To copy to clipboard, switch view to plain text mode 

The result is this: deleg.JPG , icon is painted all the way to the left row pos, but what I want is to paint it to left pos of the pushbutton (CE_PushButton).
The problem is probably that I don't pas rect for the Icon properly but...

Thanks for any help