diff options
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 3 | ||||
-rw-r--r-- | src/widgets/dialogs/qmessagebox.cpp | 6 | ||||
-rw-r--r-- | src/widgets/dialogs/qsidebar.cpp | 2 | ||||
-rw-r--r-- | src/widgets/dialogs/qwizard.cpp | 6 |
4 files changed, 9 insertions, 8 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index e24d308d65..6b82669f07 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2015,6 +2015,9 @@ QStringList QFileDialog::history() const Sets the item delegate used to render items in the views in the file dialog to the given \a delegate. + Any existing delegate will be removed, but not deleted. QFileDialog + does not take ownership of \a delegate. + \warning You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the \l{QAbstractItemDelegate::}{closeEditor()} diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 854fee6e33..4e7a4a65e3 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -305,7 +305,7 @@ void QMessageBoxPrivate::setupLayout() Q_Q(QMessageBox); delete q->layout(); QGridLayout *grid = new QGridLayout; - bool hasIcon = iconLabel->pixmap() && !iconLabel->pixmap()->isNull(); + bool hasIcon = !iconLabel->pixmap(Qt::ReturnByValue).isNull(); if (hasIcon) grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop); @@ -1323,9 +1323,7 @@ void QMessageBox::setIcon(Icon icon) QPixmap QMessageBox::iconPixmap() const { Q_D(const QMessageBox); - if (d->iconLabel && d->iconLabel->pixmap()) - return *d->iconLabel->pixmap(); - return QPixmap(); + return d->iconLabel->pixmap(Qt::ReturnByValue); } void QMessageBox::setIconPixmap(const QPixmap &pixmap) diff --git a/src/widgets/dialogs/qsidebar.cpp b/src/widgets/dialogs/qsidebar.cpp index dfb707eda0..4272b612ec 100644 --- a/src/widgets/dialogs/qsidebar.cpp +++ b/src/widgets/dialogs/qsidebar.cpp @@ -163,7 +163,7 @@ bool QUrlModel::dropMimeData(const QMimeData *data, Qt::DropAction action, */ bool QUrlModel::setData(const QModelIndex &index, const QVariant &value, int role) { - if (value.type() == QVariant::Url) { + if (value.userType() == QMetaType::QUrl) { QUrl url = value.toUrl(); QModelIndex dirIndex = fileSystemModel->index(url.toLocalFile()); //On windows the popup display the "C:\", convert to nativeSeparators diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index a4789f40b1..87f6875c8c 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -452,8 +452,8 @@ public: } QSize minimumSizeHint() const override { - if (pixmap() && !pixmap()->isNull()) - return pixmap()->size() / pixmap()->devicePixelRatio(); + if (!pixmap(Qt::ReturnByValue).isNull()) + return pixmap(Qt::ReturnByValue).size() / pixmap(Qt::ReturnByValue).devicePixelRatio(); return QFrame::minimumSizeHint(); } @@ -2924,7 +2924,7 @@ void QWizard::setDefaultProperty(const char *className, const char *property, or when the watermark is not provided the side widget is displayed on the left side of the wizard. - Passing 0 shows no side widget. + Passing \nullptr shows no side widget. When the \a widget is not \nullptr the wizard reparents it. |