Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Application Plugins

Application Plugins

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by
    #1

    Hi
    I am developing a set of plugins for my Qt application using VS 2012
    When I created the project I selected Qt Library as the project type, but when I load the library with QPluginLoader the 'instance' method failed.
    I then created another VS project using the 'Qt Application' as the project type and deleted main.cpp and using the VS properties manager I set the configuration type to Dynamic library, Using this method the plugin is loaded and behaves as expected.
    I have compared the VS configuration properties and they are identical.
    I have created a .pro file for both projects using VS and they are also identical.

    I would be grateful if anyone could tell me the reason for this

    Thanks

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      When you the plugin do you get shared library?
      Could you show part of .pro files with QT, CONFIG, TEMPLATE, and TARGET variables.

      When I created a plugin using qtcreator I've got .pro file
      @
      ...
      QT += widgets network
      QT -= gui

      CONFIG += plugin debug

      TARGET = $$qtLibraryTarget(my_plugin)
      TEMPLATE = lib
      ...
      @

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GrahamL
        wrote on last edited by
        #3

        Hi
        This is the .pro file for plugin created in VS as a Qt Library
        @

        ----------------------------------------------------

        This file is generated by the Qt Visual Studio Add-in.

        ------------------------------------------------------

        TEMPLATE = lib
        TARGET = DockedWidget1Plugin
        DESTDIR = ../plugins
        QT += core widgets gui
        CONFIG += debug console
        DEFINES += WIN64 QT_DLL QT_WIDGETS_LIB DOCKEDWIDGET1PLUGIN_LIB
        INCLUDEPATH += ../../DockedWidgets
        ../../../../../Acq++/CommonUI/ApplicationCode/Plugins
        ../../../../../Acq++/CommonQt/ApplicationCode/SystemLogging
        ../../../../../Acq++/Global
        ../../../../../Acq++/CommonUI/ApplicationCode/Preferences
        ../../../InterfaceFactoriesApplication/InterfaceFactoriesApplication
        ./Build/ui
        .
        ./Build/moc
        LIBS += -L"../../DockedWidgets/Build/Debug"
        -L"../../../../../Acq++/bin"
        -lDockedWidgetsd
        -lCommonQtd
        -lASLCommonUId
        DEPENDPATH += .
        MOC_DIR += ./Build/moc
        OBJECTS_DIR += debug
        UI_DIR += ./Build/ui
        RCC_DIR += ./Build/rcc
        HEADERS += ./DockedWidget1Plugin.h
        ./DockedWidget1PluginFactory.h
        SOURCES += ./DockedWidget1Plugin.cpp
        ./DockedWidget1PluginFactory.cpp
        @

        and this is the .pro file produced for VS when the project was created as a Qt Application
        @

        ----------------------------------------------------

        This file is generated by the Qt Visual Studio Add-in.

        ------------------------------------------------------

        TEMPLATE = lib
        TARGET = DockedWidget2Plugin
        DESTDIR = ../plugins
        QT += core widgets gui
        CONFIG += debug
        DEFINES += WIN64 QT_DLL QT_WIDGETS_LIB
        INCLUDEPATH += ../../../../../Acq++/CommonUI/ApplicationCode/Plugins
        ../../../../../Acq++/CommonQt/ApplicationCode/SystemLogging
        ../../../../../Acq++/Global
        ../../../../../Acq++/CommonUI/ApplicationCode/Preferences
        ../../../InterfaceFactoriesApplication/InterfaceFactoriesApplication
        ./Build/ui
        .
        ./Build/moc
        LIBS += -L"../../../../../Acq++/bin"
        -lCommonQtd
        -lASLCommonUId
        DEPENDPATH += .
        MOC_DIR += ./Build/moc
        OBJECTS_DIR += debug
        UI_DIR += ./Build/ui
        RCC_DIR += ./Build/rcc
        HEADERS += ./DockedWidget2Plugin.h
        ./DockedWidget2PluginFactory.h
        SOURCES += ./DockedWidget2Plugin.cpp
        ./DockedWidget2PluginFactory.cpp
        @

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved