mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
* Provide convenience openUrl( url ) method in TomahawkUtilsGui, since QDesktopServices fail to work on Windows.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include <QtGui/QScrollBar>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QStyleOption>
|
||||
#include <QDesktopServices>
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
#include <QtGui/QX11Info>
|
||||
@@ -43,6 +44,7 @@
|
||||
#ifdef Q_WS_WIN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -293,6 +295,17 @@ bringToFront()
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
openUrl( const QUrl& url )
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
ShellExecuteW( 0, 0, (TCHAR*)url.toString().utf16(), 0, 0, SW_SHOWNORMAL );
|
||||
#else
|
||||
QDesktopServices::openUrl( url );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
QPixmap
|
||||
createAvatarFrame( const QPixmap &avatar )
|
||||
{
|
||||
|
@@ -45,6 +45,8 @@ namespace TomahawkUtils
|
||||
/// Platform-specific bringing tomahawk mainwindow to front, b/c qt's activate() and such don't seem to work well enough for us
|
||||
DLLEXPORT void bringToFront();
|
||||
|
||||
DLLEXPORT void openUrl( const QUrl& url );
|
||||
|
||||
DLLEXPORT QPixmap createAvatarFrame( const QPixmap &avatar );
|
||||
|
||||
DLLEXPORT QColor alphaBlend( const QColor& colorFrom, const QColor& colorTo, float opacity );
|
||||
|
Reference in New Issue
Block a user