Use my own platform plugin (lighthouse)



  • Hello guys,

    I want to experiment my own lighthouse plugin. But once I have it, how should I compile QT and let it know that I want to use my own lighthouse plugin?

    are these defined under mkspecs? or how should I configure the QT project? any document for this?

    Thanks.



  • Hi,

    You build Qt for your platform (you'll need to make your own mkspec for your platform) and then build your plugin.

    The mkspec tells Qt things like which (cross)compiler to use, and any other specifics (like header paths, compiler arguments etc.) you might need for your platform. Currently, QPA builds use mkspecs in the mkspecs/qws folder, but there's nothing stopping you from putting your's where it makes sense (I put mine in mkspecs/qpa).

    To use your plugin, you need to use the -platform argument to your Qt app executable eg.:

    animatedtiles -platform minimal

    It's a good idea to start with the minimal plugin, as that will build for all platforms and is a good way to make sure you have the other portions of the build process working.

    Good Luck!

    Lighthouse support is done via the #qt-lighthouse IRC channel on freenode...



  • This is very useful information, Thank you very much!

    yesterday, I figure out that, which platform plugin to use is determined during the runtime, by a function called
    qt_guiPlatformPlugin() defined under qguiplatformplugin.cpp
    inside the function, QT checks an environment variable QT_PLATFORM_PLUGIN, and decides which plugin to load.

    I have one further question, is there any document for writing a mkspec?

    Thank you so much!



  • There are actually 3 ways to specify the plugin, the two mentioned above, and by setting the QT_QPA_DEFAULT_PLATFORM_NAME #define in your platform's qplatformdefs.h file.

    There may or may not be a document for mkspec creation (I would expect so), but the easiest way is to find the platform most similar to your's and use that mkspec as a basis...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.