diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index 51e45335f0a8b712c14b7357f0138cf98fafa4f0..7ac310084526e1990cc7d588001b652b337fe3d2 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -281,6 +281,15 @@ void FormEditorW::fullInit() initDesignerSubWindows(); m_integration = new QtCreatorIntegration(m_formeditor, this); m_formeditor->setIntegration(m_integration); + // Connect Qt Designer help request to HelpManager. + // TODO: Use Core::HelpManager once it has been introduced. + foreach(QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) { + if (!qstrcmp(object->metaObject()->className(), "Help::HelpManager")) { + connect(m_integration, SIGNAL(creatorHelpRequested(QString)), + object, SLOT(handleHelpRequest(QString))); + break; + } + } /** * This will initialize our TabOrder, Signals and slots and Buddy editors. diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index 82b0df1e21e8109be91ac088405c65d9107512ed..e6439d71b7257f06576cfbbcab4c62eb9cb7808b 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -94,6 +94,14 @@ QtCreatorIntegration::QtCreatorIntegration(QDesignerFormEditorInterface *core, F setSlotNavigationEnabled(true); connect(this, SIGNAL(navigateToSlot(QString, QString, QStringList)), this, SLOT(slotNavigateToSlot(QString, QString, QStringList))); + connect(this, SIGNAL(helpRequested(QString,QString)), + this, SLOT(slotDesignerHelpRequested(QString,QString))); +} + +void QtCreatorIntegration::slotDesignerHelpRequested(const QString &manual, const QString &document) +{ + // Pass on as URL. + emit creatorHelpRequested(QString::fromLatin1("qthelp://com.trolltech.%1/qdoc/%2").arg(manual, document)); } void QtCreatorIntegration::updateSelection() diff --git a/src/plugins/designer/qtcreatorintegration.h b/src/plugins/designer/qtcreatorintegration.h index 138858286fd110dc3dcb58cf3bf13e73e5346046..c667ea8504de9ccf59f1d749af1a2dff9fb109e6 100644 --- a/src/plugins/designer/qtcreatorintegration.h +++ b/src/plugins/designer/qtcreatorintegration.h @@ -46,12 +46,18 @@ public: QWidget *containerWindow(QWidget *widget) const; - bool supportsToSlotNavigation() { return true; }; + bool supportsToSlotNavigation() { return true; } + +signals: + void creatorHelpRequested(const QString &url); public slots: void updateSelection(); + private slots: void slotNavigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList ¶meterNames); + void slotDesignerHelpRequested(const QString &manual, const QString &document); + private: bool navigateToSlot(const QString &objectName, const QString &signalSignature, diff --git a/src/plugins/help/helpmanager.h b/src/plugins/help/helpmanager.h index 39f2c939ea1042435b0afaba44d12dbaf33a629c..18a36bcd08af90fa0ab0370a68d66ded1da187d9 100644 --- a/src/plugins/help/helpmanager.h +++ b/src/plugins/help/helpmanager.h @@ -57,8 +57,6 @@ public: void setupGuiHelpEngine(); bool guiEngineNeedsUpdate() const; - void handleHelpRequest(const QString &url); - void verifyDocumenation(); void registerDocumentation(const QStringList &fileNames); void unregisterDocumentation(const QStringList &nameSpaces); @@ -69,6 +67,9 @@ public: static BookmarkManager& bookmarkManager(); +public slots: + void handleHelpRequest(const QString &url); + signals: void helpRequested(const QUrl &url);