Fix build with -no-feature-menu

Change-Id: I29a230d70a96c3037f4e07dbe23fce13aa869089
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
bb10
Tasuku Suzuki 2024-01-31 10:31:43 +09:00
parent b0cb4a80e5
commit 8f26ff0dee
1 changed files with 2 additions and 0 deletions

View File

@ -364,9 +364,11 @@ void QSidebar::setModelAndUrls(QFileSystemModel *model, const QList<QUrl> &newUr
#if QT_CONFIG(draganddrop)
setDragDropMode(QAbstractItemView::DragDrop);
#endif
#if QT_CONFIG(menu)
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, &QSidebar::customContextMenuRequested,
this, &QSidebar::showContextMenu);
#endif
urlModel->setUrls(newUrls);
setCurrentIndex(this->model()->index(0,0));
}