remove old qt(<5) code.

This commit is contained in:
yifang.xiao 2021-11-18 14:28:12 +08:00 committed by yifang
parent 20d51afb8d
commit ab358fb3a5
5 changed files with 2 additions and 22 deletions

View file

@ -2418,9 +2418,6 @@ void ArticleView::performFindOperation( bool restart, bool backwards, bool check
if ( ui.searchCaseSensitive->isChecked() ) if ( ui.searchCaseSensitive->isChecked() )
f |= QWebEnginePage::FindCaseSensitively; f |= QWebEnginePage::FindCaseSensitively;
#if QT_VERSION >= 0x040600 && QT_VERSION <= 0x050600
f |= QWebEnginePage::HighlightAllOccurrences;
#endif
ui.definition->findText( "", f ); ui.definition->findText( "", f );
@ -2678,15 +2675,9 @@ void ArticleView::highlightFTSResults()
if( ftsSearchMatchCase ) if( ftsSearchMatchCase )
flags |= QWebEnginePage::FindCaseSensitively; flags |= QWebEnginePage::FindCaseSensitively;
#if QT_VERSION >= 0x040600
// flags |= QWebEnginePage::HighlightAllOccurrences;
for( int x = 0; x < allMatches.size(); x++ ) for( int x = 0; x < allMatches.size(); x++ )
ui.definition->findText( allMatches.at( x ), flags ); ui.definition->findText( allMatches.at( x ), flags );
// flags &= ~QWebEnginePage::HighlightAllOccurrences;
#endif
if( !allMatches.isEmpty() ) if( !allMatches.isEmpty() )
{ {
ui.definition->findText( allMatches.at( 0 ), flags ); ui.definition->findText( allMatches.at( 0 ), flags );

View file

@ -381,10 +381,6 @@ void loadDictionaries( QWidget * parent, bool showInitially,
set< string > ids; set< string > ids;
std::pair< std::set< string >::iterator, bool > ret; std::pair< std::set< string >::iterator, bool > ret;
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QTextCodec::setCodecForCStrings( QTextCodec::codecForName( "UTF8" ) );
#endif
for( unsigned x = dictionaries.size(); x--; ) for( unsigned x = dictionaries.size(); x--; )
{ {
ret = ids.insert( dictionaries[ x ]->getId() ); ret = ids.insert( dictionaries[ x ]->getId() );

View file

@ -599,7 +599,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
connect( ui.menuHistory, SIGNAL( aboutToShow() ), connect( ui.menuHistory, SIGNAL( aboutToShow() ),
this, SLOT( updateHistoryMenu() ) ); this, SLOT( updateHistoryMenu() ) );
#if !defined( HAVE_X11 ) || QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 ) #if !defined( HAVE_X11 )
// Show tray icon early so the user would be happy. It won't be functional // Show tray icon early so the user would be happy. It won't be functional
// though until the program inits fully. // though until the program inits fully.
// Do not create dummy tray icon in X. Cause QT5 failed to upgrade systemtray context menu. // Do not create dummy tray icon in X. Cause QT5 failed to upgrade systemtray context menu.

View file

@ -25,7 +25,7 @@ using std::wstring;
/// in their behavior on those platforms. /// in their behavior on those platforms.
static const Qt::WindowFlags defaultUnpinnedWindowFlags = static const Qt::WindowFlags defaultUnpinnedWindowFlags =
#if defined (Q_OS_WIN) || ( defined (Q_OS_MAC) && QT_VERSION < QT_VERSION_CHECK( 5, 3, 0 ) ) #if defined (Q_OS_WIN)
Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint
#else #else
Qt::Popup Qt::Popup

View file

@ -7,11 +7,4 @@
void TreeView::dropEvent( QDropEvent * event ) void TreeView::dropEvent( QDropEvent * event )
{ {
QTreeView::dropEvent( event ); QTreeView::dropEvent( event );
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
// Qt 4 don't check success of drop operation. Add turnaround.
if( !event->isAccepted() )
event->setDropAction( Qt::IgnoreAction );
#endif
} }