mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
remove old qt(<5) code.
This commit is contained in:
parent
20d51afb8d
commit
ab358fb3a5
|
@ -2418,9 +2418,6 @@ void ArticleView::performFindOperation( bool restart, bool backwards, bool check
|
|||
|
||||
if ( ui.searchCaseSensitive->isChecked() )
|
||||
f |= QWebEnginePage::FindCaseSensitively;
|
||||
#if QT_VERSION >= 0x040600 && QT_VERSION <= 0x050600
|
||||
f |= QWebEnginePage::HighlightAllOccurrences;
|
||||
#endif
|
||||
|
||||
ui.definition->findText( "", f );
|
||||
|
||||
|
@ -2678,15 +2675,9 @@ void ArticleView::highlightFTSResults()
|
|||
if( ftsSearchMatchCase )
|
||||
flags |= QWebEnginePage::FindCaseSensitively;
|
||||
|
||||
#if QT_VERSION >= 0x040600
|
||||
// flags |= QWebEnginePage::HighlightAllOccurrences;
|
||||
|
||||
for( int x = 0; x < allMatches.size(); x++ )
|
||||
ui.definition->findText( allMatches.at( x ), flags );
|
||||
|
||||
// flags &= ~QWebEnginePage::HighlightAllOccurrences;
|
||||
#endif
|
||||
|
||||
if( !allMatches.isEmpty() )
|
||||
{
|
||||
ui.definition->findText( allMatches.at( 0 ), flags );
|
||||
|
|
|
@ -381,10 +381,6 @@ void loadDictionaries( QWidget * parent, bool showInitially,
|
|||
set< string > ids;
|
||||
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--; )
|
||||
{
|
||||
ret = ids.insert( dictionaries[ x ]->getId() );
|
||||
|
|
|
@ -599,7 +599,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
connect( ui.menuHistory, SIGNAL( aboutToShow() ),
|
||||
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
|
||||
// though until the program inits fully.
|
||||
// Do not create dummy tray icon in X. Cause QT5 failed to upgrade systemtray context menu.
|
||||
|
|
|
@ -25,7 +25,7 @@ using std::wstring;
|
|||
/// in their behavior on those platforms.
|
||||
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
|
||||
#else
|
||||
Qt::Popup
|
||||
|
|
|
@ -7,11 +7,4 @@
|
|||
void TreeView::dropEvent( QDropEvent * 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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue