How to design a beatiful filedialog object?
-
I used the QFileDialog code below.
I want to choose the file and the path at the same time.But the code seems runed unnormally.The dialog is very ugly cause I used the setOption function,howto do ?By using the qstyle ?
and by the way,the choose button of the dialog cant work when i choosed the files or paths.I dont know why.QFileDialog* _f_dlg =new QFileDialog() ; _f_dlg->setFileMode(QFileDialog::Directory); _f_dlg->setOption(QFileDialog::DontUseNativeDialog, true); -
I used the QFileDialog code below.
I want to choose the file and the path at the same time.But the code seems runed unnormally.The dialog is very ugly cause I used the setOption function,howto do ?By using the qstyle ?
and by the way,the choose button of the dialog cant work when i choosed the files or paths.I dont know why.QFileDialog* _f_dlg =new QFileDialog() ; _f_dlg->setFileMode(QFileDialog::Directory); _f_dlg->setOption(QFileDialog::DontUseNativeDialog, true);@nicker-player said in How to design a beatiful filedialog object?:
cause I used the setOption function
Why do you set QFileDialog::DontUseNativeDialog?
-
I used the QFileDialog code below.
I want to choose the file and the path at the same time.But the code seems runed unnormally.The dialog is very ugly cause I used the setOption function,howto do ?By using the qstyle ?
and by the way,the choose button of the dialog cant work when i choosed the files or paths.I dont know why.QFileDialog* _f_dlg =new QFileDialog() ; _f_dlg->setFileMode(QFileDialog::Directory); _f_dlg->setOption(QFileDialog::DontUseNativeDialog, true);@nicker-player said in How to design a beatiful filedialog object?:
I want to choose the file and the path at the same time
In addition to @jsulm's comment, you cannot choose a file here, only a directory/folder. I would actually expect the dialog to show only directories, not files.
-
@nicker-player said in How to design a beatiful filedialog object?:
I want to choose the file and the path at the same time
In addition to @jsulm's comment, you cannot choose a file here, only a directory/folder. I would actually expect the dialog to show only directories, not files.
@JonB
In fact ,heres the code Ive used.
So how to choose the files and the paths at the same time.And the dialog looks normally and not ugly.QFileDialog* _f_dlg = this; _f_dlg->setFileMode(QFileDialog::Directory); _f_dlg->setOption(QFileDialog::DontUseNativeDialog, true); QListView *l = _f_dlg->findChild<QListView*>("listView"); if (l) { l->setSelectionMode(QAbstractItemView::MultiSelection); } QTreeView *t = _f_dlg->findChild<QTreeView*>(); if (t) { t->setSelectionMode(QAbstractItemView::MultiSelection); } -
@nicker-player said in How to design a beatiful filedialog object?:
I want to choose the file and the path at the same time
In addition to @jsulm's comment, you cannot choose a file here, only a directory/folder. I would actually expect the dialog to show only directories, not files.
So how to choose the files and the paths at the same time
I already said:
@JonB said in How to design a beatiful filedialog object?:you cannot choose a file here, only a directory/folder
@nicker-player said in How to design a beatiful filedialog object?:
And the dialog looks normally and not ugly.
You read what @jsulm wrote. Why do you not act on it rather than ignoring it?