Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Custom plugin for Qt Simulator
Forum Updated to NodeBB v4.3 + New Features

Custom plugin for Qt Simulator

Scheduled Pinned Locked Moved Qt Creator and other tools
1 Posts 1 Posters 1.4k Views 1 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.
  • Z Offline
    Z Offline
    zuck
    wrote on last edited by
    #1

    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!

    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