37ffe90353
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> # Conflicts: # Code/Editor/QtUtil.h # Code/Legacy/CryCommon/Linux_Win32Wrapper.h # Code/Legacy/CryCommon/ProjectDefines.h # Code/Legacy/CryCommon/StringUtils.h # Code/Legacy/CryCommon/UnicodeBinding.h # Code/Legacy/CryCommon/UnicodeEncoding.h # Code/Legacy/CryCommon/UnicodeFunctions.h # Code/Legacy/CryCommon/UnicodeIterator.h # Code/Legacy/CryCommon/WinBase.cpp # Code/Legacy/CryCommon/platform.h # Code/Legacy/CryCommon/platform_impl.cpp # Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp # Gems/Maestro/Code/Source/Cinematics/Movie.cpp
66 lines
1.3 KiB
C++
66 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <QString>
|
|
#include <CryCommon/StlUtils.h>
|
|
|
|
#include <QApplication>
|
|
#include <QDropEvent>
|
|
#include <QWidget>
|
|
|
|
#ifdef LoadCursor
|
|
#undef LoadCursor
|
|
#endif
|
|
|
|
class QWaitCursor
|
|
{
|
|
public:
|
|
QWaitCursor()
|
|
{
|
|
QGuiApplication::setOverrideCursor(Qt::BusyCursor);
|
|
}
|
|
~QWaitCursor()
|
|
{
|
|
QGuiApplication::restoreOverrideCursor();
|
|
}
|
|
};
|
|
|
|
namespace QtUtil
|
|
{
|
|
inline QString trimRight(const QString& str)
|
|
{
|
|
// We prepend a char, so that the left doesn't get trimmed, then we remove it after trimming
|
|
return QString(QStringLiteral("A") + str).trimmed().remove(0, 1);
|
|
}
|
|
|
|
template<typename ... Args>
|
|
struct Select
|
|
{
|
|
template<typename C, typename R>
|
|
static auto OverloadOf(R(C::* pmf)(Args...))->decltype(pmf) {
|
|
return pmf;
|
|
}
|
|
};
|
|
}
|
|
|
|
namespace stl
|
|
{
|
|
//! Case insensitive less key for QString
|
|
template <>
|
|
struct less_stricmp<QString>
|
|
{
|
|
bool operator()(const QString& left, const QString& right) const
|
|
{
|
|
return left.compare(right, Qt::CaseInsensitive) < 0;
|
|
}
|
|
};
|
|
}
|