So our Qt5 package has a series of patches from Fedora (who backportes them from Qt6) that try to change the theming to better match the GNOME/Budgie GTK theme. This logic checks the name of the theme, if has "dark" as part of the name then it's considered a dark theme and Qt5 apps will use a dark mode theme. If it does not have the word dark in it then it will still try to detect if it by checking the theme background and foreground colors. I'll let the patch summary speak for itself rather than trying to explain how this works:
QGtk3Theme detects the appearance property by theme name: If the name
contains the keyword "dark", the theme is considered to be dark and
otherwise light.
This detection logic fails, when the GTK theme is dark without
containing the "dark" keyword, e.g. the dark theme "Adapta-Nokto".
While QGtk3Theme imports the right colors in that case, it wrongly
identifies a light theme.
This patch adapts the detection logic: If the theme name contains the
"dark" keyword, it is considered a dark theme without further checks.
If it doesn't, the current GTK3 theme's default background and
foreground colors will be read. If the foreground is lighter than the
background, the theme is considered dark. If the background is lighter
than the foreground, the theme is considered light. If both colors are
identical, the appearance will be Qt::Appearance::Unknown.