myxlib/src/myx/qt/backports.hpp

37 lines
849 B
C++

#ifndef MYX_QT_BACKPORTS_HPP_
#define MYX_QT_BACKPORTS_HPP_
#if ( defined ( TARGET_LSB_ID_AstraLinuxSE ) && defined ( TARGET_LSB_CODENAME_smolensk ) )
#define override
#if QT_VERSION <= 0x050700
#include <QtGlobal>
template< typename ... Args >
struct QOverload
{
template< typename C, typename R >
static constexpr auto of( R ( C::* pmf )( Args... ) ) -> decltype( pmf )
{
return( pmf );
}
};
// this adds const to non-const objects (like std::as_const)
template < typename T >
Q_DECL_CONSTEXPR typename std::add_const< T >::type& qAsConst( T& t ) noexcept
{
return( t );
}
// prevent rvalue arguments:
template < typename T >
void qAsConst( const T&& ) = delete;
#endif // if QT_VERSION <= 0x050700
#endif // if ( defined ( TARGET_LSB_ID_AstraLinuxSE ) && defined ( TARGET_LSB_CODENAME_smolensk ) )
#endif // MYX_QT_BACKPORTS_HPP_