lxqt / lxqt-qtplugin

LXQt Qt platform integration plugin
https://lxqt.github.io
GNU Lesser General Public License v2.1
24 stars 14 forks source link

default qt file dialog #60

Closed alimoche closed 3 years ago

alimoche commented 3 years ago

It would be great to have an option to turn on/off lxqt file dialogs, it would give more flexibility to configure lxqt appearance, qt file dialogs are simple, well design and do their job very efficiently and some users might prefer this choice.

Possible Solution

defining a global option e.g. "Use native qt file dialogs" check box and then returning false in LXQtPlatformTheme::usePlatformNativeDialog and LXQtPlatformTheme::createPlatformDialogHelper if checked

tsujan commented 3 years ago

First. "native" has the opposite meaning: Qt's default file dialog is NOT native, by definition.

Second, it's up to apps to add such a setting. No DE does that.

alimoche commented 3 years ago

Second, it's up to apps to add such a setting. No DE does that.

there is some code in lxqtplatformtheme.cpp related to this

if(type == FileDialog
        && qobject_cast<QApplication *>(QCoreApplication::instance())) { // QML may not have qApp
         // use our own file dialog

i.e., isn't lxqt replacing file dialogs of qt applications?

tsujan commented 3 years ago

isn't lxqt replacing file dialogs of qt applications?

This is a part of platform integration. Wherever you see Qt's default file dialog, you'll know that Qt's platform integration is missing there.

tsujan commented 3 years ago

Oh, if your question was, "Can apps call Qt's default file dialog?", the answer is "Yes, Qt has the flag QFileDialog::DontUseNativeDialog." That flag is off by default — as it should be — which means Qt apps use the native file dialog by default. That's Qt's design.

alimoche commented 3 years ago

Oh, if your question was, "Can apps call Qt's default file dialog?", the answer is "Yes, Qt has the flag QFileDialog::DontUseNativeDialog." That flag is off by default — as it should be — which means Qt apps use the native file dialog by default. That's Qt's design.

is there any configuration file where this can be set or you need to compile every qt application?

This is related to https://github.com/lxqt/pcmanfm-qt/issues/551, and the feature request is simply if it is possible to be able to use qt default file dialog through a configuration option, e.g. "use qt default file dialog" by just returning false in LXQtPlatformTheme::usePlatformNativeDialog in this way we have both and the user can choose, e.g. if you have a small display or if you do not need thumbnail view, etc.