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. QAbstractItemDelegate problem!!!

QAbstractItemDelegate problem!!!

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 473 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 last edited by
    #1

    QAbstractItemDelegate problem:
    i inherite a class from QAbstractItemDelegate , in order to custom my own item appearence in QListWidget.
    i set a m_nSize in the QAbstractItemDelegate, and update it outside the class dynamically. m_nSize is used in sizeHint(...), as return QSize(m_nSize, m_nSize);
    however, i found when i dynamic change the m_nSize, the items in the QListWidget change into new size very slow and the Item rect seems still the old size, no matter if i call the QListWidget::update() or not. However, when i resize the widget, the result turns Right.

    1 Reply Last reply
    0
    • O Offline
      O Offline
      opengpu2
      wrote on last edited by
      #2

      solved.
      and really weried. i add this code when i set the m_nIconSize.
      QModelIndex temp;
      emit sizeHintChanged(temp);

      and it change the items size quickly.

      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 Extensions
      • Unsolved