Results 1 to 4 of 4

Thread: extend qt platform plugin

Hybrid View

Previous Post Previous Post   Next Post Next Post
  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,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 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
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    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, 17: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, 00:52
  3. Replies: 1
    Last Post: 6th January 2013, 23:29
  4. installing QML canvas plugin in windows platform
    By Venu in forum Installation and Deployment
    Replies: 4
    Last Post: 20th February 2012, 14:46
  5. Replies: 13
    Last Post: 15th December 2006, 11: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.