New platform based on "minimal" not being recognized.



  • I am using Qt 5.3.2.

    I am using .pro file based on this. Here is mine...

    TARGET = qminimal
    TEMPLATE = lib
    
    PLUGIN_TYPE = platforms
    PLUGIN_CLASS_NAME = QMinimalIntegrationPlugin
    
    QT += core-private gui-private platformsupport-private
    
    SOURCES =   main.cpp \
                qminimalintegration.cpp \
                qminimalbackingstore.cpp
    HEADERS =   qminimalintegration.h \
                qminimalbackingstore.h
    
    OTHER_FILES += minimal.json
    

    I copied the other files cpp files as well.

    However, when I run my app with -platform minimal, it says that it cannot find it. The QT_QPA_PLATFORM_PLUGIN_PATH is set to the correct directory. The moment I replace the distributed qminimal.dll with my own, it doesn't show up anymore for me to use.

    The error message I get is "The application failed to start because it could not find or load the Qt platform plugin "minimal". The message lists of all the available platforms to choose from, and minimal isn't showing up there either.


  • Lifetime Qt Champion

    Hi,

    Without the implementation details it's hard to say what's going wrong.

    Out of curiosity, why replace an existing plugin and not give it a name ?



  • @SGaist

    Out of curiosity, why replace an existing plugin and not give it a name ?

    I first wanted to build a plugin to make sure everything is properly configured. Then, I will rename everything and make it "mine".

    I'd be willing to pay good money if you (or someone else) is willing to do some contract work.



  • The issue is in qlibrary.cpp.

    It looks like it is trying to find some sequence of char items in the library.

    char pattern[] = "qTMETADATA  ";
    pattern[0] = 'Q'; // Ensure the pattern "QTMETADATA" is not found in this library should QPluginLoader ever encounter it.
    

    Any ideas?



  • It turns out that I had to include the following in my main.cpp.

    #include "main.moc"
    

    Then, it worked!


  • Lifetime Qt Champion

    Glad you found out and thanks for sharing !

    Since you have it working now, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :) (you have to first change the original post to a question)


Log in to reply
 

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