mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +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() )
|
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 );
|
||||||
|
|
|
@ -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() );
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue