FileDialog in QML 6.5
-
I want to use the FileDialog in Linux and use the native FileDialog not with FileDialog. Because i want to side pane. I don't want to use the QTLabs File Dialog. I am trying to use theFileDailog with QtQuick in QML
import QtQuick
import QtQuick.Windowimport QtCore
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Dialogs
//import Qt.labs.platform
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")id: rectforcald Button { text: qsTr("Choose Image...") fileDialog1.DontUseNativeDialog: false onClicked: fileDialog1.open() } Image { id: image anchors.fill: parent fillMode: Image.PreserveAspectFit } FileDialog { currentFolder: StandardPaths.standardLocations( StandardPaths.PicturesLocation)[0] //dontUseNativeDialog: true id: fileDialog1 //sidebarVisible: false fileMode: FileDialog.SaveFile defaultSuffix: ".tsv" onAccepted: { console.log("Test") console.log(selectedFile) } }
}
I am not sure how to set the FileDialog.DontUseNativeDialog property because i need to the left side panel browser folder in linux which is not avaiable with the QT fileDialog.
Can someone suggest the way to resolve this.
-
Hi
try this:
options : FileDialog.DontUseNativeDialog
https://doc.qt.io/qt-6/qml-qtquick-dialogs-filedialog.html#options-prop