PDA

View Full Version : extend qt platform plugin



cic1988
2nd March 2015, 11:40
Hello all,

is it possible to extend the platform plugin(instead of re-write most of them...)?
my project only needs some access to the native handle in windows.

Ive seen the source that the QWindowsNativeInterface has only implemented HWND and DC.
To my project i need some other Handles like Font and Cursor.

Thank you.

anda_skoa
2nd March 2015, 12:50
Yes, that is possible.
Qt's source should be part of whatever download you used and it is available in a public git repository.

Cheers,
_

d_stranz
2nd March 2015, 19:13
There should be no need to extend the platform plugin. Once you have the HWND or HDC, you can use Windows API calls to get what you want:



HFONT hFont = (HFONT)( ::SendMessage( hWnd, WM_GETFONT, 0, 0 ) );

HGDIOBJ GetCurrentObject( HDC hdc, UINT uObjectType );

HCURSOR WINAPI GetCursor(void);

cic1988
3rd March 2015, 08:27
There should be no need to extend the platform plugin. Once you have the HWND or HDC, you can use Windows API calls to get what you want:



HFONT hFont = (HFONT)( ::SendMessage( hWnd, WM_GETFONT, 0, 0 ) );

HGDIOBJ GetCurrentObject( HDC hdc, UINT uObjectType );

HCURSOR WINAPI GetCursor(void);


:) Thx, this sounds good.