From 992234759e147286d0b9aada52e77b8f3d5aa89b Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 13 Jul 2010 10:19:51 +0200 Subject: [PATCH 1/5] Doc - Add reference to a template image. --- doc/qt-defines.qdocconf | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/qt-defines.qdocconf b/doc/qt-defines.qdocconf index 3a857bd28e8..a9e8bbd23f7 100644 --- a/doc/qt-defines.qdocconf +++ b/doc/qt-defines.qdocconf @@ -32,6 +32,7 @@ extraimages.HTML = qt-logo \ bg_ll_blank.png \ bg_l_blank.png \ breadcrumb.png \ + bullet_up.png \ bullet_dn.png \ bullet_gt.png \ bullet_sq.png \ From d97284372d9d61b3dd2398d6dc3791b617107c8f Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 13 Jul 2010 12:09:16 +0200 Subject: [PATCH 2/5] Doc - Add information about unlocking views in Debug mode. Reviewed-by: Daniel Molkentin Task-number: QTCREATORBUG-1382 --- doc/qtcreator.qdoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 719e5a0df8c..b97620bff0e 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -4330,12 +4330,14 @@ In \gui Debug mode, you can use several views to interact with the program you are debugging. Frequently used views are shown by default and rarely used ones are hidden. To change the default settings, - select \gui Debug > \gui Views, and then select views to display - or hide. You can also lock views. The position of views is saved for future - sessions. + select \gui {Window > Views}, and then select views to display or hide. \image qtcreator-debugger-views.png "Debug mode views" + By default, the views are locked into place in the workspace. Select + \gui {Window > Views > Locked} to unlock the views. Drag and drop the + views into new positions on the screen. Drag view borders to resize the + views. The size and position of views are saved for future sessions. \section1 Starting the Debugger From 6a98c171479ed06a236332e64df89e6c5a76de71 Mon Sep 17 00:00:00 2001 From: kh1 Date: Thu, 8 Jul 2010 16:51:36 +0200 Subject: [PATCH 3/5] Implement topic highlighting after e.g. F1. Task-number: QTCREATORBUG-1765 Reviewed-by: ck --- src/plugins/help/helpplugin.cpp | 69 ++++++++++++++++++++++++++++----- src/plugins/help/helpplugin.h | 5 +++ 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 045292a1a5a..574c1080329 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -80,6 +80,12 @@ #include +#if !defined(QT_NO_WEBKIT) +#include +#include +#include +#endif + using namespace Core::Constants; using namespace Help::Internal; @@ -691,13 +697,11 @@ void HelpPlugin::activateContext() } else if (m_core->modeManager()->currentMode() == m_mode) return; - QString id; - QMap links; - // Find out what to show + QMap links; if (IContext *context = m_core->currentContextObject()) { - id = context->contextHelpId(); - links = Core::HelpManager::instance()->linksForIdentifier(id); + m_idFromContext = context->contextHelpId(); + links = Core::HelpManager::instance()->linksForIdentifier(m_idFromContext); } if (HelpViewer* viewer = viewerForContextMode()) { @@ -705,16 +709,24 @@ void HelpPlugin::activateContext() // No link found or no context object viewer->setHtml(tr("No Documentation" "
%1
No documentation " - "available.
").arg(id)); + "available.").arg(m_idFromContext)); viewer->setSource(QUrl()); } else { const QUrl &source = *links.begin(); - if (viewer->source() != source) + const QUrl &oldSource = viewer->source(); + if (source != oldSource) { + viewer->stop(); viewer->setSource(source); + } viewer->setFocus(); + connect(viewer, SIGNAL(loadFinished(bool)), this, + SLOT(highlightSearchTerms())); + + if (source.toString().remove(source.fragment()) + == oldSource.toString().remove(oldSource.fragment())) { + highlightSearchTerms(); + } } - if (viewer != m_helpViewerForSideBar) - activateHelpMode(); } } @@ -822,6 +834,45 @@ void HelpPlugin::addBookmark() manager->showBookmarkDialog(m_centralWidget, viewer->title(), url); } +void HelpPlugin::highlightSearchTerms() +{ + if (HelpViewer* viewer = viewerForContextMode()) { + disconnect(viewer, SIGNAL(loadFinished(bool)), this, + SLOT(highlightSearchTerms())); + +#if !defined(QT_NO_WEBKIT) + const QString &attrValue = m_idFromContext.mid(m_idFromContext + .lastIndexOf(QChar(':')) + 1); + if (attrValue.isEmpty()) + return; + + const QWebElement &document = viewer->page()->mainFrame()->documentElement(); + const QWebElementCollection &collection = document.findAll(QLatin1String("h3.fn a")); + + const QLatin1String property("background-color"); + foreach (const QWebElement &element, collection) { + const QString &name = element.attribute(QLatin1String("name")); + if (name.isEmpty()) + continue; + + if (m_oldAttrValue == name) { + QWebElement parent = element.parent(); + parent.setStyleProperty(property, m_styleProperty); + } + + if (attrValue == name) { + QWebElement parent = element.parent(); + m_styleProperty = parent.styleProperty(property, + QWebElement::InlineStyle); + parent.setStyleProperty(property, QLatin1String("yellow")); + } + } + m_oldAttrValue = attrValue; +#endif + viewer->findText(m_idFromContext, 0, false, true); + } +} + void HelpPlugin::handleHelpRequest(const QUrl &url) { if (HelpViewer::launchWithExternalApp(url)) diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h index a5099db7f7d..d7927fc221c 100644 --- a/src/plugins/help/helpplugin.h +++ b/src/plugins/help/helpplugin.h @@ -98,6 +98,7 @@ private slots: void updateCloseButton(); void setupHelpEngineIfNeeded(); + void highlightSearchTerms(); void handleHelpRequest(const QUrl &url); private: @@ -134,6 +135,10 @@ private: Core::MiniSplitter *m_splitter; QToolButton *m_closeButton; + + QString m_oldAttrValue; + QString m_styleProperty; + QString m_idFromContext; }; } // namespace Internal From 946ab0fd8bc8772b423ab087e8f0f20eb833a341 Mon Sep 17 00:00:00 2001 From: Lasse Holmstedt Date: Tue, 13 Jul 2010 14:30:58 +0200 Subject: [PATCH 4/5] Disabled QML Inspector by default Users can still go to plugin manager and manually enable the plugin. Reviewed-by: con --- src/plugins/qmlinspector/QmlInspector.pluginspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmlinspector/QmlInspector.pluginspec b/src/plugins/qmlinspector/QmlInspector.pluginspec index f2531d832c8..ebe1be3f0dd 100644 --- a/src/plugins/qmlinspector/QmlInspector.pluginspec +++ b/src/plugins/qmlinspector/QmlInspector.pluginspec @@ -1,4 +1,4 @@ - + Nokia Corporation (C) 2010 Nokia Corporation From a9cf11c57fcc05fc071636b4f4d6b14e157657f8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 13 Jul 2010 14:58:53 +0200 Subject: [PATCH 5/5] MSVC: Fix compilation with new mkspecs. See Qt Merge-request: 727, change a9c8decc741d8c2b340f38d7a854ef206672ab3e, which makes wchar_t a native type. QString::toUtf16() no longer is a WCHAR. --- .../coreplugin/progressmanager/progressmanager_win.cpp | 2 +- src/plugins/debugger/cdb/breakpoint.cpp | 8 ++++---- src/plugins/debugger/cdb/coreengine.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp b/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp index 05fc9dacd47..882a642ba50 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp @@ -95,7 +95,7 @@ void Core::Internal::ProgressManagerPrivate::setApplicationLabel(const QString & font.setPointSize(font.pointSize()-2); p.setFont(font); p.drawText(QRect(QPoint(0,0), pix.size()), Qt::AlignHCenter|Qt::AlignCenter, text); - pITask->SetOverlayIcon(winId, pix.toWinHICON(), text.utf16()); + pITask->SetOverlayIcon(winId, pix.toWinHICON(), (wchar_t*)text.utf16()); } } diff --git a/src/plugins/debugger/cdb/breakpoint.cpp b/src/plugins/debugger/cdb/breakpoint.cpp index 469d39e5835..7e1fd4aad6c 100644 --- a/src/plugins/debugger/cdb/breakpoint.cpp +++ b/src/plugins/debugger/cdb/breakpoint.cpp @@ -237,9 +237,9 @@ static bool mapDeviceToDriveLetter(QString *s) for (const TCHAR *driveLetter = driveLetters; *driveLetter; driveLetter++) { szDrive[0] = *driveLetter; // Look up each device name if (QueryDosDevice(szDrive, driveName, MAX_PATH)) { - const QString deviceName = QString::fromUtf16(driveName); + const QString deviceName = QString::fromWCharArray(driveName); if (s->startsWith(deviceName)) { - s->replace(0, deviceName.size(), QString::fromUtf16(szDrive)); + s->replace(0, deviceName.size(), QString::fromWCharArray(szDrive)); return true; } } @@ -255,7 +255,7 @@ static bool mapDeviceToDriveLetter(QString *s) static inline QString normalizeFileNameCaseHelper(const QString &f) { - HANDLE hFile = CreateFile(f.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); + HANDLE hFile = CreateFile((const wchar_t*)f.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if(hFile == INVALID_HANDLE_VALUE) return f; // Get the file size. We need a non-empty file to map it. @@ -285,7 +285,7 @@ static inline QString normalizeFileNameCaseHelper(const QString &f) pszFilename[0] = 0; // Get a file name of the form "/Device/HarddiskVolume1/file.cpp" if (GetMappedFileName (GetCurrentProcess(), pMem, pszFilename, MAX_PATH)) { - rc = QString::fromUtf16(pszFilename); + rc = QString::fromWCharArray(pszFilename); if (!mapDeviceToDriveLetter(&rc)) rc.clear(); } diff --git a/src/plugins/debugger/cdb/coreengine.cpp b/src/plugins/debugger/cdb/coreengine.cpp index 152e9de26d4..30aba9547ac 100644 --- a/src/plugins/debugger/cdb/coreengine.cpp +++ b/src/plugins/debugger/cdb/coreengine.cpp @@ -296,7 +296,7 @@ bool CoreEngine::init(const QString &dllEnginePath, QString *errorMessage) *errorMessage = msgComFailed("GetImagePathWide", hr); return false; } - m_baseImagePath = QString::fromUtf16(buf); + m_baseImagePath = QString::fromWCharArray(buf); hr = lib.debugCreate( __uuidof(IDebugRegisters2), reinterpret_cast(&m_cif.debugRegisters)); if (FAILED(hr)) { @@ -447,7 +447,7 @@ bool CoreEngine::startDebuggerWithExecutable(const QString &workingDirectory, PCWSTR workingDirC = 0; const QString workingDirN = workingDirectory.isEmpty() ? QString() : QDir::toNativeSeparators(workingDirectory); if (!workingDirN.isEmpty()) - workingDirC = workingDirN.utf16(); + workingDirC = (PCWSTR)workingDirN.utf16(); hr = m_cif.debugClient->CreateProcess2Wide(NULL, reinterpret_cast(const_cast(cmd.utf16())), &dbgopts, sizeof(dbgopts), @@ -820,7 +820,7 @@ quint64 CoreEngine::getSourceLineAddress(const QString &file, { ULONG64 rc = 0; const HRESULT hr = m_cif.debugSymbols->GetOffsetByLineWide(line, - const_cast(file.utf16()), + (wchar_t*)(file.utf16()), &rc); if (FAILED(hr)) { *errorMessage = QString::fromLatin1("Unable to determine address of %1:%2 : %3").