From 3d272951dc9f055e9fc5064098f6a165a8c3e623 Mon Sep 17 00:00:00 2001 From: Peter Yard Date: Fri, 24 Jul 2009 11:22:30 +1000 Subject: #215745 Doc Change, virtual function (operator) called from constructor --- src/gui/itemviews/qlistwidget.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/gui/itemviews/qlistwidget.cpp b/src/gui/itemviews/qlistwidget.cpp index 7113217..121b1df 100644 --- a/src/gui/itemviews/qlistwidget.cpp +++ b/src/gui/itemviews/qlistwidget.cpp @@ -561,6 +561,13 @@ Qt::DropActions QListModel::supportedDropActions() const given \a parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem(). + + \note that this constructor inserts this same object into the model of + the parent that is passed to the constructor. If the model is sorted then + the behavior of the insert is undetermined since the model will call + the '<' operator method on this object which has still not yet been + constructed. In this case it would be better not to specify the parent + and use the QListWidget::insertItem method to insert the item instead. \sa type() */ @@ -582,6 +589,13 @@ QListWidgetItem::QListWidgetItem(QListWidget *view, int type) given \a text and \a parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem(). + + \note that this constructor inserts this same object into the model of + the parent that is passed to the constructor. If the model is sorted then + the behavior of the insert is undetermined since the model will call + the '<' operator method on this object which has still not yet been + constructed. In this case it would be better not to specify the parent + and use the QListWidget::insertItem method to insert the item instead. \sa type() */ @@ -605,7 +619,14 @@ QListWidgetItem::QListWidgetItem(const QString &text, QListWidget *view, int typ given \a icon, \a text and \a parent. If the parent is not specified, the item will need to be inserted into a list widget with QListWidget::insertItem(). - + + \note that this constructor inserts this same object into the model of + the parent that is passed to the constructor. If the model is sorted then + the behavior of the insert is undetermined since the model will call + the '<' operator method on this object which has still not yet been + constructed. In this case it would be better not to specify the parent + and use the QListWidget::insertItem method to insert the item instead. + \sa type() */ QListWidgetItem::QListWidgetItem(const QIcon &icon,const QString &text, -- cgit v0.12