Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how can i dynamically switch between use ItemDelegate and not use ItemDelegate ?
Forum Update on Monday, May 27th 2025

how can i dynamically switch between use ItemDelegate and not use ItemDelegate ?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 382 Views
  • 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.
  • O Offline
    O Offline
    opengpu2
    wrote on 31 Mar 2015, 06:25 last edited by
    #1

    how can i dynamically switch between use ItemDelegate and not use ItemDelegate ?
    when IconMode, i want to use ItemDeletgate.
    while ListMode, i don't want to use ItemDelegate.

    i tried, when ListMode, setItemDelegate(NULL), but then paint nothing...
    and i also tried in the inherited QAbstractItemDelegate class's paint, sizeHint. write return if Not IconMode.but also failed with nothing paint.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 31 Mar 2015, 23:14 last edited by
      #2

      Hi,

      Either set/remove the delegate when you change the mode or write a delegate that you will configure to act as pass-trough when you change the mode.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      1/2

      31 Mar 2015, 06:25

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved