forked from qt-creator/qt-creator
Utils: Check shift pressed for directory chooser
Change-Id: I69e9ff2accf51ad7f6327b6708f114a0f87ada42 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -534,10 +534,17 @@ FilePath FileUtils::getSaveFilePath(QWidget *parent,
|
||||
FilePath FileUtils::getExistingDirectory(QWidget *parent,
|
||||
const QString &caption,
|
||||
const FilePath &dir,
|
||||
QFileDialog::Options options)
|
||||
QFileDialog::Options options,
|
||||
bool fromDeviceIfShiftIsPressed)
|
||||
{
|
||||
bool forceNonNativeDialog = dir.needsDevice();
|
||||
|
||||
#ifdef QT_GUI_LIB
|
||||
if (fromDeviceIfShiftIsPressed && qApp->queryKeyboardModifiers() & Qt::ShiftModifier) {
|
||||
forceNonNativeDialog = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
const QStringList schemes = QStringList(QStringLiteral("file"));
|
||||
return firstOrEmpty(getFilePaths(dialogParent(parent),
|
||||
caption,
|
||||
|
@@ -110,7 +110,8 @@ public:
|
||||
static FilePath getExistingDirectory(QWidget *parent,
|
||||
const QString &caption,
|
||||
const FilePath &dir = {},
|
||||
QFileDialog::Options options = QFileDialog::ShowDirsOnly);
|
||||
QFileDialog::Options options = QFileDialog::ShowDirsOnly,
|
||||
bool fromDeviceIfShiftIsPressed = false);
|
||||
|
||||
static FilePaths getOpenFilePaths(QWidget *parent,
|
||||
const QString &caption,
|
||||
|
Reference in New Issue
Block a user