mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
improve:Win Specific, replace deprecated method
This commit is contained in:
parent
46b4151cc4
commit
3b4c105655
|
@ -162,7 +162,7 @@ void ArticleWebView::wheelEvent( QWheelEvent *ev )
|
|||
SystemParametersInfo( SPI_GETWHEELSCROLLLINES, 0, &nLines, 0 );
|
||||
if( nLines == WHEEL_PAGESCROLL )
|
||||
{
|
||||
QKeyEvent kev( QEvent::KeyPress, ev->delta() > 0 ? Qt::Key_PageUp : Qt::Key_PageDown,
|
||||
QKeyEvent kev( QEvent::KeyPress, ev->angleDelta ().y () > 0 ? Qt::Key_PageUp : Qt::Key_PageDown,
|
||||
Qt::NoModifier );
|
||||
QApplication::sendEvent( this, &kev );
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "initializing.hh"
|
||||
#include <qt_windows.h>
|
||||
#include <uxtheme.h>
|
||||
#include <QOperatingSystemVersion>
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -248,8 +249,7 @@ FullTextSearchDialog::FullTextSearchDialog( QWidget * parent,
|
|||
|
||||
oldBarStyle = 0;
|
||||
|
||||
if( QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA
|
||||
&& ( QSysInfo::windowsVersion() & QSysInfo::WV_NT_based )
|
||||
if( QOperatingSystemVersion::current () >= QOperatingSystemVersion::Windows7
|
||||
&& !IsThemeActive() )
|
||||
{
|
||||
QStyle * barStyle = WindowsStyle::instance().getStyle();
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#if defined( Q_OS_WIN32 )
|
||||
#include <qt_windows.h>
|
||||
#include <uxtheme.h>
|
||||
#include <QOperatingSystemVersion>
|
||||
|
||||
WindowsStyle::WindowsStyle()
|
||||
{
|
||||
|
@ -41,8 +42,7 @@ Initializing::Initializing( QWidget * parent, bool showOnStartup ): QDialog( par
|
|||
|
||||
oldBarStyle = 0;
|
||||
|
||||
if( QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA
|
||||
&& ( QSysInfo::windowsVersion() & QSysInfo::WV_NT_based )
|
||||
if( QOperatingSystemVersion::current () >= QOperatingSystemVersion::Windows7
|
||||
&& !IsThemeActive() )
|
||||
{
|
||||
QStyle * barStyle = WindowsStyle::instance().getStyle();
|
||||
|
|
|
@ -742,7 +742,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
#ifdef Q_OS_WIN
|
||||
if( cfg.normalMainWindowGeometry.width() <= 0 )
|
||||
{
|
||||
QRect r = QApplication::desktop()->availableGeometry();
|
||||
QRect r = QGuiApplication::primaryScreen ()->geometry ();
|
||||
cfg.normalMainWindowGeometry.setRect( r.width() / 4, r.height() / 4, r.width() / 2, r.height() / 2 );
|
||||
}
|
||||
if( cfg.maximizedMainWindowGeometry.width() > 0 )
|
||||
|
|
Loading…
Reference in a new issue