Do you want to extend Qt Quick Designer or substitute it with your own?
Do you want to extend Qt Quick Designer or substitute it with your own?
Yes, I'm writing a Qt Quick designer plugin. Within my code: I need to add my items into these Qt Quick designer objects:
- Object1: “Welcomeâ€, “Designâ€, “Debugâ€, “Projectsâ€, “Analyzeâ€, “Help†vertical tab bar.
- Object2: “Library†dropdown list
- Object3: “main.qml†dropdown list
- Object4: “Open Documents†dropdown list
Thanks
Thanks for the follow up. I want to extend Qt Quick Designer.
I don't think Qt Quick Designer plugin is tailored to handle sub-plugins. You can easily verify that by seeing if the plugin tries to fetch a list of objects in its extensionsInitialized() method.
Hi
Thank you very much for the reply. I'm not sure what you mean by "the plugin tries to fetch a list of objects....". What I have done is to try to list all the objects exposed by the QML Designer plugin in the QCreator pluigin manager. I have tried this code in a sample widget app, but it fails.
Here my code:
#include "C:\qt-creator-opensource-src-3.1.0\src\libs\extensionsystem\pluginmanager.h"
ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance();
QList<QObject*> objects = pm->allObjects();
foreach(QObject* obj, objects)
{
QString objInfo = QString(QString::fromStdString("%1 (%2)"))
.arg(obj->objectName())
.arg(QString::fromStdString(obj->metaObject()->className()));
qDebug() << objInfo;
}
I'm getting this crash at compile time:
error: undefined reference to `_imp___ZN15ExtensionSystem13PluginManager8instanc eEv'
error: undefined reference to `_imp___ZN15ExtensionSystem13PluginManager10allObj ectsEv'
:-1: error: release/main.o: bad reloc address 0x20 in section `.text$_ZN7QStringD1Ev[__ZN7QStringD1Ev]'
I mean exactly what I wrote -- see if the plugin gets some list of objects in its extensionsInitialized() method. If you don't understand such a simple thing then I have no idea how you intend to write a plugin that extends Qt Quick Designer.
After having a quick look at the current repository (https://qt.gitorious.org/qt-creator/...gnerplugin.cpp) one can see that extensionsInitialized() doesn't expect any objects in the object pool to be available and the only object it exposes itself is its settings pane. So I guess you are out of luck and you will have to modify the plugin's code directly.
It is not a crash, it is a linking error as you are probably not linking to some needed library (e.g. the core plugin of Qt Creator).I'm getting this crash at compile time:
error: undefined reference to `_imp___ZN15ExtensionSystem13PluginManager8instanc eEv'
error: undefined reference to `_imp___ZN15ExtensionSystem13PluginManager10allObj ectsEv'
:-1: error: release/main.o: bad reloc address 0x20 in section `.text$_ZN7QStringD1Ev[__ZN7QStringD1Ev]'
Bookmarks