From 1d35bc7003239611f3525e2fa1830867104cac9e Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 15 Apr 2009 16:34:37 +0200 Subject: [PATCH 1/9] Don't annoy Windows users with alien dir separators --- src/plugins/projectexplorer/taskwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 19636975c99..e3a431be859 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -559,7 +559,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, static_cast(0.7 * textColor.blue() + 0.3 * backgroundColor.blue())); painter->setPen(mix); - QString directory = index.data(TaskModel::File).toString(); + const QString directory = QDir::toNativeSeparators(index.data(TaskModel::File).toString()); int secondBaseLine = 2 + fm.ascent() + opt.rect.top() + height + leading; //opt.rect.top() + fm.ascent() + fm.height() + 6; if (index.data(TaskModel::FileNotFound).toBool()) { QString fileNotFound = tr("File not found: %1").arg(directory); From 2cc895911401c87945f52dcf86e6990f88bf8841 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 15 Apr 2009 16:38:32 +0200 Subject: [PATCH 2/9] Introduce option -enable-cdb to enable CDB. Reviewed-by: hjk --- doc/qtcreator.qdoc | 5 ++++- src/plugins/debugger/Debugger.pluginspec | 3 +++ src/plugins/debugger/debuggermanager.cpp | 9 +++++---- src/plugins/debugger/debuggermanager.h | 4 ++-- src/plugins/debugger/debuggerplugin.cpp | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 198aad2ed46..c7de2e6d76d 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -1297,7 +1297,10 @@ When building \e{Qt Creator} using the \e{Microsoft Visual C++ Compiler}, the location \c{"%ProgramFiles%\Debugging Tools for Windows"} will be checked for the required include files. - \ + + \note As of version 1.2, the command line option \c{-enable-cdb} has to be passed + to Qt Creator to enable support for this engine. + \endtable */ diff --git a/src/plugins/debugger/Debugger.pluginspec b/src/plugins/debugger/Debugger.pluginspec index 497520d69aa..da8d04450ff 100644 --- a/src/plugins/debugger/Debugger.pluginspec +++ b/src/plugins/debugger/Debugger.pluginspec @@ -24,4 +24,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + + + diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 5f8f07aed0e..fc5f3371f57 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -148,9 +148,9 @@ extern IDebuggerEngine *createWinEngine(DebuggerManager *) #endif extern IDebuggerEngine *createScriptEngine(DebuggerManager *parent); -DebuggerManager::DebuggerManager() +DebuggerManager::DebuggerManager(const QStringList &arguments) { - init(); + init(arguments); } DebuggerManager::~DebuggerManager() @@ -160,7 +160,7 @@ DebuggerManager::~DebuggerManager() delete scriptEngine; } -void DebuggerManager::init() +void DebuggerManager::init(const QStringList &arguments) { m_status = -1; m_busy = false; @@ -427,7 +427,8 @@ void DebuggerManager::init() setStatus(DebuggerProcessNotReady); gdbEngine = createGdbEngine(this); - winEngine = createWinEngine(this); + if (arguments.contains(QLatin1String("-enable-cdb"))) + winEngine = createWinEngine(this); scriptEngine = createScriptEngine(this); setDebuggerType(GdbDebugger); if (Debugger::Constants::Internal::debug) diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index b9709a68fa5..b6cf4b78f40 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -178,7 +178,7 @@ class DebuggerManager : public QObject, Q_OBJECT public: - DebuggerManager(); + DebuggerManager(const QStringList &arguments); ~DebuggerManager(); IDebuggerManagerAccessForEngines *engineInterface(); @@ -341,7 +341,7 @@ public: bool m_useTerminal; private: - void init(); + void init(const QStringList &arguments); void setDebuggerType(DebuggerType type); void runTest(const QString &fileName); QDockWidget *createDockForWidget(QWidget *widget); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 8a1cb6baca7..90cb7bd1f79 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -470,7 +470,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess Q_UNUSED(arguments); Q_UNUSED(errorMessage); - m_manager = new DebuggerManager; + m_manager = new DebuggerManager(arguments); ICore *core = ICore::instance(); QTC_ASSERT(core, return false); From c36d51792f9262fca27928a9485981c5005f73b8 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 15 Apr 2009 16:54:18 +0200 Subject: [PATCH 3/9] Don't annoy Windows users with alien dir separators --- src/libs/extensionsystem/plugindetailsview.cpp | 4 +++- src/libs/extensionsystem/pluginview.cpp | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libs/extensionsystem/plugindetailsview.cpp b/src/libs/extensionsystem/plugindetailsview.cpp index bb4ffb6b0ba..e9e90f6e82d 100644 --- a/src/libs/extensionsystem/plugindetailsview.cpp +++ b/src/libs/extensionsystem/plugindetailsview.cpp @@ -30,6 +30,8 @@ #include "plugindetailsview.h" #include "ui_plugindetailsview.h" +#include + /*! \class ExtensionSystem::PluginDetailsView \brief Widget that displays the contents of a PluginSpec. @@ -74,7 +76,7 @@ void PluginDetailsView::update(PluginSpec *spec) m_ui->compatVersion->setText(spec->compatVersion()); m_ui->vendor->setText(spec->vendor()); m_ui->url->setText(spec->url()); - m_ui->location->setText(spec->filePath()); + m_ui->location->setText(QDir::toNativeSeparators(spec->filePath())); m_ui->description->setText(spec->description()); m_ui->copyright->setText(spec->copyright()); m_ui->license->setText(spec->license()); diff --git a/src/libs/extensionsystem/pluginview.cpp b/src/libs/extensionsystem/pluginview.cpp index 3747e86c53f..e467f04db27 100644 --- a/src/libs/extensionsystem/pluginview.cpp +++ b/src/libs/extensionsystem/pluginview.cpp @@ -33,6 +33,7 @@ #include "pluginspec.h" #include "ui_pluginview.h" +#include #include #include #include @@ -124,8 +125,8 @@ void PluginView::updateList() << spec->name() << QString("%1 (%2)").arg(spec->version()).arg(spec->compatVersion()) << spec->vendor() - << spec->filePath()); - item->setToolTip(4, spec->filePath()); + << QDir::toNativeSeparators(spec->filePath())); + item->setToolTip(4, QDir::toNativeSeparators(spec->filePath())); item->setIcon(0, spec->hasError() ? errorIcon : okIcon); item->setData(0, Qt::UserRole, qVariantFromValue(spec)); items.append(item); From 04fafbddfe5c8ba0428dee3dfb1ce1b18f60e9c9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 15 Apr 2009 17:19:15 +0200 Subject: [PATCH 4/9] Don't annoy Windows users with alien dir separators --- src/plugins/qt4projectmanager/qt4projectmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index df1d613dc30..0f460242b11 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -140,14 +140,14 @@ ProjectExplorer::Project* Qt4Manager::openProject(const QString &fileName) QString canonicalFilePath = QFileInfo(fileName).canonicalFilePath(); if (canonicalFilePath.isEmpty()) { - messageManager->printToOutputPane(tr("Failed opening project '%1': Project file does not exist").arg(canonicalFilePath)); + messageManager->printToOutputPane(tr("Failed opening project '%1': Project file does not exist").arg(QDir::toNativeSeparators(canonicalFilePath))); messageManager->displayStatusBarMessage(tr("Failed opening project"), 5000); return 0; } foreach (ProjectExplorer::Project *pi, projectExplorer()->session()->projects()) { if (canonicalFilePath == pi->file()->fileName()) { - messageManager->printToOutputPane(tr("Failed opening project '%1': Project already open").arg(canonicalFilePath)); + messageManager->printToOutputPane(tr("Failed opening project '%1': Project already open").arg(QDir::toNativeSeparators(canonicalFilePath))); messageManager->displayStatusBarMessage(tr("Failed opening project"), 5000); return 0; } From 86a5ab47c4449d0499007417b4968e5ed35d0fd6 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 15 Apr 2009 16:34:23 +0200 Subject: [PATCH 5/9] Fixes: - Doc: Some minor cleanups on the documentation for CDB --- doc/qtcreator.qdoc | 64 ++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index c7de2e6d76d..cfd3d69c950 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -964,6 +964,8 @@ \nextpage creator-cmake-support.html \title Debugging with Qt Creator + + \section1 Introduction Qt Creator does not have its own debugger. Instead, it provides a graphical @@ -975,17 +977,17 @@ \o Compiler \o Debugger Engine \row - \o Linux, Unixes, Mac OS - \o gcc - \o GNU Symbolic Debugger (gdb) + \o Linux, Unixes, Mac OS + \o gcc + \o GNU Symbolic Debugger (gdb) \row - \o Windows/MinGW - \o gcc - \o GNU Symbolic Debugger (gdb) + \o Windows/MinGW + \o gcc + \o GNU Symbolic Debugger (gdb) \row - \o Windows - \o Microsoft Visual C++ Compiler - \o Debugging Tools for Windows / Microsoft Console Debugger (CDB) + \o Windows + \o Microsoft Visual C++ Compiler + \o Debugging Tools for Windows/Microsoft Console Debugger (CDB) \endtable The frontend allows you to @@ -1004,6 +1006,28 @@ is able to present Qt's data clearly. + \section1 Debugger Engine Installation Notes + + \table + \header + \o Debugger Engine + \o Notes + \row + \o Debugging Tools for Windows + \o Using this engine requires you to install the + \e{Debugging Tools for Windows} 32-bit package (Version 6.10), + which is freely available for download from the + \l{http://msdn.microsoft.com/en-us/default.aspx} + {Microsoft Developer Network} or directly from + \l{http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx} + {Microsoft}. The pre-built \e{Qt SDK for Windows} will make use + of the library if it is present on the system. When building Qt + Creator using the Microsoft Visual C++ Compiler, the + \c{"%ProgramFiles%\Debugging Tools for Windows"} path will be + checked to ensure that all required header files are there. + \endtable + + \section1 Interacting with the Debugger In \gui Debug mode, several dock widgets are used to interact with the @@ -1280,28 +1304,6 @@ \image qtcreator-debugging-buttons.png - \section1 Debugger Engine Installation Notes - - \table - \header - \o Debugger Engine - \o Notes - \row - \o Debugging Tools for Windows - \o Using this engine requires installing the \e{Debugging Tools for Windows} - 32-bit package (Version 6.10), which is freely available for download from the - \l{http://msdn.microsoft.com/en-us/default.aspx}{Microsoft Developer Network} or - directly from \l{http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx}{Microsoft}. - The pre-built \e{Qt SDK for Windows} will make use of the library if it is present - on the system. - When building \e{Qt Creator} using the \e{Microsoft Visual C++ Compiler}, - the location \c{"%ProgramFiles%\Debugging Tools for Windows"} will be checked - for the required include files. - - \note As of version 1.2, the command line option \c{-enable-cdb} has to be passed - to Qt Creator to enable support for this engine. - - \endtable */ From 48bdd7aa1ad451ebf5231b22d42c0f74f42a7b20 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 15 Apr 2009 17:28:04 +0200 Subject: [PATCH 6/9] Fixes: - Doc - fixed a broken link and adding a bit more to the tutorial --- doc/addressbook-sdk.qdoc | 59 ++++++++++++++++++++++++++++++++++------ doc/qtcreator.qdoc | 5 +++- 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/doc/addressbook-sdk.qdoc b/doc/addressbook-sdk.qdoc index b6b257d55ff..e4942d1a828 100644 --- a/doc/addressbook-sdk.qdoc +++ b/doc/addressbook-sdk.qdoc @@ -75,13 +75,13 @@ Tutorial chapters: \list 1 - \o \l{Designing the User Interface} - \o \l{Adding Addresses} - \o \l{Navigating between Entries} - \o \l{Editing and Removing Addresses} - \o \l{Adding a Find Function} - \o \l{Loading and Saving} - \o \l{Additional Features} + \o \l{examples/addressbook-sdk/part1}{Designing the User Interface} + \o \l{examples/addressbook-sdk/part2}{Adding Addresses} + \o \l{examples/addressbook-sdk/part3}{Navigating between Entries} + \o \l{examples/addressbook-sdk/part4}{Editing and Removing Addresses} + \o \l{examples/addressbook-sdk/part5}{Adding a Find Function} + \o \l{examples/addressbook-sdk/part6}{Loading and Saving} + \o \l{examples/addressbook-sdk/part7}{Additional Features} \endlist Although this little application does not look much like a fully-fledged @@ -96,7 +96,8 @@ /*! \page tutorials-addressbook-sdk-part1.html \contentspage {Address Book Tutorial}{Contents} - \nextpage \l{Adding Addresses}{Chapter 2} + \nextpage \l{examples/addressbook-sdk/part2}{Chapter 2} + \example examples/addressbook-sdk/part1 \title Address Book 1 - Designing the User Interface The first part of this tutorial covers the design of the basic graphical @@ -172,6 +173,48 @@ same application or library, and the code for the subclass can be reused in other projects. \endlist + + Since Qt does not provided a specific address book widget, we subclass a + standard Qt widget class and add features to it. The \c AddressBook class + we create in this tutorial can be reused in situations where a basic + address book is needed. + + + \section1 Defining the AddressBook Class + + The \l{examples/addressbook-sdk/part1/addressbook.h}{\c addressbook.h} file + is used to define the \c AddressBook class. + + We start by looking at what is already provided for us by Qt Creator. The + \c AddressBook class has been defined as a QWidget subclass with a + constructor and destructor.The Q_OBJECT macro is used to indicate that the + class uses internationalization and Qt's signals and slots features, even + if we do not use all of htese features at this stage. + + \snippet examples/addressbook-sdk/part1/addressbook.h class definition + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index cfd3d69c950..e47ed3eb9b5 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -1171,12 +1171,14 @@ \row \i \bold{Note:} + \row \i Gdb, and therefore Qt Creator's debugger works for optimized builds on Linux and Mac OS X. However, optimization may lead to re-ordering of instructions or sometimes even complete removal of some local variables. In this case, the \gui{Locals and Watchers} view may show unexpected data. + \row \i The debug information provided by gcc does not include enough information about the time when a variable is initialized. Therefore, Qt Creator can not tell whether the contents of a @@ -1354,7 +1356,8 @@ Qt Creator automatically adds Run Configurations for all the targets specified in the \c CMake project file. - Known issues for the current version can be found \l{Known Issues}{here}. + Known issues for the current version can be found + \l{Known Issues of Version 1.1.80}{here}. */ From eed3c413e12bacb6797eb20ac01e38e2c6a26e78 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 15 Apr 2009 17:32:53 +0200 Subject: [PATCH 7/9] Don't annoy Windows users with alien dir separators --- src/plugins/projectexplorer/projectmodels.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index f784daf5905..c6a1ba7b30b 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -718,7 +718,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const break; } case Qt::ToolTipRole: { - result = node->path(); + result = QDir::toNativeSeparators(node->path()); break; } case Qt::DecorationRole: { From b13e19ef61e83c90eae2363af608819a6cc72563 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 15 Apr 2009 17:42:04 +0200 Subject: [PATCH 8/9] Don't annoy Windows users with alien dir separators --- src/plugins/cppeditor/cpphoverhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index a89c404dbda..1022fc1374f 100644 --- a/src/plugins/cppeditor/cpphoverhandler.cpp +++ b/src/plugins/cppeditor/cpphoverhandler.cpp @@ -294,7 +294,7 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in if (m_toolTip.isEmpty()) { foreach (const Document::Include &incl, doc->includes()) { if (incl.line() == lineNumber) { - m_toolTip = incl.fileName(); + m_toolTip = QDir::toNativeSeparators(incl.fileName()); break; } } From d54df03794e1d3104eced3f73808b670e12b8a39 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 15 Apr 2009 18:34:03 +0200 Subject: [PATCH 9/9] Don't annoy Windows users with alien dir separators --- src/plugins/coreplugin/welcomemode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/welcomemode.cpp b/src/plugins/coreplugin/welcomemode.cpp index 05fd51f15af..52e761bc72b 100644 --- a/src/plugins/coreplugin/welcomemode.cpp +++ b/src/plugins/coreplugin/welcomemode.cpp @@ -42,6 +42,7 @@ #include #include +#include #include #include #include @@ -239,7 +240,7 @@ void WelcomeMode::updateWelcomePage(const WelcomePageData &welcomePageData) for( it = welcomePageData.projectList.constBegin(); it != end; ++it) { const QFileInfo fi((*it).first); str << "
  • " << (*it).second << "

  • \n"; + << QDir::toNativeSeparators(fi.absolutePath()) << "\">" << (*it).second << "

    \n"; } projectHtml.replace(QLatin1String(""), projects); }