forked from qt-creator/qt-creator
Merge branch '2.0'
Conflicts: src/plugins/qmlinspector/QmlInspector.pluginspec
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -4570,12 +4570,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
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -257,9 +257,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;
|
||||
}
|
||||
}
|
||||
@@ -275,7 +275,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.
|
||||
@@ -305,7 +305,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();
|
||||
}
|
||||
|
||||
@@ -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<void**>(&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<PWSTR>(const_cast<ushort *>(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<ushort*>(file.utf16()),
|
||||
(wchar_t*)(file.utf16()),
|
||||
&rc);
|
||||
if (FAILED(hr)) {
|
||||
*errorMessage = QString::fromLatin1("Unable to determine address of %1:%2 : %3").
|
||||
|
||||
@@ -79,6 +79,12 @@
|
||||
|
||||
#include <QtHelp/QHelpEngine>
|
||||
|
||||
#if !defined(QT_NO_WEBKIT)
|
||||
#include <QtWebKit/QWebElement>
|
||||
#include <QtWebKit/QWebElementCollection>
|
||||
#include <QtWebKit/QWebFrame>
|
||||
#endif
|
||||
|
||||
using namespace Core::Constants;
|
||||
using namespace Help::Internal;
|
||||
|
||||
@@ -688,13 +694,11 @@ void HelpPlugin::activateContext()
|
||||
} else if (m_core->modeManager()->currentMode() == m_mode)
|
||||
return;
|
||||
|
||||
QString id;
|
||||
QMap<QString, QUrl> links;
|
||||
|
||||
// Find out what to show
|
||||
QMap<QString, QUrl> 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()) {
|
||||
@@ -702,16 +706,24 @@ void HelpPlugin::activateContext()
|
||||
// No link found or no context object
|
||||
viewer->setHtml(tr("<html><head><title>No Documentation</title>"
|
||||
"</head><body><br/><center><b>%1</b><br/>No documentation "
|
||||
"available.</center></body></html>").arg(id));
|
||||
"available.</center></body></html>").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();
|
||||
}
|
||||
if (viewer != m_helpViewerForSideBar)
|
||||
activateHelpMode();
|
||||
viewer->setFocus();
|
||||
connect(viewer, SIGNAL(loadFinished(bool)), this,
|
||||
SLOT(highlightSearchTerms()));
|
||||
|
||||
if (source.toString().remove(source.fragment())
|
||||
== oldSource.toString().remove(oldSource.fragment())) {
|
||||
highlightSearchTerms();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -819,6 +831,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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<plugin name="QmlInspector" version="2.1.80" compatVersion="2.1.80">
|
||||
<plugin name="QmlInspector" version="2.1.80" compatVersion="2.1.80" experimental="true">
|
||||
<vendor>Nokia Corporation</vendor>
|
||||
<copyright>(C) 2010 Nokia Corporation</copyright>
|
||||
<license>
|
||||
|
||||
Reference in New Issue
Block a user