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. How to make plugins configurable?
Forum Updated to NodeBB v4.3 + New Features

How to make plugins configurable?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.9k Views 2 Watching
  • 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.
  • D Offline
    D Offline
    Defohin
    wrote on last edited by
    #1

    I have a PluginManager where searches for plugins in a folder, load using QPluginLoader puts in a QHash<QString, QPluginLoader *> the QString has the classname taken from the QPluginLoader::metaData.
    The PluginManager has a method called initializePlugins where has a foreach getting the instance of each plugin using qobject_cast and calling the method initialize of the plugin.

    The idea I want to implement? The plugins are websites, for example: rapidgator.com and I need login and password information from the user.
    I want to implement a kind of listing of the plugins found in a window, maybe in a configuration part of the system, maybe it could help, but I have no idea what I can do.
    How to make plugins configurable? Each plugin can have configuration individually?

    jsulmJ 1 Reply Last reply
    0
    • D Defohin

      I have a PluginManager where searches for plugins in a folder, load using QPluginLoader puts in a QHash<QString, QPluginLoader *> the QString has the classname taken from the QPluginLoader::metaData.
      The PluginManager has a method called initializePlugins where has a foreach getting the instance of each plugin using qobject_cast and calling the method initialize of the plugin.

      The idea I want to implement? The plugins are websites, for example: rapidgator.com and I need login and password information from the user.
      I want to implement a kind of listing of the plugins found in a window, maybe in a configuration part of the system, maybe it could help, but I have no idea what I can do.
      How to make plugins configurable? Each plugin can have configuration individually?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Defohin What about http://doc.qt.io/qt-5/qsettings.html ?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      1
      • jsulmJ jsulm

        @Defohin What about http://doc.qt.io/qt-5/qsettings.html ?

        D Offline
        D Offline
        Defohin
        wrote on last edited by
        #3

        @jsulm QSettings will help me to save the settings, but that is not what I'm actually asking here, but how to ask for the user for the login and password, or another configuration.
        I thought about creating a window with all the plugins listed and when you click or something like that the configurations for that plugin appears!?
        I'm not worried about saving the configurations, but how to provide different configurations for different plugins where the user can specify then somewhere.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Make the configuration part of your plugin by e.g. making it provide a configuration widget.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            Make the configuration part of your plugin by e.g. making it provide a configuration widget.

            D Offline
            D Offline
            Defohin
            wrote on last edited by
            #5

            @SGaist I know that it might be asking too much but can you provide an example? I can't find anything similar.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Well, it boils down to adding a method to your plugin interface called e.g. virtual QWidget *configurationWidget() const = 0; and in your plugins, you reimplement it to return a QWidget based widget that provides a panel that allows to modify whatever plugin specific settings you may need.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              D 1 Reply Last reply
              2
              • SGaistS SGaist

                Well, it boils down to adding a method to your plugin interface called e.g. virtual QWidget *configurationWidget() const = 0; and in your plugins, you reimplement it to return a QWidget based widget that provides a panel that allows to modify whatever plugin specific settings you may need.

                D Offline
                D Offline
                Defohin
                wrote on last edited by
                #7

                @SGaist I'll try to implement something using this approach, thank you.

                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