forked from openkylin/qt5-ukui-platformtheme
对话框显示模式在内容加载后再设置
This commit is contained in:
parent
8d4c5947f6
commit
c88380eb16
|
@ -2665,6 +2665,11 @@ bool KyFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModality wi
|
|||
}
|
||||
}
|
||||
|
||||
if(options()->viewMode() == QFileDialog::List && mKyFileDialog->viewMode() != KyNativeFileDialog::Icon)
|
||||
mKyFileDialog->setViewMode(KyNativeFileDialog::Icon);
|
||||
else if(options()->viewMode() == QFileDialog::Detail && mKyFileDialog->viewMode() != KyNativeFileDialog::List)
|
||||
mKyFileDialog->setViewMode(KyNativeFileDialog::List);
|
||||
|
||||
QString platform = QGuiApplication::platformName();
|
||||
if(platform.startsWith(QLatin1String("wayland"),Qt::CaseInsensitive))
|
||||
{
|
||||
|
@ -2713,10 +2718,6 @@ void KyFileDialogHelper::initDialog()
|
|||
pDebug << "initDialog filters:" << options()->nameFilters();
|
||||
mKyFileDialog->setNameFilters(options()->nameFilters());
|
||||
pDebug << "view mode:" << options()->viewMode() << mKyFileDialog->viewMode();
|
||||
if(options()->viewMode() == QFileDialog::List && mKyFileDialog->viewMode() != KyNativeFileDialog::Icon)
|
||||
mKyFileDialog->setViewMode(KyNativeFileDialog::Icon);
|
||||
else if(options()->viewMode() == QFileDialog::Detail && mKyFileDialog->viewMode() != KyNativeFileDialog::List)
|
||||
mKyFileDialog->setViewMode(KyNativeFileDialog::List);
|
||||
|
||||
for(int i = 0; i < QFileDialogOptions::DialogLabelCount; ++i) {
|
||||
auto label = static_cast<QFileDialogOptions::DialogLabel>(i);
|
||||
|
|
Loading…
Reference in New Issue