Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Need help for delegate.paint. Does not work for me ...
Qt 6.12 LTS is out! See what's new in the release blog

Need help for delegate.paint. Does not work for me ...

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have a model / view schema.
    I'm developing a general multipurpose delegates, and I'd want to use some custom widgets I have.
    The first I have tested does not work:

    @void A_delegates::paint(QPainter* painter, const QStyleOptionViewItem & option,
    const QModelIndex& index) const
    QRect the_rect(option.rect);
    A_file_chooser file_chooser;
    file_chooser.setGeometry(QRect(QPoint(0,0), the_rect.size()));
    file_chooser.render(painter,the_rect.topLeft());@
    I see an empty cell ?
    I have read the doc searching something usefull about this but without success.
    Can anybody help me ? Thanks.

    ( the file chooser is as simple as a label plus a button. I can see it in other scenarios)

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      The widget, where you call render is invisble (show is never called). This implies, it is not painted.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved