diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 02610ac31b..01a5e2c806 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -169,7 +169,11 @@ QT_BEGIN_NAMESPACE \value ShowDirectoriesFirst (bool) Whether directories should be shown first (before files) in file dialogs. - This enum value was added in Qt 6.2. + This enum value was added in Qt 6.3. + + \value PreselectFirstFileInDirectory (bool) Whether the first file in a directory + should be automatically selected when a file dialog opens. + This enum value was added in Qt 6.3. \sa themeHint(), QStyle::pixelMetric() */ @@ -580,6 +584,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) return true; case ShowDirectoriesFirst: return true; + case PreselectFirstFileInDirectory: + return false; } return QVariant(); } diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index fdd1141896..a6b3709548 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -122,6 +122,7 @@ public: MouseQuickSelectionThreshold, InteractiveResizeAcrossScreens, ShowDirectoriesFirst, + PreselectFirstFileInDirectory, }; Q_ENUM(ThemeHint) diff --git a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp index a47720384c..f7ccbbd118 100644 --- a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp +++ b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp @@ -135,6 +135,8 @@ QVariant QGtk3Theme::themeHint(QPlatformTheme::ThemeHint hint) const return QVariant(gtkSetting("gtk-icon-theme-name")); case QPlatformTheme::SystemIconFallbackThemeName: return QVariant(gtkSetting("gtk-fallback-icon-theme")); + case QPlatformTheme::PreselectFirstFileInDirectory: + return true; default: return QGnomeTheme::themeHint(hint); }