Designer: Compilation with Qt 5.

Test the new Qt Designer integration interfaces.

Change-Id: I8364167d5be3e7c361b192318b0bba7fb70d0f2f
Reviewed-on: http://codereview.qt.nokia.com/9
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Friedemann Kleint
2011-05-19 11:30:38 +02:00
committed by Kai Koehne
parent 0d3d38ecc1
commit b0d093b0d7
13 changed files with 203 additions and 42 deletions

View File

@@ -35,7 +35,12 @@
#include "formeditorw.h"
#include <QtDesigner/QDesignerFormEditorInterface>
#include "qt_private/qdesigner_integration_p.h"
#if QT_VERSION >= 0x050000
# include <QtDesigner/QDesignerIntegration>
#else
# include "qt_private/qdesigner_integration_p.h"
#endif
#include <QtGui/QWidget>
#include <QtCore/QDebug>
@@ -56,16 +61,18 @@ DesignerContext::DesignerContext(const Core::Context &context,
QString DesignerContext::contextHelpId() const
{
QString helpId;
const QDesignerFormEditorInterface *core = FormEditorW::instance()->designerEditor();
// Present from Qt 4.5.1 onwards. This will show the class documentation
#if QT_VERSION >= 0x050000
return core->integration()->contextHelpId();
#else
QString helpId;
// Present from Qt 4.5.1 onwards. This will show the class documentation
// scrolled to the current property.
if (const qdesigner_internal::QDesignerIntegration *integration =
qobject_cast<const qdesigner_internal::QDesignerIntegration*>(core->integration()))
helpId = integration->contextHelpId();
if (debug)
qDebug() << "DesignerContext::contextHelpId" << m_widget << helpId;
return helpId;
#endif
}
} // namespace Internal