remove qt_version_check macro

This commit is contained in:
yifang 2021-12-02 21:10:56 +08:00
parent b148c557c9
commit 98ca729446
10 changed files with 1 additions and 41 deletions

View file

@ -386,10 +386,8 @@ ArticleView::~ArticleView()
cleanupTemp();
audioPlayer->stop();
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
ui.definition->ungrabGesture( Gestures::GDPinchGestureType );
ui.definition->ungrabGesture( Gestures::GDSwipeGestureType );
#endif
}
void ArticleView::showDefinition( Config::InputPhrase const & phrase, unsigned group,
@ -597,7 +595,6 @@ void ArticleView::loadFinished( bool )
articleToJump.clear();
}
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if( !Utils::Url::queryItemValue( url, "gdanchor" ).isEmpty() )
{
QString anchor = QUrl::fromPercentEncoding( Utils::Url::encodedQueryItemValue( url, "gdanchor" ) );
@ -631,7 +628,6 @@ void ArticleView::loadFinished( bool )
QString( "window.location.hash = \"%1\"" ).arg( QString::fromUtf8( url.toEncoded() ) ) );
}
}
#endif
emit pageLoaded( this );
@ -868,7 +864,6 @@ bool ArticleView::handleF3( QObject * /*obj*/, QEvent * ev )
bool ArticleView::eventFilter( QObject * obj, QEvent * ev )
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if( ev->type() == QEvent::Gesture )
{
Gestures::GestureResult result;
@ -920,7 +915,6 @@ bool ArticleView::eventFilter( QObject * obj, QEvent * ev )
return true;
}
}
#endif
if ( handleF3( obj, ev ) )
{

View file

@ -10,11 +10,8 @@ QStyledItemDelegate()
void WordListItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QStyleOptionViewItem opt4 = option;
#else
QStyleOptionViewItemV4 opt4 = option;
#endif
QStyleOptionViewItem opt = option;
initStyleOption( &opt4, index );
if( opt4.text.isRightToLeft() )

View file

@ -11,11 +11,9 @@
#include <QTimer>
#include <QProgressDialog>
#if QT_VERSION >= QT_VERSION_CHECK( 5, 12, 0 )
#include <QRegularExpression>
#include "wildcard.hh"
#include "gddebug.hh"
#endif
#define AUTO_APPLY_LIMIT 150000

View file

@ -1226,8 +1226,6 @@ void expandOptionalParts( wstring & str, list< wstring > * result,
{
if( !inside_recurse )
{
// expanded.sort();
// result->merge(expanded );
result->splice(result->end(),expanded);
}
return;

View file

@ -8,8 +8,6 @@
#include "articleview.hh"
#include "gestures.hh"
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
namespace Gestures
{
@ -80,9 +78,7 @@ QGestureRecognizer::Result GDPinchGestureRecognizer::recognize( QGesture * state
gest->isNewSequence = true;
break;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
case QEvent::TouchCancel:
#endif
case QEvent::TouchEnd:
{
result = QGestureRecognizer::CancelGesture;
@ -225,9 +221,7 @@ QGestureRecognizer::Result GDSwipeGestureRecognizer::recognize( QGesture * state
result = QGestureRecognizer::MayBeGesture;
break;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
case QEvent::TouchCancel:
#endif
case QEvent::TouchEnd:
{
fewTouchPointsPresented = false;
@ -394,4 +388,3 @@ void unregisterRecognizers()
} // namespace
#endif //QT_VERSION

View file

@ -1,8 +1,6 @@
#ifndef __GESTURES_HH_INCLUDED__
#define __GESTURES_HH_INCLUDED__
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
#include <QGestureRecognizer>
#include <QGesture>
#include <QTimer>
@ -112,6 +110,4 @@ bool handleGestureEvent( QObject * obj, QEvent * event, GestureResult & result,
} // namespace
#endif
#endif // __GESTURES_HH_INCLUDED__

View file

@ -40,10 +40,6 @@
#include "gddebug.hh"
#if defined( Q_OS_MAC ) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include "lionsupport.h"
#endif
void gdMessageHandler( QtMsgType type, const QMessageLogContext &context, const QString &mess )
{
Q_UNUSED( context );

View file

@ -164,10 +164,8 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
articleMaker.setCollapseParameters( cfg.preferences.collapseBigArticles, cfg.preferences.articleSizeLimit );
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
// Set own gesture recognizers
Gestures::registerRecognizers();
#endif
// use our own, custom statusbar
setStatusBar(0);
@ -888,10 +886,8 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
( static_cast< QHotkeyApplication * >( qApp ) )->setMainWindow( this );
#endif
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
ui.centralWidget->grabGesture( Gestures::GDPinchGestureType );
ui.centralWidget->grabGesture( Gestures::GDSwipeGestureType );
#endif
if( layoutDirection() == Qt::RightToLeft )
{
@ -1015,11 +1011,9 @@ MainWindow::~MainWindow()
ftsIndexing.stopIndexing();
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
ui.centralWidget->ungrabGesture( Gestures::GDPinchGestureType );
ui.centralWidget->ungrabGesture( Gestures::GDSwipeGestureType );
// Gestures::unregisterRecognizers();
#endif
// Close all tabs -- they should be destroyed before network managers
// do.

View file

@ -315,10 +315,8 @@ ScanPopup::ScanPopup( QWidget * parent,
ui.goBackButton->setEnabled( false );
ui.goForwardButton->setEnabled( false );
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
grabGesture( Gestures::GDPinchGestureType );
grabGesture( Gestures::GDSwipeGestureType );
#endif
#ifdef HAVE_X11
scanFlag = new ScanFlag( this );
@ -349,10 +347,8 @@ ScanPopup::~ScanPopup()
disableScanning();
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
ungrabGesture( Gestures::GDPinchGestureType );
ungrabGesture( Gestures::GDSwipeGestureType );
#endif
}
void ScanPopup::saveConfigData()

View file

@ -754,7 +754,6 @@ qint64 GzippedFile::readData( char * data, qint64 maxSize )
// The returning value translates directly to QIODevice semantics
int n = gzread( gz, data, maxSize );
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
// With QT 5.x QXmlStreamReader ask one byte instead of one UTF-8 char.
// We read and return all bytes for char.
@ -775,7 +774,6 @@ qint64 GzippedFile::readData( char * data, qint64 maxSize )
if( addBytes )
n += gzread( gz, data + 1, addBytes );
}
#endif
return n;
}