mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-05 07:02:31 -06:00
Raise minimal Qt version to 5.5.1
This commit is contained in:
@@ -50,13 +50,9 @@ private:
|
||||
|
||||
/// Reads settings for .torrent files from preferences
|
||||
/// and sets the file guard up accordingly
|
||||
class TorrentFileGuard
|
||||
class TorrentFileGuard: private FileGuard
|
||||
{
|
||||
Q_GADGET
|
||||
// moc from Qt4 ignores Q_ENUMS when it is behind #if QT_VERSION check
|
||||
// this declaration is needed for Qt 4 only
|
||||
// TODO Qt5: remove when dropping Qt4 support
|
||||
Q_ENUMS(AutoDeleteMode)
|
||||
|
||||
public:
|
||||
TorrentFileGuard(const QString &path = QString());
|
||||
@@ -79,25 +75,12 @@ public:
|
||||
|
||||
private:
|
||||
static QMetaEnum modeMetaEnum();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
|
||||
|
||||
TorrentFileGuard(const QString &path, AutoDeleteMode mode);
|
||||
|
||||
Q_ENUM(AutoDeleteMode)
|
||||
#endif
|
||||
AutoDeleteMode m_mode;
|
||||
bool m_wasAdded;
|
||||
// Qt 4 moc has troubles with Q_GADGET: if Q_GADGET is present in a class, moc unconditionally
|
||||
// references in the generated code the statiMetaObject from the class ancestor.
|
||||
// Moreover, if the ancestor class has Q_GADGET but does not have other
|
||||
// Q_ declarations, moc does not generate staticMetaObject for it. These results
|
||||
// in referencing the non existent staticMetaObject and such code fails to compile.
|
||||
// This problem is NOT present in Qt 5.7.0 and maybe in some older Qt 5 versions too
|
||||
// Qt 4.8.7 has it.
|
||||
// Therefore, we can't inherit FileGuard :(
|
||||
// TODO Qt5: port to private inheritance when dropping Qt 4 support
|
||||
FileGuard m_guard;
|
||||
};
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
||||
Q_DECLARE_METATYPE(TorrentFileGuard::AutoDeleteMode)
|
||||
#endif
|
||||
|
||||
#endif // TOFFENTFILEGURAD_H
|
||||
|
||||
Reference in New Issue
Block a user