Commit Graph

12 Commits

Author SHA1 Message Date
Sebastian Beckmann
649beed45c frontend: Don't store QT_TO_UTF8 to std::string
QT_TO_UTF8 returns a const char * that, in general, shouldn't be stored.
This is because QT_TO_UTF8(str) expands to str.toUtf8().constData():
toUtf8() returns a QByteArray, and constData() the pointer to its data
which is only valid until the QByteArray goes out of scope, which is
immediately after the call.
The original code that is changed here only works because in all of the
situations, the object that is stored to is actually a std::string that
gets constructed implicitly, so the constData() pointer is valid long
enough for the std::string constructor to copy the data.

The issue is that any "... = QT_TO_UTF8" code *looks* unsafe, and may
lead new or unfamiliar contributors to assume that they can also use it,
only to do "const char *... = QT_TO_UTF8(...)" which is dangerous.
Additionally, it introduces an unnecessary round of implicit conversions
and copies when QString.toStdString() already exists and copies into the
string buffer directly.
2026-05-06 14:15:44 -04:00
Warchamp7
fb5140d0a3 frontend: Only send event when scene list changed 2026-03-04 15:48:03 -05:00
Warchamp7
a42a6c4c5f frontend: Refactor and update Audio Mixer 2026-01-13 16:34:33 -05:00
gxalpha
5129612b6c frontend,shared: Replace and disable contextless connect calls
# Conflicts:
#	frontend/OBSApp.cpp
2025-12-17 16:35:45 -05:00
Warchamp7
e3df8722bd frontend: Switch off deleted scenes immediately 2025-12-12 13:08:40 -05:00
PatTheMav
8b7331642f frontend: Fix metatype declaration for scenes' SignalContainer
To be used as a QVariant, stream operators need to be provided
as the meta type will otherwise be considered "incomplete". These were
implemented before the frontend reorganization but not migrated as part
of it.
2025-06-04 14:15:11 -04:00
cg2121
d7cce79d7e frontend: Use static_cast when casting from void pointers
Using static_cast is preferred here, as it is safer to use than
reinterpret_cast.
2025-05-05 20:47:10 -04:00
Warchamp7
13b3c8d033 frontend: Clean up various strings 2025-04-23 14:46:51 -04:00
Warchamp7
69ecfcd9f6 frontend: Reorganize Preview/Source context menu 2025-04-15 15:00:43 -07:00
cg2121
4e8b131509 frontend: Use OBSBasic::Get() in all places
This reduces duplicated code when getting the OBSBasic context.
2025-02-05 15:15:52 -05:00
PatTheMav
654ddcd409 frontend: Split Qt UI Widget implementations into single files per class 2025-01-08 17:33:13 +01:00
PatTheMav
9f887c76d3 frontend: Prepare Qt UI Widgets for splits 2025-01-08 17:33:13 +01:00