Переделана структура проекта
This commit is contained in:
@ -17,7 +17,6 @@ set(TRGT_moc_private_hpp
|
||||
)
|
||||
|
||||
set(TRGT_hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/backports.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/translators.hpp
|
||||
)
|
||||
|
||||
|
@ -1,38 +0,0 @@
|
||||
#ifndef MYX_QT_BACKPORTS_HPP_
|
||||
#define MYX_QT_BACKPORTS_HPP_
|
||||
|
||||
#pragma once
|
||||
|
||||
#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_
|
@ -1,7 +1,7 @@
|
||||
#ifndef MYX_QT_POSIX_SIGNAL_WATCHER_CPP_
|
||||
#define MYX_QT_POSIX_SIGNAL_WATCHER_CPP_
|
||||
|
||||
#include <myx/base/config.hpp>
|
||||
#include <myx/core/config.hpp>
|
||||
|
||||
#include <myx/qt/posix_signal_watcher.hpp>
|
||||
#include <myx/qt/posix_signal_watcher_p.hpp>
|
||||
@ -27,8 +27,8 @@ PosixSignalWatcherPrivate::PosixSignalWatcherPrivate( PosixSignalWatcher* q ) :
|
||||
#endif
|
||||
|
||||
// Create a notifier for the read end of the pair
|
||||
m_notifier.reset( new QSocketNotifier( mSockpair[1], QSocketNotifier::Read ) );
|
||||
|
||||
// m_notifier.reset( new QSocketNotifier( mSockpair[1], QSocketNotifier::Read ) );
|
||||
m_notifier = std::make_unique< QSocketNotifier >( mSockpair[1], QSocketNotifier::Read );
|
||||
|
||||
// Called when the signal handler has written to the socket pair.
|
||||
// Emits the Posix signal as a Qt signal.
|
||||
@ -63,7 +63,7 @@ MYXLIB_INLINE void PosixSignalWatcherPrivate::watchForSignal( int signal )
|
||||
#if MYX_QT_HAS_POSIX_SIGNALS
|
||||
// Register a sigaction which will write to the socket pair
|
||||
struct sigaction sigact {};
|
||||
sigact.sa_handler = PosixSignalWatcherPrivate::signalHandler;
|
||||
sigact.sa_handler = PosixSignalWatcherPrivate::signalHandler; //NOLINT
|
||||
sigact.sa_flags = 0;
|
||||
sigemptyset( &sigact.sa_mask );
|
||||
sigact.sa_flags |= SA_RESTART;
|
||||
@ -98,8 +98,6 @@ MYXLIB_INLINE PosixSignalWatcher::PosixSignalWatcher( QObject* parent ) :
|
||||
}
|
||||
|
||||
|
||||
MYXLIB_INLINE PosixSignalWatcher::~PosixSignalWatcher() = default;
|
||||
|
||||
/*!
|
||||
* Register a signal handler for the given \a signal.
|
||||
*
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <myx/base/config.hpp>
|
||||
#include <myx/core/config.hpp>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
@ -33,14 +33,13 @@ class PosixSignalWatcher : public QObject
|
||||
|
||||
public:
|
||||
explicit PosixSignalWatcher( QObject* parent = nullptr );
|
||||
~PosixSignalWatcher() override;
|
||||
|
||||
void watchForSignal( int signal );
|
||||
Q_SIGNAL void posixSignal( int signal );
|
||||
|
||||
private:
|
||||
PosixSignalWatcherPrivate* const d_ptr = nullptr;
|
||||
Q_DECLARE_PRIVATE( PosixSignalWatcher )
|
||||
Q_DECLARE_PRIVATE( PosixSignalWatcher ) //NOLINT
|
||||
}; // class PosixSignalWatcher
|
||||
|
||||
} // namespace qt
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <myx/base/config.hpp>
|
||||
#include <myx/core/config.hpp>
|
||||
#include <myx/qt/posix_signal_watcher.hpp>
|
||||
|
||||
#include <QObject>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MYX_QT_TRANSLATORS_CPP_
|
||||
#define MYX_QT_TRANSLATORS_CPP_
|
||||
|
||||
#include <myx/base/config.hpp>
|
||||
#include <myx/core/config.hpp>
|
||||
#include <myx/qt/translators.hpp>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <myx/base/config.hpp>
|
||||
#include <myx/qt/backports.hpp>
|
||||
#include <myx/backports/qt/common.hpp>
|
||||
#include <myx/core/config.hpp>
|
||||
|
||||
#include <QTranslator>
|
||||
|
||||
|
Reference in New Issue
Block a user