diff --git a/doc/qtcreator-texteditor-completion.png b/doc/qtcreator-texteditor-completion.png new file mode 100644 index 0000000000000000000000000000000000000000..b9affb233926abae16aec7a7294695f80a4cffc3 Binary files /dev/null and b/doc/qtcreator-texteditor-completion.png differ diff --git a/doc/qtcreator-texteditor-fonts.png b/doc/qtcreator-texteditor-fonts.png new file mode 100644 index 0000000000000000000000000000000000000000..ae08dfe5560bcbde3f77974c4c574109ce1b8225 Binary files /dev/null and b/doc/qtcreator-texteditor-fonts.png differ diff --git a/doc/qtcreator-texteditor-general.png b/doc/qtcreator-texteditor-general.png new file mode 100644 index 0000000000000000000000000000000000000000..c701efbd2def407395a15223c5d716aae42ee75b Binary files /dev/null and b/doc/qtcreator-texteditor-general.png differ diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index adca523a81f0561ccf3b06e17d95462906be6f12..ac88edd4558b1617f0648c354936f9a7727d27ee 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -215,8 +215,20 @@ \title The Code Editor - ### SCREENSHOT of the editor in action + Qt Creator's code editor is designed to aid the developer to create, edit, + and navigate code. It is fully equipped with syntax highlighting, code + completion, context sensitive help, as well as inline error indicators + while you are typing. The screenshots below show the various dialogs within + which you can configure your editor. + \table + \row + \i \inlineimage qtcreator-texteditor-general.png + \i \inlineimage qtcreator-texteditor-fonts.png + \i \inlineimage qtcreator-texteditor-completion.png + \endtable + + The table below lists keyboard shortcuts supported by the code editor. \table \row @@ -239,10 +251,19 @@ \row \i Indenting Blocks \i Use \key{Ctrl+I} + + \row + \i Collapse + \i Use \key{Ctrl+\<} + \row \i Commenting or uncommenting blocks \i Use \key{Ctrl+\/} + \row + \i Delete a line + \i Use \key{Shift+Del} + \row \i Switch between header file and source file \i Use \key{F4}. @@ -256,19 +277,12 @@ \i Use \key{F2} and \key{Shift+F2}. This feature works with namespaces, classes, methods, variables, include statements, and macros. - \endtable - - - More: - - Collapse - - Up/Down/Page Up/Page Down - hold ctrl to prevent the cursor from moving - - - To switch to an external editor, select \gui{Open in external editor} from - the \gui{Edit -> Advanced} menu. + \row + \i Switch to an external editor + \i Select \gui{Open in external editor} from the + \gui{Edit -> Advanced} menu. + \endtable */ diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 26d64fc240c5c068f8dc9322d9eafbf098b91035..fc33aa5e99c80dd3b2dd7f91aff15a8d83b93906 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -462,6 +462,7 @@ bool EditorManager::unregisterEditor(IEditor *editor) return false; } + void EditorManager::updateCurrentEditorAndGroup(IContext *context) { if (debugEditorManager) @@ -470,7 +471,8 @@ void EditorManager::updateCurrentEditorAndGroup(IContext *context) IEditor *editor = context ? qobject_cast<IEditor*>(context) : 0; if (groupContext) { m_d->m_splitter->setCurrentGroup(groupContext->editorGroup()); - setCurrentEditor(0); + if (groupContext->editorGroup()->editorCount() == 0) + setCurrentEditor(0); updateActions(); } else if (editor) { setCurrentEditor(editor); diff --git a/src/plugins/coreplugin/html/images/feedback-text.png b/src/plugins/coreplugin/html/images/feedback-text.png index 731bdc50a322c6153ed760cb7ca8d6a8b59b010c..5f6f05843fbc0452b31538c8f9666db9199ba255 100644 Binary files a/src/plugins/coreplugin/html/images/feedback-text.png and b/src/plugins/coreplugin/html/images/feedback-text.png differ diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 4558ccaae88e3ed544085ffdc24bec71574ac873..f0cda5147c2eed82ed7969c63e8d206611a041e8 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -124,10 +124,23 @@ void CodepasterPlugin::extensionsInitialized() ->getObject<ProjectExplorer::ProjectExplorerPlugin>(); } +QString CodepasterPlugin::serverUrl() const +{ + QString url = m_settingsPage->serverUrl().toString(); + if (url.startsWith("http://")) + url = url.mid(7); + if (url.endsWith('/')) + url.chop(1); + return url; +} + void CodepasterPlugin::post() { - if (m_poster) + // FIXME: The whole m_poster thing is de facto a simple function call. + if (m_poster) { delete m_poster; + m_poster = 0; + } IEditor* editor = EditorManager::instance()->currentEditor(); ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor); if (!textEditor) @@ -171,7 +184,8 @@ void CodepasterPlugin::post() data = view.getContent(); // Submit to codepaster - m_poster = new CustomPoster(m_settingsPage->serverUrl().toString()); + + m_poster = new CustomPoster(serverUrl()); // Copied from cpaster. Otherwise lineendings will screw up if (!data.contains("\r\n")) { @@ -185,9 +199,11 @@ void CodepasterPlugin::post() void CodepasterPlugin::fetch() { - if (m_fetcher) + if (m_fetcher) { delete m_fetcher; - m_fetcher = new CustomFetcher(m_settingsPage->serverUrl().toString()); + m_fetcher = 0; + } + m_fetcher = new CustomFetcher(serverUrl()); QDialog dialog; Ui_PasteSelectDialog ui; @@ -208,7 +224,7 @@ void CodepasterPlugin::fetch() return; delete m_fetcher; - m_fetcher = new CustomFetcher(m_settingsPage->serverUrl().toString()); + m_fetcher = new CustomFetcher(serverUrl()); m_fetcher->fetch(pasteID); } diff --git a/src/plugins/cpaster/cpasterplugin.h b/src/plugins/cpaster/cpasterplugin.h index 56c41144a96e7882c0636f5837020ff931d97b90..3658169c6cbbd04c0ac975c050b651871d769273 100644 --- a/src/plugins/cpaster/cpasterplugin.h +++ b/src/plugins/cpaster/cpasterplugin.h @@ -70,6 +70,7 @@ public slots: void fetch(); private: + QString serverUrl() const; QAction *m_postAction; QAction *m_fetchAction; diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 2f0a389432874ef598a95eb0c5d57dc4fe2d3afd..50d45ff8769f1731c67317ca938dca7be727a9fd 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -180,7 +180,16 @@ bool FakeVimPluginPrivate::initialize() void FakeVimPluginPrivate::installHandler(Core::IEditor *editor) { + if (!editor) + return; + QWidget *widget = editor->widget(); + if (!widget) + return; + + // we can only handle QTextEdit and QPlainTextEdit + if (!qobject_cast<QTextEdit *>(widget) && !qobject_cast<QPlainTextEdit *>(widget)) + return; FakeVimHandler *handler = new FakeVimHandler(widget, widget); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 6e67989158b6424f4da2f06c0bc1591016eb471e..4415a73209c396e1025d97cf0865364c1cbcc004 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -177,7 +177,10 @@ void QtVersionManager::apply() } } } - m_versions = m_widget->versions(); + qDeleteAll(m_versions); + m_versions.clear(); + foreach(QtVersion *version, m_widget->versions()) + m_versions.append(new QtVersion(*version)); if (versionPathsChanged) updateDocumentation(); updateUniqueIdToIndexMap(); @@ -361,11 +364,16 @@ QtVersion *QtVersionManager::currentQtVersion() const QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion) : QWidget(parent) - , m_versions(versions) , m_defaultVersion(defaultVersion) , m_specifyNameString(tr("<specify a name>")) , m_specifyPathString(tr("<specify a path>")) { + // Initialize m_versions + foreach(QtVersion *version, versions) { + m_versions.append(new QtVersion(*version)); + } + + m_ui.setupUi(this); m_ui.qtPath->setExpectedKind(Core::Utils::PathChooser::Directory); m_ui.qtPath->setPromptDialogTitle(tr("Select QTDIR")); @@ -417,6 +425,11 @@ QtDirWidget::QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defau updateState(); } +QtDirWidget::~QtDirWidget() +{ + qDeleteAll(m_versions); +} + void QtDirWidget::addQtDir() { QtVersion *newVersion = new QtVersion(m_specifyNameString, m_specifyPathString); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index f6ccd017b67e7edd9cd16548e06cfd967d3604d1..11e5ec8235922558fc83d9582fab762c77c18c2e 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -122,7 +122,6 @@ private: // This is updated on first call to qmakeCommand // That function is called from updateVersionInfo() mutable QString m_qtVersionString; - Q_DISABLE_COPY(QtVersion); }; @@ -131,6 +130,7 @@ class QtDirWidget : public QWidget Q_OBJECT public: QtDirWidget(QWidget *parent, QList<QtVersion *> versions, int defaultVersion); + ~QtDirWidget(); QList<QtVersion *> versions() const; int defaultVersion() const; void finish(); diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp index c67f976e59c8cbb87d006e794e008d136914ae30..c54b75a1e2db1c96e88dc7b346638b04f7f60dad 100644 --- a/src/shared/proparser/profileevaluator.cpp +++ b/src/shared/proparser/profileevaluator.cpp @@ -719,6 +719,7 @@ bool ProFileEvaluator::Private::visitProValue(ProValue *value) // The following two blocks fix bug 180128 by making all "interesting" // file name absolute in each .pro file, not just the top most one if (varName == QLatin1String("SOURCES") + || varName == QLatin1String("OBJECTIVE_SOURCES") || varName == QLatin1String("HEADERS") || varName == QLatin1String("INTERFACES") || varName == QLatin1String("FORMS") @@ -1666,7 +1667,7 @@ bool ProFileEvaluator::Private::evaluateConditionalFunction(const QString &funct } const QStringList mutuals = args[1].split(QLatin1Char('|')); const QStringList &configs = valuesDirect(QLatin1String("CONFIG")); - for (int i = configs.size() - 1 && ok; i >= 0; i--) { + for (int i = configs.size() - 1; i >= 0; i--) { for (int mut = 0; mut < mutuals.count(); mut++) { if (configs[i] == mutuals[mut].trimmed()) { cond = (configs[i] == args[0]); diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp index b66a35f294cd38e865ca2e41eaa673b0cd4bf09c..ad4e3ae71561844c66ae754cf62e80157c0d4bba 100644 --- a/src/tools/qtlibspatcher/qtlibspatchermain.cpp +++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp @@ -42,7 +42,7 @@ #include <QtCore/QDebug> #ifdef Q_OS_WIN -# define QT_INSTALL_DIR "C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.4.3"; +# define QT_INSTALL_DIR "C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.4.3/qt"; const char * const oldInstallBase = QT_INSTALL_DIR; const char * const oldSourceBase = QT_INSTALL_DIR; @@ -108,7 +108,8 @@ bool patchBinariesWithQtPathes(const char *baseQtPath) #ifdef Q_OS_WIN "/bin/qmake.exe", "/bin/QtCore4.dll", - "/bin/QtCored4.dll" + "/bin/QtCored4.dll", + "/lib/QtCored4.dll" #else "/bin/qmake", "/lib/libQtCore.so", @@ -136,7 +137,6 @@ char * allocFileNameCopyAppend(const char * textToCopy, Q_ASSERT(textToAppend != NULL); if (textToAppend2 == NULL) textToAppend2 = ""; - Q_ASSERT(textToAppend2 != NULL); char * const res = new char[bytesToAllocate]; const size_t textToCopyLen = strlen(textToCopy); @@ -153,7 +153,7 @@ char * allocFileNameCopyAppend(const char * textToCopy, if (textToAppendLen > 0) strncpy(res + textToCopyLen, textToAppend, bytesToAllocate - textToCopyLen - 1); if (textToAppend2Len > 0) - strncpy(res + textToCopyLen + textToAppend2Len, textToAppend2, bytesToAllocate - textToCopyLen - textToAppend2Len - 1); + strncpy(res + textToCopyLen + textToAppendLen, textToAppend2, bytesToAllocate - textToCopyLen - textToAppendLen - 1); res[textToCopyLen + textToAppendLen + textToAppend2Len] = '\0'; res[bytesToAllocate - 1] = '\0'; // Safe is safe return res; @@ -183,6 +183,19 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath) {"/bin/QtWebKitd4.dll", "/src/3rdparty/webkit/WebCore/"}, {"/bin/QtXmld4.dll", "/src/xml/"}, {"/bin/QtXmlPatternsd4.dll", "/src/xmlpatterns/"}, + {"/lib/Qt3Supportd4.dll", "/src/qt3support/"}, + {"/lib/QtCored4.dll", "/src/corelib/"}, + {"/lib/QtGuid4.dll", "/src/gui/"}, + {"/lib/QtHelpd4.dll", "/tools/assistant/lib/"}, + {"/lib/QtNetworkd4.dll", "/src/network/"}, + {"/lib/QtOpenGLd4.dll", "/src/opengl/"}, + {"/lib/QtScriptd4.dll", "/src/script/"}, + {"/lib/QtSqld4.dll", "/src/sql/"}, + {"/lib/QtSvgd4.dll", "/src/svg/"}, + {"/lib/QtTestd4.dll", "/src/testlib/"}, + {"/lib/QtWebKitd4.dll", "/src/3rdparty/webkit/WebCore/"}, + {"/lib/QtXmld4.dll", "/src/xml/"}, + {"/lib/QtXmlPatternsd4.dll", "/src/xmlpatterns/"}, {"/plugins/accessible/qtaccessiblecompatwidgetsd4.dll", "/src/plugins/accessible/compat/"}, {"/plugins/accessible/qtaccessiblewidgetsd4.dll", "/src/plugins/accessible/widgets/"}, {"/plugins/codecs/qcncodecsd4.dll", "/src/plugins/codecs/cn/"}, diff --git a/tests/auto/cplusplus/ast/ast.pro b/tests/auto/cplusplus/ast/ast.pro index 39fd14105de2e394305c223f6e76f6047eb139e0..84733f97e6f78c44972ef40bf488f2da594ce7fc 100644 --- a/tests/auto/cplusplus/ast/ast.pro +++ b/tests/auto/cplusplus/ast/ast.pro @@ -1,4 +1,5 @@ -load(qttest_p4) +TEMPLATE = app +CONFIG += qt warn_on console depend_includepath +QT = core testlib include(../shared/shared.pri) -QT = core SOURCES += tst_ast.cpp diff --git a/tests/auto/cplusplus/semantic/semantic.pro b/tests/auto/cplusplus/semantic/semantic.pro index 71a8b5fab5fdc5a2fb8b3d571b3a4a532b28f2dd..37c013685f73f42c40149e298869ce9563779e7b 100644 --- a/tests/auto/cplusplus/semantic/semantic.pro +++ b/tests/auto/cplusplus/semantic/semantic.pro @@ -1,5 +1,6 @@ -load(qttest_p4) +TEMPLATE = app +CONFIG += qt warn_on console depend_includepath +QT = core testlib include(../shared/shared.pri) -QT = core SOURCES += tst_semantic.cpp diff --git a/tests/auto/cplusplus/shared/shared.pri b/tests/auto/cplusplus/shared/shared.pri index 175dba7cfeae42b2bd4232d8c504e5adc26df386..924cda99911af638da1fddff3ca5219825940a06 100644 --- a/tests/auto/cplusplus/shared/shared.pri +++ b/tests/auto/cplusplus/shared/shared.pri @@ -1,5 +1,5 @@ DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE -INCLUDEPATH += $$PWD/../../../../shared/cplusplus +INCLUDEPATH += $$PWD/../../../../src/shared/cplusplus DEPENDPATH += $$INCLUDEPATH . LIBS += -L$$PWD -lCPlusPlusTestSupport diff --git a/tests/auto/cplusplus/shared/shared.pro b/tests/auto/cplusplus/shared/shared.pro index 94003e3447e5858930df128f9d7faa34cb1851d0..2f84af560bcdf0a8a2704b83a5a3cb19e0a4c7db 100644 --- a/tests/auto/cplusplus/shared/shared.pro +++ b/tests/auto/cplusplus/shared/shared.pro @@ -5,4 +5,4 @@ CONFIG += static QT = core DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE -include($$PWD/../../../../shared/cplusplus/cplusplus.pri) +include($$PWD/../../../../src/shared/cplusplus/cplusplus.pri)