1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 15:29:42 +01:00

Merge pull request #224 from TheOneRing/qt5-win

Some qt5 fixes for Windows
This commit is contained in:
Dominik Schmidt 2014-04-02 22:20:22 +02:00
commit f12f639206
7 changed files with 27 additions and 13 deletions

View File

@ -135,6 +135,10 @@ if( NOT BUILD_WITH_QT4 )
# We need this to find the paths to qdbusxml2cpp and co
find_package(Qt5DBus REQUIRED)
endif()
if(WIN32)
find_package(Qt5WinExtras REQUIRED)
endif()
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})

View File

@ -300,8 +300,8 @@ bringToFront()
int idActive = GetWindowThreadProcessId(hwndActiveWin, NULL);
if ( AttachThreadInput(GetCurrentThreadId(), idActive, TRUE) )
{
SetForegroundWindow( wid );
SetFocus( wid );
SetForegroundWindow( (HWND)wid );
SetFocus( (HWND)wid );
AttachThreadInput(GetCurrentThreadId(), idActive, FALSE);
}
}

View File

@ -166,6 +166,9 @@ SET_TARGET_PROPERTIES(tomahawk_bin
qt5_use_modules(tomahawk_bin Core Widgets Network Sql WebKitWidgets)
if(WIN32)
qt5_use_modules(tomahawk_bin WinExtras)
endif()
MESSAGE( STATUS "OS_SPECIFIC_LINK_LIBRARIES: ${OS_SPECIFIC_LINK_LIBRARIES}" )

View File

@ -7,9 +7,6 @@ ADD_DEFINITIONS( -DUNICODE )
SET( OS_SPECIFIC_LINK_LIBRARIES
${OS_SPECIFIC_LINK_LIBRARIES}
${QTSPARKLE_LIBRARIES}
# third party shipped with tomahawk
# system libs
@ -22,3 +19,7 @@ SET( OS_SPECIFIC_LINK_LIBRARIES
"winmm.dll"
"advapi32.dll"
)
if(QTSPARKLE_FOUND)
list(APPEND OS_SPECIFIC_LINK_LIBRARIES ${QTSPARKLE_LIBRARIES})
endif()

View File

@ -15,7 +15,7 @@
#cmakedefine WITH_BREAKPAD
#cmakedefine WITH_CRASHREPORTER
#cmakedefine WITH_BINARY_ATTICA
#cmakedefine WITH_QtSparkle
#cmakedefine WITH_QTSPARKLE
#cmakedefine WITH_UPOWER
#cmakedefine WITH_GNOMESHORTCUTHANDLER

View File

@ -83,10 +83,12 @@
#include "config.h"
#if defined( Q_OS_WIN )
#if defined ( WITH_QtSparkle )
#if defined ( WITH_QTSPARKLE )
#include <qtsparkle/Updater>
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5,2,0)
#include <QtWin>
#endif
#include <windows.h>
#include <shellapi.h>
@ -484,7 +486,7 @@ TomahawkWindow::setupUpdateCheck()
#if defined( Q_OS_MAC ) && defined( HAVE_SPARKLE )
connect( ActionCollection::instance()->getAction( "checkForUpdates" ), SIGNAL( triggered( bool ) ),
SLOT( checkForUpdates() ) );
#elif defined( Q_OS_WIN ) && defined( WITH_QtSparkle )
#elif defined( Q_OS_WIN ) && defined( WITH_QTSPARKLE )
QUrl updaterUrl;
if ( qApp->arguments().contains( "--debug" ) )
@ -546,7 +548,7 @@ TomahawkWindow::setupWindowsButtons()
hr = m_taskbarList->HrInit();
if ( SUCCEEDED( hr ) )
{
hr = m_taskbarList->ThumbBarAddButtons( winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons );
hr = m_taskbarList->ThumbBarAddButtons( (HWND)winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons );
}
else
{
@ -566,7 +568,11 @@ TomahawkWindow::thumbIcon( TomahawkUtils::ImageType type )
if ( !thumbIcons.contains( type ) )
{
QPixmap pix ( TomahawkUtils::defaultPixmap(type , TomahawkUtils::Original, QSize( 20, 20 ) ) );
#if QT_VERSION >= QT_VERSION_CHECK(5,2,0)
thumbIcons[type] = QtWin::toHICON(pix);
#else
thumbIcons[type] = pix.toWinHICON();
#endif
}
return thumbIcons[type];
}
@ -820,7 +826,7 @@ TomahawkWindow::audioStateChanged( AudioState newState, AudioState oldState )
return;
}
m_taskbarList->ThumbBarUpdateButtons( winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons );
m_taskbarList->ThumbBarUpdateButtons( (HWND)winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons );
}
@ -841,7 +847,7 @@ TomahawkWindow::updateWindowsLoveButton()
}
m_thumbButtons[TP_LOVE].dwFlags = THBF_ENABLED;
m_taskbarList->ThumbBarUpdateButtons( winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons );
m_taskbarList->ThumbBarUpdateButtons( (HWND)winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons );
}
#endif // Q_OS_WIN

View File

@ -77,7 +77,7 @@ LRESULT QT_WIN_CALLBACK qt_LowLevelKeyboardHookProc( int nCode, WPARAM wParam, L
if ( QApplication::activeWindow() == widget )
continue;
hWnd = widget->winId();
hWnd = (HWND)widget->winId();
// generate message and post it to the message queue
LPKBDLLHOOKSTRUCT pKeyboardHookStruct = reinterpret_cast<LPKBDLLHOOKSTRUCT>(lParam);