Results 1 to 4 of 4

Thread: extend qt platform plugin

  1. #1
    Join Date
    Jun 2014
    Posts
    20
    Thanks
    2

    Default extend qt platform plugin

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: extend qt platform plugin

    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,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    cic1988 (3rd March 2015)

  4. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,715
    Thanks
    259
    Thanked 759 Times in 749 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: extend qt platform plugin

    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:

    Qt Code:
    1. HFONT hFont = (HFONT)( ::SendMessage( hWnd, WM_GETFONT, 0, 0 ) );
    2.  
    3. HGDIOBJ GetCurrentObject( HDC hdc, UINT uObjectType );
    4.  
    5. HCURSOR WINAPI GetCursor(void);
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to d_stranz for this useful post:

    cic1988 (3rd March 2015)

  6. #4
    Join Date
    Jun 2014
    Posts
    20
    Thanks
    2

    Smile Re: extend qt platform plugin

    Quote Originally Posted by d_stranz View Post
    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:

    Qt Code:
    1. HFONT hFont = (HFONT)( ::SendMessage( hWnd, WM_GETFONT, 0, 0 ) );
    2.  
    3. HGDIOBJ GetCurrentObject( HDC hdc, UINT uObjectType );
    4.  
    5. HCURSOR WINAPI GetCursor(void);
    To copy to clipboard, switch view to plain text mode 
    Thx, this sounds good.

Similar Threads

  1. QT Android - No platform plugin, neither libqtforandroid.so or libqtforandroidGL.so
    By kolokotronis345 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th June 2014, 18:37
  2. Cound not find or load qt platform plugin windows... No working solution yet !
    By bouchebeu in forum Installation and Deployment
    Replies: 1
    Last Post: 28th October 2013, 01:52
  3. Replies: 1
    Last Post: 7th January 2013, 00:29
  4. installing QML canvas plugin in windows platform
    By Venu in forum Installation and Deployment
    Replies: 4
    Last Post: 20th February 2012, 15:46
  5. Replies: 13
    Last Post: 15th December 2006, 12:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.