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. QTreeWidget::clear problem
Forum Updated to NodeBB v4.3 + New Features

QTreeWidget::clear problem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 3.7k 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.
  • R Offline
    R Offline
    rimen
    wrote on last edited by
    #1

    Is this right, after calling slot "QtreeWidget::clear()":http://developer.qt.nokia.com/doc/qt-4.8/qtreewidget.html#clear method "QTreeView::rowsAboutToBeRemoved":http://developer.qt.nokia.com/doc/qt-4.8/qtreeview.html#rowsAboutToBeRemoved must be called? I redefine rowsAboutToBeRemoved in my subclass to remove independent information, but it does not work after calling clear. Why so, after calling "QTreeWidgetItem::takeChild":http://developer.qt.nokia.com/doc/qt-4.8/qtreewidgetitem.html#takeChild and "QTreeWidgetItem::removeChild":http://developer.qt.nokia.com/doc/qt-4.8/qtreewidgetitem.html#removeChild it's work fine.

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

      No, that is wrong.
      clear() deletes all item in the treewidget and also all rows and columns.

      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
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        in case of QTreeWidget::clear() the underlying model calls beginResetModel() and endResetModel().

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Why did you redefine rowsAboutToBeRemoved ? You are supposed to call that method, not reimplement it. It is not even virtual!

          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