Qt: fix deprecation warnings

This commit is contained in:
Megamouse 2020-01-19 14:00:57 +01:00
parent 30d5a849e3
commit 485b22d664
4 changed files with 22 additions and 4 deletions

View file

@ -13,6 +13,16 @@ namespace gui
{
namespace utils
{
template<typename T>
static QSet<T> list_to_set(const QList<T>& list)
{
#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
return QSet<T>(list.begin(), list.end());
#else
return QSet<T>::fromList(list);
#endif
}
// Creates a frame geometry rectangle with given width height that's centered inside the origin,
// while still considering screen boundaries.
QRect create_centered_window_geometry(const QRect& origin, s32 width, s32 height);