Custom plugin for Qt Simulator



  • Hi, I'm trying to develop a custom plugin for the Qt Simulator (the version 1.1 included in the MeeGo SDK 1.2).

    This is my plugin skeleton:

    myplugin.pro
    @
    QT += core gui

    TARGET = myplugin
    TEMPLATE = lib
    CONFIG += plugin
    SOURCES += myplugin.cpp
    mypluginui.cpp
    HEADERS += myplugin.h
    mypluginui.h
    RESOURCES += ui.qrc
    @

    myplugin.h
    @
    #ifndef MYPLUGIN_H
    #define MYPLUGIN_H

    #include <remotewidgetcontroller/plugininterface.h>

    class MyPlugin : public QObject, public PluginInterface
    {
    Q_OBJECT
    Q_INTERFACES(PluginInterface)

    public:
    MyPlugin(QObject *parent = 0);

    virtual QList<ToolBoxPage*> pages(QWidget *parent);
    

    };

    #endif
    @

    myplugin.cpp
    @
    #include "myplugin.h"
    #include "mypluginui.h"

    QList<ToolBoxPage*> MyPlugin::pages(QWidget parent)
    {
    QList<ToolBoxPage
    > pages;

    pages.append(new MyPluginUi(parent));
    
    return pages;
    

    }

    Q_EXPORT_PLUGIN2(myplugin, MyPlugin)
    @

    mypluginui.h
    @
    #ifndef MYPLUGINUI_H
    #define MYPLUGINUI_H

    #include <remotewidgetcontroller/toolbox.h>

    class QListWidget;

    class MyPluginUi : public ToolBoxPage
    {
    Q_OBJECT

    public:
    MyPluginUi(QWidget *parent = 0);
    virtual ~MyPluginUi();

    QIcon icon() const;
    

    };

    #endif
    @

    mypluginui.cpp
    @
    #include "mypluginui.h"
    #include <remotewidgetcontroller/optionsitem.h>

    MyPluginUi::MyPluginUi(QWidget *parent)
    : ToolBoxPage(parent)
    {
    QList<OptionsItem *> options;

    this->setTitle(tr("My Plugin"));
    this->setOptions(options);
    

    }

    MyPluginUi::~MyPluginUi()
    {
    }

    QIcon MyPluginUi::icon() const
    {
    return QIcon(":/icons/application.png");
    }
    @

    The project builds successfully but when I copy the result (a single dynamic library) inside a "qt-simulator/plugins/myplugin" and then I launch the simulator, its tab is not displayed in the list of available modules.

    How can I resolve this issue?

    Thank you!


Log in to reply
 

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