diff --git a/qtcreator.pri b/qtcreator.pri index 2bf06ec61359012fb93be8f81264390f1f3295b5..cc09e235ec9f3031cac11c2e614d8052a7867e9b 100644 --- a/qtcreator.pri +++ b/qtcreator.pri @@ -149,7 +149,6 @@ win32-msvc* { qt { contains(QT, core): QT += concurrent contains(QT, gui): QT += widgets - DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900 } QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs) diff --git a/qtcreator.qbs b/qtcreator.qbs index 7993328ffae445d21c3d8ca234a6872145fd15f6..c0c6bfcea1f2c958c8b32e55cf12cbda57ff8f50 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -50,7 +50,6 @@ Project { property stringList generalDefines: [ "QT_CREATOR", 'IDE_LIBRARY_BASENAME="' + libDirName + '"', - "QT_DISABLE_DEPRECATED_BEFORE=0x040900", "QT_NO_CAST_TO_ASCII", "QT_NO_CAST_FROM_ASCII" ].concat(testsEnabled ? ["WITH_TESTS"] : []) diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri index 779202104939f4d09fff19b702e880613c958fb3..e27079ba1557c6bbe5c5c580a6a20dc201a4adbb 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri +++ b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pri @@ -21,6 +21,7 @@ include (../types/types.pri) SOURCES += $$PWD/qmlpuppetmain.cpp RESOURCES += $$PWD/../qmlpuppet.qrc DEFINES -= QT_NO_CAST_FROM_ASCII +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900 # For deprecated QWeakPointer use. unix:!macx:LIBS += -lrt # posix shared memory diff --git a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pro b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pro index 9427be64162b29fb50d2c7c9f24197f86561b960..ed04f683cb49b6bc2d8398831117ff0585502646 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pro +++ b/share/qtcreator/qml/qmlpuppet/qmlpuppet/qmlpuppet.pro @@ -7,8 +7,4 @@ build_all:!build_pass { CONFIG += release } -greaterThan(QT_MAJOR_VERSION, 4) { - DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900 -} - include(qmlpuppet.pri) diff --git a/src/app/main.cpp b/src/app/main.cpp index a0875845556e21e7099cef56c5a22dd0794c447f..73703551a44bf36845ed284c033481a3ec631d19 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -53,8 +53,8 @@ #include <QNetworkProxyFactory> #include <QApplication> -#include <QDesktopServices> #include <QMessageBox> +#include <QStandardPaths> #ifdef ENABLE_QT_BREAKPAD #include <qtsystemexceptionhandler.h> @@ -214,7 +214,8 @@ static inline QStringList getPluginPaths() // "%LOCALAPPDATA%\QtProject\qtcreator" on Windows Vista and later // "$XDG_DATA_HOME/data/QtProject/qtcreator" or "~/.local/share/data/QtProject/qtcreator" on Linux // "~/Library/Application Support/QtProject/Qt Creator" on Mac - pluginPath = QDesktopServices::storageLocation(QDesktopServices::DataLocation); + pluginPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + + QLatin1String("/data"); pluginPath += QLatin1Char('/') + QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR) + QLatin1Char('/'); @@ -297,11 +298,6 @@ int main(int argc, char **argv) setrlimit(RLIMIT_NOFILE, &rl); #endif -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) - // QML is unusable with the xlib backend - QApplication::setGraphicsSystem(QLatin1String("raster")); -#endif - SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv); const int threadCount = QThreadPool::globalInstance()->maxThreadCount(); diff --git a/src/libs/extensionsystem/pluginview.cpp b/src/libs/extensionsystem/pluginview.cpp index f2ef4744a423e5a0ce49ebd7405cd6687421178a..3a1578eedd9a47ac325de7d1f79c243863ca8c1a 100644 --- a/src/libs/extensionsystem/pluginview.cpp +++ b/src/libs/extensionsystem/pluginview.cpp @@ -101,8 +101,8 @@ PluginView::PluginView(QWidget *parent) gridLayout->addWidget(m_categoryWidget, 1, 0, 1, 1); QHeaderView *header = m_categoryWidget->header(); - header->setResizeMode(0, QHeaderView::ResizeToContents); - header->setResizeMode(2, QHeaderView::ResizeToContents); + header->setSectionResizeMode(0, QHeaderView::ResizeToContents); + header->setSectionResizeMode(2, QHeaderView::ResizeToContents); m_okIcon = QIcon(QLatin1String(":/extensionsystem/images/ok.png")); m_errorIcon = QIcon(QLatin1String(":/extensionsystem/images/error.png")); diff --git a/src/libs/ssh/sshkeycreationdialog.cpp b/src/libs/ssh/sshkeycreationdialog.cpp index 0c5d36252500164ff3e30de496fa4d7517e036b3..ce3dd6b23d3ca92a7f94e267962691898e0c72f6 100644 --- a/src/libs/ssh/sshkeycreationdialog.cpp +++ b/src/libs/ssh/sshkeycreationdialog.cpp @@ -36,8 +36,8 @@ #include <QFileDialog> #include <QFileInfo> #include <QApplication> -#include <QDesktopServices> #include <QMessageBox> +#include <QStandardPaths> namespace QSsh { @@ -51,7 +51,7 @@ SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent) #else m_ui->privateKeyFileButton->setText(tr("Browse...")); #endif - const QString defaultPath = QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + const QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QLatin1String("/.ssh/qtc_id"); setPrivateKeyFile(defaultPath); diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp index 088e5dc9aeb7fb2d6904b5212925fda7882b4ca1..922787508d11207d537f461c25b597e5fc850a40 100644 --- a/src/libs/utils/basetreeview.cpp +++ b/src/libs/utils/basetreeview.cpp @@ -247,7 +247,7 @@ BaseTreeView::BaseTreeView(QWidget *parent) QHeaderView *h = header(); h->setDefaultAlignment(Qt::AlignLeft); - h->setClickable(true); + h->setSectionsClickable(true); h->viewport()->installEventFilter(d); connect(this, SIGNAL(activated(QModelIndex)), diff --git a/src/libs/utils/environmentmodel.cpp b/src/libs/utils/environmentmodel.cpp index 6d00b6ce910da0a4c920cab0c6d649d2d9f72222..2edb4017f8050f55dfde2417471a19a7348c606e 100644 --- a/src/libs/utils/environmentmodel.cpp +++ b/src/libs/utils/environmentmodel.cpp @@ -32,7 +32,7 @@ #include <utils/environment.h> #include <utils/hostosinfo.h> -#include <QTextDocument> // Qt::escape() in Qt 4 +#include <QString> #include <QFont> namespace Utils { @@ -151,7 +151,7 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const QString value = d->m_resultEnvironment.value(d->m_resultEnvironment.constBegin() + index.row()); if (role == Qt::ToolTipRole && value.length() > 80) { // Use html to enable text wrapping - value = Qt::escape(value); + value = value.toHtmlEscaped(); value.prepend(QLatin1String("<html><body>")); value.append(QLatin1String("</body></html>")); } diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index bc9ced6c31a97a638d4946b84217acc8d1a8eeb5..4ced23e6ac87ed0ad886d6898c092c8d8257ba7f 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -42,16 +42,14 @@ static inline QString msgCanceled(const QString &searchTerm, int numMatches, int { return QCoreApplication::translate("Utils::FileSearch", "%1: canceled. %n occurrences found in %2 files.", - 0, QCoreApplication::CodecForTr, numMatches). - arg(searchTerm).arg(numFilesSearched); + 0, numMatches).arg(searchTerm).arg(numFilesSearched); } static inline QString msgFound(const QString &searchTerm, int numMatches, int numFilesSearched) { return QCoreApplication::translate("Utils::FileSearch", "%1: %n occurrences found in %2 files.", - 0, QCoreApplication::CodecForTr, numMatches). - arg(searchTerm).arg(numFilesSearched); + 0, numMatches).arg(searchTerm).arg(numFilesSearched); } namespace { diff --git a/src/libs/utils/headerviewstretcher.cpp b/src/libs/utils/headerviewstretcher.cpp index 712949804175d624c13b3ab29be01039b95f22f5..e659ca6b98450c2aea41165fbb831da3fd7ed44b 100644 --- a/src/libs/utils/headerviewstretcher.cpp +++ b/src/libs/utils/headerviewstretcher.cpp @@ -58,14 +58,15 @@ bool HeaderViewStretcher::eventFilter(QObject *obj, QEvent *ev) if (ev->type() == QEvent::Show) { QHeaderView *hv = qobject_cast<QHeaderView*>(obj); for (int i = 0; i < hv->count(); ++i) - hv->setResizeMode(i, QHeaderView::Interactive); + hv->setSectionResizeMode(i, QHeaderView::Interactive); } else if (ev->type() == QEvent::Hide) { QHeaderView *hv = qobject_cast<QHeaderView*>(obj); for (int i = 0; i < hv->count(); ++i) - hv->setResizeMode(i, i == m_columnToStretch ? QHeaderView::Stretch : QHeaderView::ResizeToContents); + hv->setSectionResizeMode(i, i == m_columnToStretch + ? QHeaderView::Stretch : QHeaderView::ResizeToContents); } else if (ev->type() == QEvent::Resize) { QHeaderView *hv = qobject_cast<QHeaderView*>(obj); - if (hv->resizeMode(m_columnToStretch) == QHeaderView::Interactive) { + if (hv->sectionResizeMode(m_columnToStretch) == QHeaderView::Interactive) { QResizeEvent *re = static_cast<QResizeEvent*>(ev); int diff = re->size().width() - re->oldSize().width() ; hv->resizeSection(m_columnToStretch, qMax(32, hv->sectionSize(m_columnToStretch) + diff)); diff --git a/src/libs/utils/navigationtreeview.cpp b/src/libs/utils/navigationtreeview.cpp index 5c91f80486d402cd98b5f3023fdfcdb65699a959..0eb85d51dfea8fd4a4567875eafe0f247a30f1d6 100644 --- a/src/libs/utils/navigationtreeview.cpp +++ b/src/libs/utils/navigationtreeview.cpp @@ -60,7 +60,7 @@ NavigationTreeView::NavigationTreeView(QWidget *parent) setHeaderHidden(true); // We let the column adjust to contents, but note // the setting of a minimum size in resizeEvent() - header()->setResizeMode(QHeaderView::ResizeToContents); + header()->setSectionResizeMode(QHeaderView::ResizeToContents); header()->setStretchLastSection(false); } diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 5966dac7e2e4b6a62030aa5f8461e5d2676aa5bd..61c79673b0ddbc0ef1e008bdf5b21c205ff788f6 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -37,10 +37,10 @@ #include "hostosinfo.h" #include <QDebug> -#include <QDesktopServices> #include <QFileDialog> #include <QHBoxLayout> #include <QPushButton> +#include <QStandardPaths> /*! \class Utils::PathChooser @@ -594,7 +594,7 @@ QString PathChooser::homePath() // does not let people actually display the contents of their home // directory. Alternatively, create a QtCreator-specific directory? if (HostOsInfo::isWindowsHost()) - return QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); + return QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); return QDir::homePath(); } diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index d50f91006de4e85f2b59975ca3712c5a412d07e2..6ae985ffe00c50171632924fd36b6662f2332e17 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -169,8 +169,8 @@ AndroidSettingsWidget::AndroidSettingsWidget(QWidget *parent) m_ui->CreateKitCheckBox->setChecked(m_androidConfig.automaticKitCreation()); m_ui->AVDTableView->setModel(&m_AVDModel); m_AVDModel.setAvdList(m_androidConfig.androidVirtualDevices()); - m_ui->AVDTableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch); - m_ui->AVDTableView->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents); + m_ui->AVDTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + m_ui->AVDTableView->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents); m_ui->downloadAntToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost()); m_ui->downloadOpenJDKToolButton->setVisible(!Utils::HostOsInfo::isLinuxHost()); diff --git a/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp b/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp index 619e37868de71097849d2002d891802cb14c7312..875f19df2f00e5203e16fdedf94e50f9900f8af0 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp @@ -207,7 +207,7 @@ void ArtisticStyleSettings::createDocumentationFile() const const QString text = QLatin1String("<p><span class=\"option\">") + keys.filter(QRegExp(QLatin1String("^\\-"))).join(QLatin1String(", ")) + QLatin1String("</span></p><p>") - + Qt::escape(docu.join(QLatin1Char(' '))) + + (docu.join(QLatin1Char(' ')).toHtmlEscaped()) + QLatin1String("</p>"); stream.writeTextElement(QLatin1String(Constants::DOCUMENTATION_XMLDOC), text); stream.writeEndElement(); diff --git a/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp b/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp index c1453519ae3fba804dbc71fc2f8197961132e2c9..b41e2ebafcc9cccdf34dd56475061b8f588f9f7f 100644 --- a/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp @@ -153,7 +153,7 @@ void UncrustifySettings::createDocumentationFile() const const QString text = QLatin1String("<p><span class=\"option\">") + keyword + QLatin1String("</span> <span class=\"param\">") + options + QLatin1String("</span></p><p>") - + Qt::escape(docu.join(QLatin1Char(' '))) + + (docu.join(QLatin1Char(' ')).toHtmlEscaped()) + QLatin1String("</p>"); stream.writeStartElement(QLatin1String(Constants::DOCUMENTATION_XMLENTRY)); stream.writeTextElement(QLatin1String(Constants::DOCUMENTATION_XMLKEY), keyword); diff --git a/src/plugins/clangcodemodel/clangcompletion.cpp b/src/plugins/clangcodemodel/clangcompletion.cpp index 412b7f2ee890aac32858010c8d8c5ed308c7bdf6..96d2da62c2877baf3134299320df2f7ac4fc690e 100644 --- a/src/plugins/clangcodemodel/clangcompletion.cpp +++ b/src/plugins/clangcodemodel/clangcompletion.cpp @@ -311,11 +311,11 @@ QString ClangFunctionHintModel::text(int index) const const int end = overview.markedArgumentEnd(); QString hintText; - hintText += Qt::escape(prettyMethod.left(begin)); + hintText += prettyMethod.left(begin).toHtmlEscaped()); hintText += "<b>"; - hintText += Qt::escape(prettyMethod.mid(begin, end - begin)); + hintText += prettyMethod.mid(begin, end - begin).toHtmlEscaped()); hintText += "</b>"; - hintText += Qt::escape(prettyMethod.mid(end)); + hintText += prettyMethod.mid(end).toHtmlEscaped()); return hintText; #endif return m_functionSymbols.at(index).hint(); diff --git a/src/plugins/clangcodemodel/completionproposalsbuilder.cpp b/src/plugins/clangcodemodel/completionproposalsbuilder.cpp index ac388f032724b76aec887fa9732aff5ec0bc5285..021e1b1c1a01f3fbe071a255af72b33570a635d4 100644 --- a/src/plugins/clangcodemodel/completionproposalsbuilder.cpp +++ b/src/plugins/clangcodemodel/completionproposalsbuilder.cpp @@ -91,7 +91,7 @@ void CompletionProposalsBuilder::operator ()(const CXCompletionResult &cxResult) #if defined(CINDEX_VERSION) && (CINDEX_VERSION > 5) const QString brief = Internal::getQString(clang_getCompletionBriefComment(cxResult.CompletionString)); if (!brief.isEmpty()) - m_comment += QLatin1String("<b>Brief:</b> ") + Qt::escape(brief); + m_comment += (QLatin1String("<b>Brief:</b> ") + brief).toHtmlEscaped(); #endif if (m_resultAvailability == CodeCompletionResult::Deprecated) { @@ -384,12 +384,12 @@ void CompletionProposalsBuilder::concatChunksForObjectiveCMessage(const CXComple const QString text = Internal::getQString(clang_getCompletionChunkText(cxString, index), false); if (chunkKind == CXCompletionChunk_ResultType) { hintPrefix += QLatin1String("("); - hintPrefix += Qt::escape(text); + hintPrefix += text.toHtmlEscaped(); hintPrefix += QLatin1String(") "); indentBonus += 3 + text.length(); addSpaceAtPrefixEnd = false; } else { - hintPrefix += Qt::escape(text); + hintPrefix += text.toHtmlEscaped(); indentBonus += text.length(); m_snippet += text; } @@ -426,12 +426,12 @@ void CompletionProposalsBuilder::concatChunksForObjectiveCMessage(const CXComple case CXCompletionChunk_Comma: case CXCompletionChunk_HorizontalSpace: m_snippet += text; - parts.back().text += Qt::escape(text); + parts.back().text += text.toHtmlEscaped(); break; case CXCompletionChunk_Placeholder: appendSnippet(text); parts.back().text += QLatin1String("<b>"); - parts.back().text += Qt::escape(text); + parts.back().text += text.toHtmlEscaped(); parts.back().text += QLatin1String("</b>"); break; case CXCompletionChunk_LeftAngle: @@ -487,7 +487,7 @@ void CompletionProposalsBuilder::concatChunksForNestedName(const CXCompletionStr case CXCompletionChunk_Comma: case CXCompletionChunk_HorizontalSpace: m_snippet += text; - m_hint += Qt::escape(text); + m_hint += text.toHtmlEscaped(); break; case CXCompletionChunk_Placeholder: @@ -575,7 +575,7 @@ void CompletionProposalsBuilder::concatChunksOnlyTypedText(const CXCompletionStr case CXCompletionChunk_Text: case CXCompletionChunk_LeftAngle: case CXCompletionChunk_RightAngle: - m_hint += Qt::escape(text); + m_hint += text.toHtmlEscaped(); break; case CXCompletionChunk_HorizontalSpace: @@ -583,14 +583,14 @@ void CompletionProposalsBuilder::concatChunksOnlyTypedText(const CXCompletionStr if (isInsideTemplateSpec) { m_snippet += text; } - m_hint += Qt::escape(text); + m_hint += text.toHtmlEscaped(); break; case CXCompletionChunk_Placeholder: if (isInsideTemplateSpec) { appendSnippet(text); } - m_hint += Qt::escape(text); + m_hint += text.toHtmlEscaped(); break; case CXCompletionChunk_TypedText: @@ -599,7 +599,7 @@ void CompletionProposalsBuilder::concatChunksOnlyTypedText(const CXCompletionStr break; case CXCompletionChunk_ResultType: { - m_hint += Qt::escape(text); + m_hint += text.toHtmlEscaped(); QChar last = text[text.size() - 1]; if (last != QLatin1Char('*') && last != QLatin1Char('&')) m_hint += QLatin1Char(' '); @@ -698,7 +698,7 @@ void CompletionProposalsBuilder::appendOptionalChunks(const CXCompletionString & switch (chunkKind) { case CXCompletionChunk_Placeholder: - chunk.hint += Qt::escape(text); + chunk.hint += text.toHtmlEscaped(); break; case CXCompletionChunk_Comma: @@ -742,7 +742,7 @@ void CompletionProposalsBuilder::appendSnippet(const QString &text) void CompletionProposalsBuilder::appendHintBold(const QString &text) { m_hint += QLatin1String("<b>"); - m_hint += Qt::escape(text); + m_hint += text.toHtmlEscaped(); m_hint += QLatin1String("</b>"); } diff --git a/src/plugins/clangcodemodel/test/clangcompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcompletion_test.cpp index e5c1c3aec1f70ecc3b12e0cbc61a919f28fe536a..86fb51ef23e4f7e771b1d4776ff3285819caafd9 100644 --- a/src/plugins/clangcodemodel/test/clangcompletion_test.cpp +++ b/src/plugins/clangcodemodel/test/clangcompletion_test.cpp @@ -187,10 +187,10 @@ void ClangCodeModelPlugin::test_CXX_snippets() if (ccr.text() != text) continue; hasText = true; - QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toAscii()); + QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toLatin1()); } const QString textError(QLatin1String("Text not found:") + text); - QVERIFY2(hasText, textError.toAscii()); + QVERIFY2(hasText, textError.toLatin1()); } } @@ -298,12 +298,12 @@ void ClangCodeModelPlugin::test_ObjC_hints() if (ccr.text() != text) continue; hasText = true; - QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toAscii()); - QVERIFY2(hint == ccr.hint(), hintError.arg(ccr.hint()).toAscii()); + QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toLatin1()); + QVERIFY2(hint == ccr.hint(), hintError.arg(ccr.hint()).toLatin1()); } const QString textError(QString::fromLatin1("Text \"%1\" not found in set %2") .arg(text).arg(texts.join(QLatin1Char(',')))); - QVERIFY2(hasText, textError.toAscii()); + QVERIFY2(hasText, textError.toLatin1()); } } diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 2f55486c5ee96358d75f6d28d7ce8babe3db4c99..2550efee882ef28dad1773c51b95dc419ed40bf6 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -209,7 +209,7 @@ void CMakeTool::parseFunctionOutput(const QByteArray &output) QString CMakeTool::formatFunctionDetails(const QString &command, const QString &args) { return QString::fromLatin1("<table><tr><td><b>%1</b></td><td>%2</td></tr>") - .arg(Qt::escape(command)).arg(Qt::escape(args)); + .arg(command.toHtmlEscaped(), args.toHtmlEscaped()); } void CMakeTool::parseFunctionDetailsOutput(const QByteArray &output) @@ -250,7 +250,7 @@ void CMakeTool::parseFunctionDetailsOutput(const QByteArray &output) } else { extractKeywords(lineTrimmed, &m_variables); currentCommandSyntax += QString::fromLatin1("<tr><td> </td><td>%1</td></tr>") - .arg(Qt::escape(QString::fromLocal8Bit(lineTrimmed))); + .arg(QString::fromLocal8Bit(lineTrimmed).toHtmlEscaped()); } } } diff --git a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp index fa3353159d3eb398ddbc4f034bd45715a636c109..1077e4b5b3161da392d5461472a343dd78e3f13c 100644 --- a/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp +++ b/src/plugins/coreplugin/dialogs/externaltoolconfig.cpp @@ -57,7 +57,6 @@ static const Qt::ItemFlags TOOL_ITEM_FLAGS = Qt::ItemIsSelectable | Qt::ItemIsEn ExternalToolModel::ExternalToolModel(QObject *parent) : QAbstractItemModel(parent) { - setSupportedDragActions(Qt::MoveAction); } ExternalToolModel::~ExternalToolModel() diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp index d683fde5a5f0f5873ed031464540a15d1fba3ae1..7c77dcf37c7c3797385bdcf78044cae368c79adf 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp @@ -103,8 +103,8 @@ OpenEditorsWidget::OpenEditorsWidget() setSelectionBehavior(QAbstractItemView::SelectRows); setActivationMode(Utils::SingleClickActivation); header()->setStretchLastSection(false); - header()->setResizeMode(0, QHeaderView::Stretch); - header()->setResizeMode(1, QHeaderView::Fixed); + header()->setSectionResizeMode(0, QHeaderView::Stretch); + header()->setSectionResizeMode(1, QHeaderView::Fixed); header()->resizeSection(1, 16); setContextMenuPolicy(Qt::CustomContextMenu); installEventFilter(this); diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp index 5aa9ca232f73f632c8c0e45bbac76d84f563f173..b9c68433f5a25e29f1a794d99dfa1da716935610 100644 --- a/src/plugins/coreplugin/externaltool.cpp +++ b/src/plugins/coreplugin/externaltool.cpp @@ -316,7 +316,7 @@ static void localizedText(const QStringList &locales, QXmlStreamReader *reader, if (*currentLocale < 0 && currentText->isEmpty()) { *currentText = QCoreApplication::translate("Core::Internal::ExternalTool", reader->readElementText().toUtf8().constData(), - "", QCoreApplication::UnicodeUTF8); + ""); } else { reader->skipCurrentElement(); } diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 161819f4ad85ef849cea22a8207b94193cceb4c9..326c6af0776c461ffe0c3de613c405a32548f2a3 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -198,7 +198,7 @@ CompletionList::CompletionList(QWidget *parent) header()->hide(); header()->setStretchLastSection(true); // This is too slow when done on all results - //header()->setResizeMode(QHeaderView::ResizeToContents); + //header()->setSectionResizeMode(QHeaderView::ResizeToContents); setWindowFlags(Qt::ToolTip); if (Utils::HostOsInfo::isMacHost()) { if (horizontalScrollBar()) diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp index c65f8e5387a4ec0c7cd75f2546e9250c257258d8..d53bb0417999839bdfbe371f6f8d759a89d8d3e8 100644 --- a/src/plugins/cppeditor/cpphoverhandler.cpp +++ b/src/plugins/cppeditor/cpphoverhandler.cpp @@ -99,7 +99,7 @@ void CppHoverHandler::identifyMatch(TextEditor::BaseTextEditor *editor, int pos) void CppHoverHandler::decorateToolTip() { if (Qt::mightBeRichText(toolTip())) - setToolTip(Qt::escape(toolTip())); + setToolTip(toolTip().toHtmlEscaped()); if (isDiagnosticTooltip()) return; diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index 6f1001e19141f89f55c47592a177eb485ba2804c..a0a2e2b055644ec1f3e34cb5d24919c552d8b88f 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -375,11 +375,11 @@ QString CppFunctionHintModel::text(int index) const const int end = overview.markedArgumentEnd; QString hintText; - hintText += Qt::escape(prettyMethod.left(begin)); + hintText += prettyMethod.left(begin).toHtmlEscaped(); hintText += QLatin1String("<b>"); - hintText += Qt::escape(prettyMethod.mid(begin, end - begin)); + hintText += prettyMethod.mid(begin, end - begin).toHtmlEscaped(); hintText += QLatin1String("</b>"); - hintText += Qt::escape(prettyMethod.mid(end)); + hintText += prettyMethod.mid(end).toHtmlEscaped(); return hintText; } diff --git a/src/plugins/debugger/debuggeroptionspage.cpp b/src/plugins/debugger/debuggeroptionspage.cpp index e7cb80c7c4b50f2cf409f9525e96d9eeaf77a8dd..4215620a0603cae0057c3d6d229fce0bda4ccbb9 100644 --- a/src/plugins/debugger/debuggeroptionspage.cpp +++ b/src/plugins/debugger/debuggeroptionspage.cpp @@ -249,9 +249,9 @@ QWidget *DebuggerOptionsPage::widget() QHeaderView *header = m_debuggerView->header(); header->setStretchLastSection(false); - header->setResizeMode(0, QHeaderView::ResizeToContents); - header->setResizeMode(1, QHeaderView::ResizeToContents); - header->setResizeMode(2, QHeaderView::Stretch); + header->setSectionResizeMode(0, QHeaderView::ResizeToContents); + header->setSectionResizeMode(1, QHeaderView::ResizeToContents); + header->setSectionResizeMode(2, QHeaderView::Stretch); QVBoxLayout *buttonLayout = new QVBoxLayout(); buttonLayout->setSpacing(6); diff --git a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp index 6780d80e19fcad35d64022b86545f1f2d1cd04ad..2a05fa7994a6f9c56a11002f75b872e3a23407e6 100644 --- a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp +++ b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp @@ -444,9 +444,9 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data) QString msg = stackFrames.isEmpty() ? tr("<p>An uncaught exception occurred:</p><p>%1</p>") - .arg(Qt::escape(error)) + .arg(error.toHtmlEscaped()) : tr("<p>An uncaught exception occurred in \"%1\":</p><p>%2</p>") - .arg(QLatin1String(stackFrames.value(0).fileUrl), Qt::escape(error)); + .arg(QLatin1String(stackFrames.value(0).fileUrl), error.toHtmlEscaped()); showMessageBox(QMessageBox::Information, tr("Uncaught Exception"), msg); } else { QString file; diff --git a/src/plugins/debugger/sourcefileshandler.cpp b/src/plugins/debugger/sourcefileshandler.cpp index 7fd5ea60e84b3b53445a3d81b2f07423c9af06d9..9e7029b77aaf2cbaf61cb141d95b6cea00340367 100644 --- a/src/plugins/debugger/sourcefileshandler.cpp +++ b/src/plugins/debugger/sourcefileshandler.cpp @@ -118,7 +118,7 @@ void SourceFilesHandler::setSourceFiles(const QMap<QString, QString> &sourceFile void SourceFilesHandler::removeAll() { setSourceFiles(QMap<QString, QString>()); - //header()->setResizeMode(0, QHeaderView::ResizeToContents); + //header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); } } // namespace Internal diff --git a/src/plugins/debugger/watchdata.cpp b/src/plugins/debugger/watchdata.cpp index dc6ccfdb36e387dbf900e17c1fb5394192fd8845..dd4921e7d0f57bb4f69b9ea87d8d221eb659097d 100644 --- a/src/plugins/debugger/watchdata.cpp +++ b/src/plugins/debugger/watchdata.cpp @@ -341,36 +341,11 @@ QString WatchData::toString() const return res + QLatin1Char('}'); } -static QString htmlEscape(const QString &plain) -{ -#if QT_VERSION >= 0x050000 - return Qt::escape(plain); -#else - // Copied from Qt to avoid GUI dependency - // (Qt::escape has been moved in Qt 5) - QString rich; - rich.reserve(int(plain.length() * qreal(1.1))); - for (int i = 0; i < plain.length(); ++i) { - if (plain.at(i) == QLatin1Char('<')) - rich += QLatin1String("<"); - else if (plain.at(i) == QLatin1Char('>')) - rich += QLatin1String(">"); - else if (plain.at(i) == QLatin1Char('&')) - rich += QLatin1String("&"); - else if (plain.at(i) == QLatin1Char('"')) - rich += QLatin1String("""); - else - rich += plain.at(i); - } - return rich; -#endif -} - // Format a tooltip fow with aligned colon. static void formatToolTipRow(QTextStream &str, const QString &category, const QString &value) { - QString val = htmlEscape(value); + QString val = value.toHtmlEscaped(); val.replace(QLatin1Char('\n'), QLatin1String("<br>")); str << "<tr><td>" << category << "</td><td> : </td><td>" << val << "</td></tr>"; diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index f2478d036f4752a33177ecd577c9ba6f35ce3d8a..4c83d5a077148baec281482d72cdf726029528df 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -51,6 +51,7 @@ #include <QTabWidget> #include <QTextEdit> +#include <cstring> #include <ctype.h> //#define USE_WATCH_MODEL_TEST 0 @@ -1845,7 +1846,7 @@ void WatchHandler::showEditValue(const WatchData &data) QTC_ASSERT(0 < nbytes && nbytes < 10000 * 10000, return); QTC_ASSERT(0 < format && format < 32, return); QImage im(width, height, QImage::Format(format)); - qMemCopy(im.bits(), bits, nbytes); + std::memcpy(im.bits(), bits, nbytes); const QString title = data.address ? tr("%1 Object at %2").arg(QLatin1String(data.type), QLatin1String(data.hexAddress())) : diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index c39a4587f81acffe40ba93e526885fda337fb6fb..0ef2b92feb450c9e5b4dc6fe96fa8bde99d1da5e 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -97,10 +97,10 @@ #include <QStackedWidget> #include <QTextStream> -#include <QDesktopServices> #include <QItemDelegate> #include <QPlainTextEdit> #include <QShortcut> +#include <QStandardPaths> #include <QTextBlock> #include <QTextCursor> #include <QTextEdit> @@ -1379,7 +1379,7 @@ void FakeVimPluginPrivate::maybeReadVimRc() return; QString fileName = theFakeVimSetting(ConfigVimRcPath)->value().toString(); if (fileName.isEmpty()) { - fileName = QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + fileName = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + (Utils::HostOsInfo::isWindowsHost() ? _("/_vimrc") : _("/.vimrc")); } //qDebug() << "READING VIMRC: " << fileName; diff --git a/src/plugins/git/gitorious/gitorious.cpp b/src/plugins/git/gitorious/gitorious.cpp index adb688c14c1e49dec73903279065156cc07c00c7..4c010698b3777601940bd71e99f1cc18187ab57b 100644 --- a/src/plugins/git/gitorious/gitorious.cpp +++ b/src/plugins/git/gitorious/gitorious.cpp @@ -34,6 +34,7 @@ #include <QSettings> #include <QNetworkReply> +#include <QUrlQuery> #include <utils/qtcassert.h> #include <utils/networkaccessmanager.h> @@ -544,9 +545,11 @@ void Gitorious::updateProjectList(int hostIndex) void Gitorious::startProjectsRequest(int hostIndex, int page) { QUrl url = httpRequest(hostName(hostIndex), QLatin1String("projects")); - url.addQueryItem(QLatin1String("format"), QLatin1String("xml")); + QUrlQuery query; + query.addQueryItem(QLatin1String("format"), QLatin1String("xml")); if (page >= 0) - url.addQueryItem(QLatin1String("page"), QString::number(page)); + query.addQueryItem(QLatin1String("page"), QString::number(page)); + url.setQuery(query); createRequest(url, ListProjectsProtocol, hostIndex, page); } diff --git a/src/plugins/glsleditor/glslhoverhandler.cpp b/src/plugins/glsleditor/glslhoverhandler.cpp index ef2232fa3cee6b5e3fca0a7b86483acd5b9c729c..1c60ce07c9b737eb7538f994ebb1379908e99331 100644 --- a/src/plugins/glsleditor/glslhoverhandler.cpp +++ b/src/plugins/glsleditor/glslhoverhandler.cpp @@ -62,7 +62,7 @@ void GlslHoverHandler::identifyMatch(TextEditor::BaseTextEditor *editor, int pos void GlslHoverHandler::decorateToolTip() { if (Qt::mightBeRichText(toolTip())) - setToolTip(Qt::escape(toolTip())); + setToolTip(toolTip().toHtmlEscaped()); } } // namespace Internal diff --git a/src/plugins/help/openpageswidget.cpp b/src/plugins/help/openpageswidget.cpp index a73c48e1ba472f3837c71f0675fbca1a3683e82e..0f9a2a0517a25ce0401b56424f337764b451ef0f 100644 --- a/src/plugins/help/openpageswidget.cpp +++ b/src/plugins/help/openpageswidget.cpp @@ -98,8 +98,8 @@ OpenPagesWidget::OpenPagesWidget(OpenPagesModel *model, QWidget *parent) header()->hide(); header()->setStretchLastSection(false); - header()->setResizeMode(0, QHeaderView::Stretch); - header()->setResizeMode(1, QHeaderView::Fixed); + header()->setSectionResizeMode(0, QHeaderView::Stretch); + header()->setSectionResizeMode(1, QHeaderView::Fixed); header()->resizeSection(1, 18); installEventFilter(this); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 142974335d57d29986e70098782949f5fcdb971d..53c1485ddff9d40e204fdf81b351e5d0e86451a5 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -36,7 +36,7 @@ #include <utils/qtcassert.h> #include <QCoreApplication> -#include <QDesktopServices> +#include <QStandardPaths> #include <QString> #include <QUuid> @@ -417,7 +417,7 @@ int IDevice::version() const QString IDevice::defaultPrivateKeyFilePath() { - return QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + return QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QLatin1String("/.ssh/id_rsa"); } diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 0ea12983d30292b2ecc27b8d373a06eace9d8e2b..799f729063a979a79cd3ec967ab6d2d1f18d2777 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -205,9 +205,9 @@ void EnvironmentWidget::updateSummaryText() if (item.name != Utils::EnvironmentModel::tr("<VARIABLE>")) { text.append(QLatin1String("<br>")); if (item.unset) - text.append(tr("Unset <a href=\"%1\"><b>%1</b></a>").arg(Qt::escape(item.name))); + text.append(tr("Unset <a href=\"%1\"><b>%1</b></a>").arg(item.name.toHtmlEscaped())); else - text.append(tr("Set <a href=\"%1\"><b>%1</b></a> to <b>%2</b>").arg(Qt::escape(item.name), Qt::escape(item.value))); + text.append(tr("Set <a href=\"%1\"><b>%1</b></a> to <b>%2</b>").arg(item.name.toHtmlEscaped(), item.value.toHtmlEscaped())); } } diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index c130107280d70effb21a65893e3ebb11da1efd70..75975b7a36486a71d18ed5e679143ee9ac789745 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -442,7 +442,7 @@ ToolChain::CompilerFlags GccToolChain::compilerFlags(const QStringList &cxxflags const QStringList allCxxflags = m_platformCodeGenFlags + cxxflags; // add only cxxflags is empty? foreach (const QString &flag, allCxxflags) { if (flag.startsWith(QLatin1String("-std="))) { - const QByteArray std = flag.mid(5).toAscii(); + const QByteArray std = flag.mid(5).toLatin1(); if (std == "c++98" || std == "c++03") { flags &= ~CompilerFlags(StandardCxx11 | GnuExtensions); } else if (std == "gnu++98" || std == "gnu++03") { diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp index 4e81d40ca8136f40364ebf06c68748a377e9712a..3f96f43a55cfda9e6744a3fbf987e7f4320cb91c 100644 --- a/src/plugins/projectexplorer/kitoptionspage.cpp +++ b/src/plugins/projectexplorer/kitoptionspage.cpp @@ -97,7 +97,7 @@ QWidget *KitOptionsPage::widget() verticalLayout->setStretch(1, 0); m_kitsView->setModel(m_model); - m_kitsView->header()->setResizeMode(0, QHeaderView::Stretch); + m_kitsView->header()->setSectionResizeMode(0, QHeaderView::Stretch); m_kitsView->expandAll(); m_selectionModel = m_kitsView->selectionModel(); diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index 7bb245deeae1011bb25a6b8b08489e4367d449c1..c7185461dfd57a35313044bd6a10ec10a4e63405 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -50,14 +50,6 @@ namespace Internal { SessionModel::SessionModel(QObject *parent) : QAbstractListModel(parent) { - QHash<int, QByteArray> roleNames; - roleNames[Qt::DisplayRole] = "sessionName"; - roleNames[DefaultSessionRole] = "defaultSession"; - roleNames[ActiveSessionRole] = "activeSession"; - roleNames[LastSessionRole] = "lastSession"; - roleNames[ProjectsPathRole] = "projectsPath"; - roleNames[ProjectsDisplayRole] = "projectsName"; - setRoleNames(roleNames); connect(SessionManager::instance(), SIGNAL(sessionLoaded(QString)), SLOT(resetSessions())); } @@ -103,6 +95,18 @@ QVariant SessionModel::data(const QModelIndex &index, int role) const return QVariant(); } +QHash<int, QByteArray> SessionModel::roleNames() const +{ + QHash<int, QByteArray> roleNames; + roleNames[Qt::DisplayRole] = "sessionName"; + roleNames[DefaultSessionRole] = "defaultSession"; + roleNames[ActiveSessionRole] = "activeSession"; + roleNames[LastSessionRole] = "lastSession"; + roleNames[ProjectsPathRole] = "projectsPath"; + roleNames[ProjectsDisplayRole] = "projectsName"; + return roleNames; +} + bool SessionModel::isDefaultVirgin() const { return SessionManager::isDefaultVirgin(); @@ -164,11 +168,6 @@ void SessionModel::renameSession(const QString &session) ProjectModel::ProjectModel(ProjectExplorerPlugin *plugin, QObject *parent) : QAbstractListModel(parent), m_plugin(plugin) { - QHash<int, QByteArray> roleNames; - roleNames[Qt::DisplayRole] = "displayName"; - roleNames[FilePathRole] = "filePath"; - roleNames[PrettyFilePathRole] = "prettyFilePath"; - setRoleNames(roleNames); connect(plugin, SIGNAL(recentProjectsChanged()), SLOT(resetProjects())); } @@ -195,6 +194,15 @@ QVariant ProjectModel::data(const QModelIndex &index, int role) const return QVariant(); } +QHash<int, QByteArray> ProjectModel::roleNames() const +{ + QHash<int, QByteArray> roleNames; + roleNames[Qt::DisplayRole] = "displayName"; + roleNames[FilePathRole] = "filePath"; + roleNames[PrettyFilePathRole] = "prettyFilePath"; + return roleNames; +} + void ProjectModel::resetProjects() { beginResetModel(); diff --git a/src/plugins/projectexplorer/projectwelcomepage.h b/src/plugins/projectexplorer/projectwelcomepage.h index 0d332f084f30c9ae44cc11e76dd9c688e5dd1f61..51afdbfbcf89ed274c2fe8517e82ed515ee20f0f 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.h +++ b/src/plugins/projectexplorer/projectwelcomepage.h @@ -53,6 +53,7 @@ public: explicit SessionModel(QObject *parent = 0); int rowCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; + QHash<int, QByteArray> roleNames() const; Q_SCRIPTABLE bool isDefaultVirgin() const; @@ -73,6 +74,7 @@ public: ProjectModel(ProjectExplorerPlugin* plugin, QObject* parent = 0); int rowCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; + QHash<int, QByteArray> roleNames() const; public slots: void resetProjects(); diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp index c2f3ca8ee4d01bc903cf5e9637a45a72fc6ad702..4ddd1f4f4f39aaca1653938d16036a65590b1cbe 100644 --- a/src/plugins/projectexplorer/toolchainoptionspage.cpp +++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp @@ -487,8 +487,8 @@ QWidget *ToolChainOptionsPage::widget() connect(m_model, SIGNAL(toolChainStateChanged()), this, SLOT(updateState())); m_toolChainView->setModel(m_model); - m_toolChainView->header()->setResizeMode(0, QHeaderView::ResizeToContents); - m_toolChainView->header()->setResizeMode(1, QHeaderView::Stretch); + m_toolChainView->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); + m_toolChainView->header()->setSectionResizeMode(1, QHeaderView::Stretch); m_toolChainView->expandAll(); m_selectionModel = m_toolChainView->selectionModel(); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp index bc6bf2368269f5fb92c2975e77bfc8e162c4ceaa..43bab012d53704ad9153ba1b7e419898f0e21492 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp @@ -103,6 +103,11 @@ QVariant ItemLibraryModel::data(const QModelIndex &index, int role) const return QVariant(); } +QHash<int, QByteArray> ItemLibraryModel::roleNames() const +{ + return m_roleNames; +} + QString ItemLibraryModel::searchText() const { return m_searchText; @@ -242,8 +247,6 @@ void ItemLibraryModel::addRoleNames() m_roleNames.insert(role, property.name()); ++role; } - - setRoleNames(m_roleNames); } void ItemLibraryModel::resetModel() diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h index 063f70b95ace26682d4f631d2afcd4274aee4f2a..451872a57f8e1d9e32fb84b9245c1841068d1081 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h @@ -55,6 +55,7 @@ public: int rowCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QHash<int, QByteArray> roleNames() const; QString searchText() const; diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.cpp index 430bf69d8eb680ab9fc50d5ef3d36a9a4f052bcf..10c818656814fc8be144ec5c5a2fec7df290a9c5 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.cpp @@ -70,6 +70,11 @@ QVariant ItemLibrarySectionModel::data(const QModelIndex &index, int role) const return QVariant(); } +QHash<int, QByteArray> ItemLibrarySectionModel::roleNames() const +{ + return m_roleNames; +} + void ItemLibrarySectionModel::clearItems() { beginResetModel(); @@ -111,8 +116,6 @@ void ItemLibrarySectionModel::addRoleNames() m_roleNames.insert(role, property.name()); ++role; } - - setRoleNames(m_roleNames); } } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h index e38fffc95fe7454c958f6078b587db8ef4ac5702..e28816e6f50f65199f7f60bc047b6af665462638 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarysectionmodel.h @@ -48,6 +48,7 @@ public: int rowCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QHash<int, QByteArray> roleNames() const; void clearItems(); diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index 91b2c657cd84c149b40c7ea045ff0e8c51a43b4b..6b982e9da14b1e9f80151e2af71d629cbd23de23 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -113,8 +113,6 @@ NavigatorTreeModel::NavigatorTreeModel(QObject *parent) setColumnCount(2); # endif - setSupportedDragActions(Qt::LinkAction); - connect(this, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(handleChangedItem(QStandardItem*))); } @@ -128,6 +126,11 @@ Qt::DropActions NavigatorTreeModel::supportedDropActions() const return Qt::LinkAction | Qt::MoveAction; } +Qt::DropActions NavigatorTreeModel::supportedDragActions() const +{ + return Qt::LinkAction; +} + QStringList NavigatorTreeModel::mimeTypes() const { QStringList types; diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h index 0c19a803e1d86b16fbf9b61e02e5c47d8ffde95d..532ab5e846c111abb4c3c00c91adc76c882b5b16 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h @@ -90,6 +90,7 @@ public: ~NavigatorTreeModel(); Qt::DropActions supportedDropActions() const; + Qt::DropActions supportedDragActions() const; QStringList mimeTypes() const; QMimeData *mimeData(const QModelIndexList &indexes) const; diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp index 24809188b5152d155c3706150ad5446597e0fc65..10d2889c5501f2663e58ffb4a905721f4f07547d 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp @@ -133,7 +133,7 @@ void NavigatorView::modelAttached(Model *model) QTreeView *treeView = treeWidget(); treeView->expandAll(); - treeView->header()->setResizeMode(0, QHeaderView::Stretch); + treeView->header()->setSectionResizeMode(0, QHeaderView::Stretch); treeView->header()->resizeSection(1,26); treeView->setRootIsDecorated(false); treeView->setIndentation(20); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp index e1fe464268e331109334bdfe1af20bd445ac6efe..12554c34b1c52e1d2cb66b1a8bd4a19e2b0b6ef4 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp @@ -53,11 +53,6 @@ StatesEditorModel::StatesEditorModel(StatesEditorView *view) m_statesEditorView(view), m_updateCounter(0) { - QHash<int, QByteArray> roleNames; - roleNames.insert(StateNameRole, "stateName"); - roleNames.insert(StateImageSourceRole, "stateImageSource"); - roleNames.insert(InternalNodeId, "internalNodeId"); - setRoleNames(roleNames); } @@ -133,6 +128,15 @@ QVariant StatesEditorModel::data(const QModelIndex &index, int role) const return QVariant(); } +QHash<int, QByteArray> StatesEditorModel::roleNames() const +{ + QHash<int, QByteArray> roleNames; + roleNames.insert(StateNameRole, "stateName"); + roleNames.insert(StateImageSourceRole, "stateImageSource"); + roleNames.insert(InternalNodeId, "internalNodeId"); + return roleNames; +} + void StatesEditorModel::insertState(int stateIndex) { if (stateIndex >= 0) { diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h index 99f08be602efcff85604a8daa37705540b6196c3..5739cf01152c8f068b99b063a9a39d4ea8956ed9 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.h @@ -57,6 +57,7 @@ public: QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QHash<int, QByteArray> roleNames() const; void insertState(int stateIndex); void removeState(int stateIndex); diff --git a/src/plugins/qmldesigner/qmldesignerplugin.pro b/src/plugins/qmldesigner/qmldesignerplugin.pro index 190a8d65827085f66199c267986c46974804f108..a0c72cd7d0b99d52faa4b3fc646c4cacfd9097ac 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.pro +++ b/src/plugins/qmldesigner/qmldesignerplugin.pro @@ -22,6 +22,7 @@ include(components/importmanager/importmanager.pri) include(qmldesignerplugin.pri) DEFINES -= QT_NO_CAST_FROM_ASCII +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900 # For deprecated QWeakPointer use. BUILD_PUPPET_IN_CREATOR_BINPATH = $$(BUILD_PUPPET_IN_CREATOR_BINPATH) !isEmpty(BUILD_PUPPET_IN_CREATOR_BINPATH) { diff --git a/src/plugins/qmljseditor/qmloutlinemodel.cpp b/src/plugins/qmljseditor/qmloutlinemodel.cpp index badde4ef699bcdc1a41f1da02a70eeb24d6ef7d5..88b425739de9f67a043020ce4ebf1bc1da96aa7d 100644 --- a/src/plugins/qmljseditor/qmloutlinemodel.cpp +++ b/src/plugins/qmljseditor/qmloutlinemodel.cpp @@ -306,8 +306,6 @@ QmlOutlineModel::QmlOutlineModel(QmlJSEditorDocument *document) : const QString resourcePath = Core::ICore::resourcePath(); Icons::instance()->setIconFilesPath(resourcePath + QLatin1String("/qmlicons")); - // TODO: Maybe add a Copy Action? - setSupportedDragActions(Qt::MoveAction); setItemPrototype(new QmlOutlineItem(this)); } @@ -410,6 +408,12 @@ Qt::ItemFlags QmlOutlineModel::flags(const QModelIndex &index) const return flags; } +Qt::DropActions QmlOutlineModel::supportedDragActions() const +{ + // TODO: Maybe add a Copy Action? + return Qt::MoveAction; +} + Document::Ptr QmlOutlineModel::document() const { diff --git a/src/plugins/qmljseditor/qmloutlinemodel.h b/src/plugins/qmljseditor/qmloutlinemodel.h index a127a92a4940aa78558c395f9bc49e6b4d860729..6a58488641f56fe27225a33818ddc84f56888190 100644 --- a/src/plugins/qmljseditor/qmloutlinemodel.h +++ b/src/plugins/qmljseditor/qmloutlinemodel.h @@ -88,6 +88,7 @@ public: QMimeData *mimeData(const QModelIndexList &indexes) const; bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::DropActions supportedDragActions() const; QmlJS::Document::Ptr document() const; void update(const QmlJSTools::SemanticInfo &semanticInfo); diff --git a/src/plugins/qmlprofiler/qmlprofilertreeview.cpp b/src/plugins/qmlprofiler/qmlprofilertreeview.cpp index a85c168b40361bc855a033ae9b3fcbe7a14a97b7..2267890db164a45e351ac3af0ca77a87ecf86c5e 100644 --- a/src/plugins/qmlprofiler/qmlprofilertreeview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertreeview.cpp @@ -39,7 +39,7 @@ QmlProfilerTreeView::QmlProfilerTreeView(QWidget *parent) : Utils::TreeView(parent) { setFrameStyle(QFrame::NoFrame); - header()->setResizeMode(QHeaderView::Interactive); + header()->setSectionResizeMode(QHeaderView::Interactive); header()->setDefaultSectionSize(100); header()->setMinimumSectionSize(50); } diff --git a/src/plugins/qnx/bardescriptoreditorentrypointwidget.cpp b/src/plugins/qnx/bardescriptoreditorentrypointwidget.cpp index a941dcbdfb4913abe08313896d523a74f1052d2d..a270cf1a9bb0596777535f08339ff85c418f5a78 100644 --- a/src/plugins/qnx/bardescriptoreditorentrypointwidget.cpp +++ b/src/plugins/qnx/bardescriptoreditorentrypointwidget.cpp @@ -90,7 +90,7 @@ BarDescriptorEditorEntryPointWidget::~BarDescriptorEditorEntryPointWidget() void BarDescriptorEditorEntryPointWidget::setAssetsModel(QStandardItemModel *assetsModel) { - m_assetsModel = QWeakPointer<QStandardItemModel>(assetsModel); + m_assetsModel = assetsModel; } void BarDescriptorEditorEntryPointWidget::updateWidgetValue(BarDescriptorDocument::Tag tag, const QVariant &value) diff --git a/src/plugins/qnx/bardescriptoreditorentrypointwidget.h b/src/plugins/qnx/bardescriptoreditorentrypointwidget.h index 820b8d1d340e90bd88ea9fd770a7f810545a38d6..5b67152249caabab9582bad1ebad87910cbdd20d 100644 --- a/src/plugins/qnx/bardescriptoreditorentrypointwidget.h +++ b/src/plugins/qnx/bardescriptoreditorentrypointwidget.h @@ -34,6 +34,7 @@ #include "bardescriptoreditorabstractpanelwidget.h" +#include <QPointer> #include <QStandardItemModel> QT_BEGIN_NAMESPACE @@ -91,7 +92,7 @@ private: QString localAssetPathFromDestination(const QString &path); QStringListModel *m_splashScreenModel; - QWeakPointer<QStandardItemModel> m_assetsModel; + QPointer<QStandardItemModel> m_assetsModel; QString m_prevIconPath; diff --git a/src/plugins/qnx/blackberrydebugtokenreader.cpp b/src/plugins/qnx/blackberrydebugtokenreader.cpp index 4168e0e50b0ac442c6d10fd393fdbf0e559315c6..97e2b28fd0b944ad4eff9e82c55646d79af03814 100644 --- a/src/plugins/qnx/blackberrydebugtokenreader.cpp +++ b/src/plugins/qnx/blackberrydebugtokenreader.cpp @@ -134,5 +134,5 @@ QString BlackBerryDebugTokenReader::value(const QByteArray &key, const QByteArra { int valueStart = data.indexOf(key) + key.size(); int valueEnd = data.indexOf(QByteArray("\r\n"), valueStart); - return QString::fromAscii(data.mid(valueStart, valueEnd - valueStart)); + return QString::fromLatin1(data.mid(valueStart, valueEnd - valueStart)); } diff --git a/src/plugins/qnx/blackberryinstallwizardpages.cpp b/src/plugins/qnx/blackberryinstallwizardpages.cpp index bce2ee354a86a64821e785503410f35c6e3bd553..01689cdb436451c038ce157cb5237b960f5d48e3 100644 --- a/src/plugins/qnx/blackberryinstallwizardpages.cpp +++ b/src/plugins/qnx/blackberryinstallwizardpages.cpp @@ -353,7 +353,7 @@ void BlackBerryInstallWizardTargetPage::initTargetsTreeWidget() { m_ui->targetsTreeWidget->clear(); m_ui->targetsTreeWidget->setHeaderHidden(false); - m_ui->targetsTreeWidget->header()->setResizeMode(QHeaderView::ResizeToContents); + m_ui->targetsTreeWidget->header()->setSectionResizeMode(QHeaderView::ResizeToContents); m_ui->targetsTreeWidget->setHeaderItem(new QTreeWidgetItem(QStringList() << tr("Version") << tr("Name"))); m_ui->targetsTreeWidget->setTextElideMode(Qt::ElideNone); m_ui->targetsTreeWidget->setColumnCount(2); diff --git a/src/plugins/qnx/blackberryndksettingswidget.cpp b/src/plugins/qnx/blackberryndksettingswidget.cpp index ce5551469c7b8c55005c470be9441adf02477740..222ad25d0675c28f8df4a68a0a1c5e927ff49263 100644 --- a/src/plugins/qnx/blackberryndksettingswidget.cpp +++ b/src/plugins/qnx/blackberryndksettingswidget.cpp @@ -67,7 +67,7 @@ BlackBerryNDKSettingsWidget::BlackBerryNDKSettingsWidget(QWidget *parent) : m_activatedApiLevel << m_bbConfigManager->activeApiLevels(); - m_ui->ndksTreeWidget->header()->setResizeMode(QHeaderView::Stretch); + m_ui->ndksTreeWidget->header()->setSectionResizeMode(QHeaderView::Stretch); m_ui->ndksTreeWidget->header()->setStretchLastSection(false); m_ui->ndksTreeWidget->setHeaderItem(new QTreeWidgetItem(QStringList() << tr("Configuration"))); m_ui->ndksTreeWidget->setTextElideMode(Qt::ElideNone); diff --git a/src/plugins/qnx/qnxutils.cpp b/src/plugins/qnx/qnxutils.cpp index 3791ecfa78aee96b4c3290a5dc0d56340ad7504a..6ca62db3e9531b48aa40c929431d13e5dbef6a39 100644 --- a/src/plugins/qnx/qnxutils.cpp +++ b/src/plugins/qnx/qnxutils.cpp @@ -36,9 +36,9 @@ #include <utils/synchronousprocess.h> #include <QDir> -#include <QDesktopServices> #include <QDomDocument> #include <QProcess> +#include <QStandardPaths> #include <QTemporaryFile> #include <QApplication> @@ -191,9 +191,11 @@ QString QnxUtils::bbDataDirPath() if (Utils::HostOsInfo::isWindowsHost()) { // Get the proper storage location on Windows using QDesktopServices, // to not hardcode "AppData/Local", as it might refer to "AppData/Roaming". - QString dataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation); + QString dataDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + + QLatin1String("/data"); dataDir = dataDir.left(dataDir.indexOf(QCoreApplication::organizationName())); dataDir.append(QLatin1String("Research in Motion")); + qDebug("qnx: Full data dir is '%s'", qPrintable(dataDir)); return dataDir; } diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index e3b946e6614d919025244d2a48c2ad73d601e005..c97feb238205cf357b6d5b937d20825efa252bd7 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -76,11 +76,6 @@ ExampleSetModel::ExampleSetModel(ExamplesListModel *examplesModel, QObject *pare QStandardItemModel(parent), examplesModel(examplesModel) { - QHash<int, QByteArray> roleNames; - roleNames[Qt::UserRole + 1] = "text"; - roleNames[Qt::UserRole + 2] = "QtId"; - roleNames[Qt::UserRole + 3] = "extraSetIndex"; - setRoleNames(roleNames); } void ExampleSetModel::update() @@ -195,31 +190,20 @@ int ExampleSetModel::getExtraExampleSetIndex(int i) const return variant.toInt(); } +QHash<int, QByteArray> ExampleSetModel::roleNames() const +{ + QHash<int, QByteArray> roleNames; + roleNames[Qt::UserRole + 1] = "text"; + roleNames[Qt::UserRole + 2] = "QtId"; + roleNames[Qt::UserRole + 3] = "extraSetIndex"; + return roleNames; +} + ExamplesListModel::ExamplesListModel(QObject *parent) : QAbstractListModel(parent), m_exampleSetModel(new ExampleSetModel(this, this)), m_selectedExampleSetIndex(-1) { - QHash<int, QByteArray> roleNames; - roleNames[Name] = "name"; - roleNames[ProjectPath] = "projectPath"; - roleNames[ImageUrl] = "imageUrl"; - roleNames[Description] = "description"; - roleNames[DocUrl] = "docUrl"; - roleNames[FilesToOpen] = "filesToOpen"; - roleNames[MainFile] = "mainFile"; - roleNames[Tags] = "tags"; - roleNames[Difficulty] = "difficulty"; - roleNames[Type] = "type"; - roleNames[HasSourceCode] = "hasSourceCode"; - roleNames[Dependencies] = "dependencies"; - roleNames[IsVideo] = "isVideo"; - roleNames[VideoUrl] = "videoUrl"; - roleNames[VideoLength] = "videoLength"; - roleNames[Platforms] = "platforms"; - roleNames[IsHighlighted] = "isHighlighted"; - setRoleNames(roleNames); - // read extra example sets settings QSettings *settings = Core::ICore::settings(); QStringList list = settings->value(QLatin1String("Help/InstalledExamples"), @@ -698,6 +682,29 @@ QVariant ExamplesListModel::data(const QModelIndex &index, int role) const } } +QHash<int, QByteArray> ExamplesListModel::roleNames() const +{ + QHash<int, QByteArray> roleNames; + roleNames[Name] = "name"; + roleNames[ProjectPath] = "projectPath"; + roleNames[ImageUrl] = "imageUrl"; + roleNames[Description] = "description"; + roleNames[DocUrl] = "docUrl"; + roleNames[FilesToOpen] = "filesToOpen"; + roleNames[MainFile] = "mainFile"; + roleNames[Tags] = "tags"; + roleNames[Difficulty] = "difficulty"; + roleNames[Type] = "type"; + roleNames[HasSourceCode] = "hasSourceCode"; + roleNames[Dependencies] = "dependencies"; + roleNames[IsVideo] = "isVideo"; + roleNames[VideoUrl] = "videoUrl"; + roleNames[VideoLength] = "videoLength"; + roleNames[Platforms] = "platforms"; + roleNames[IsHighlighted] = "isHighlighted"; + return roleNames; +} + void ExamplesListModel::update() { updateQtVersions(); diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index bc322373dc943d3e0f6c7620e760a6be8dc6bf23..7fd34bb9c42c2b7520a7250342cbad0577471fd5 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -68,6 +68,8 @@ public: int getExtraExampleSetIndex(int index) const; private: + QHash<int, QByteArray> roleNames() const; + ExamplesListModel *examplesModel; }; @@ -121,6 +123,7 @@ public: int rowCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QHash<int, QByteArray> roleNames() const; void beginReset() { beginResetModel(); } void endReset() { endResetModel(); } diff --git a/src/plugins/qtsupport/qmldumptool.cpp b/src/plugins/qtsupport/qmldumptool.cpp index ecc74dc23473763167ead8008cbf2b93a904cfcf..eabb73f0deedf6b190da987526de5e7df5028be8 100644 --- a/src/plugins/qtsupport/qmldumptool.cpp +++ b/src/plugins/qtsupport/qmldumptool.cpp @@ -40,11 +40,12 @@ #include <qmljs/qmljsmodelmanagerinterface.h> #include <utils/hostosinfo.h> #include <utils/qtcassert.h> -#include <QDesktopServices> + #include <QCoreApplication> #include <QDir> #include <QDebug> #include <QHash> +#include <QStandardPaths> namespace { @@ -308,7 +309,7 @@ QStringList QmlDumpTool::installDirectories(const QString &qtInstallData) directories << (qtInstallData + QLatin1String("/qtc-qmldump/")) << QDir::cleanPath((QCoreApplication::applicationDirPath() + QLatin1String("/../qtc-qmldump/") + QString::number(hash))) + slash - << (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("/qtc-qmldump/") + QString::number(hash)) + slash; + << (QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/data/qtc-qmldump/") + QString::number(hash)) + slash; return directories; } diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 49c3c89eb0d788b0c54d2c076073a17101653ec5..50587914c2c259b81a3c01648237b4b4816116eb 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -139,8 +139,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent) // setup parent items for auto-detected and manual versions m_ui->qtdirList->header()->setStretchLastSection(false); - m_ui->qtdirList->header()->setResizeMode(0, QHeaderView::ResizeToContents); - m_ui->qtdirList->header()->setResizeMode(1, QHeaderView::Stretch); + m_ui->qtdirList->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); + m_ui->qtdirList->header()->setSectionResizeMode(1, QHeaderView::Stretch); m_ui->qtdirList->setTextElideMode(Qt::ElideNone); m_autoItem = new QTreeWidgetItem(m_ui->qtdirList); m_autoItem->setText(0, tr("Auto-detected")); diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index 84a600d097ca819b8eb89b346c263b97ee20cacd..fcbaac2e65560c4fcb1c64d512d650c863eeb323 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -547,9 +547,6 @@ void ResourceFile::clearPrefixList() ResourceModel::ResourceModel(const ResourceFile &resource_file, QObject *parent) : QAbstractItemModel(parent), m_resource_file(resource_file), m_dirty(false) { - // Only action that works for QListWidget and the like. - setSupportedDragActions(Qt::CopyAction); - m_prefixIcon = Core::FileIconProvider::overlayIcon(QStyle::SP_DirIcon, QIcon(QLatin1String(":/resourceeditor/images/qt_qrc.png")), QSize(16, 16)); } diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index 3b0e5845ab4b35050d05cf0b0810c73da561e6da..d382548a1043ce4551f82c68c744790fd599536c 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -159,12 +159,12 @@ void BaseHoverHandler::process(BaseTextEditor *editor, int pos) void BaseHoverHandler::decorateToolTip() { if (Qt::mightBeRichText(toolTip())) - setToolTip(Qt::escape(toolTip())); + setToolTip(toolTip().toHtmlEscaped()); if (!isDiagnosticTooltip() && lastHelpItemIdentified().isValid()) { const QString &contents = lastHelpItemIdentified().extractContent(false); if (!contents.isEmpty()) { - setToolTip(Qt::escape(toolTip())); + setToolTip(toolTip().toHtmlEscaped()); appendToolTip(contents); addF1ToToolTip(); } diff --git a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp index a794a650178138f289fa079cd659b7c8343e54ea..1960fdb5edad3f38a9768d55834ec9f04f6f4aa4 100644 --- a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp +++ b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp @@ -52,7 +52,7 @@ ManageDefinitionsDialog::ManageDefinitionsDialog( ui.setupUi(this); ui.definitionsTable->setHorizontalHeaderLabels( QStringList() << tr("Name") << tr("Installed") << tr("Available")); - ui.definitionsTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); + ui.definitionsTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); setWindowTitle(tr("Download Definitions")); diff --git a/src/plugins/texteditor/snippets/snippet.cpp b/src/plugins/texteditor/snippets/snippet.cpp index d7f8a4296a24a61e5036024e7d0a3d3667eb0c94..cc693a0d332efa25b0533fcaec3e77538a0728db 100644 --- a/src/plugins/texteditor/snippets/snippet.cpp +++ b/src/plugins/texteditor/snippets/snippet.cpp @@ -164,7 +164,7 @@ QString Snippet::generateTip() const static const QLatin1String kCloseBold("</b>"); static const QLatin1String kEllipsis("..."); - QString escapedContent(Qt::escape(m_content)); + QString escapedContent(m_content.toHtmlEscaped()); escapedContent.replace(kNewLine, kBr); escapedContent.replace(kSpace, kNbsp); diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 2aec39c991f4324507beb02351c944acac9d342a..ac475740b87cdaca314800a9df0e42504120913c 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -330,7 +330,7 @@ void TextEditorActionHandlerPrivate::createActions() QKeySequence(Qt::Key_F2)); m_jumpToFileInNextSplitAction = registerAction(JUMP_TO_FILE_UNDER_CURSOR_IN_NEXT_SPLIT, [this] (BaseTextEditorWidget *w) { w->openLinkUnderCursorInNextSplit(); }, true, - QKeySequence(Utils::HostOsInfo::isMacHost() ? tr("Meta+E, F2") : tr("Ctrl+E, F2"))); + QKeySequence(Utils::HostOsInfo::isMacHost() ? tr("Meta+E, F2") : tr("Ctrl+E, F2")).toString()); m_viewPageUpAction = registerAction(VIEW_PAGE_UP, [this] (BaseTextEditorWidget *w) { w->viewPageUp(); }, true, tr("Move the View a Page Up and Keep the Cursor Position"), diff --git a/src/plugins/todo/todooutputtreeview.cpp b/src/plugins/todo/todooutputtreeview.cpp index 8ae3af9e69fee5c32cca373d9fbe2800303ad818..483c4293d03bae99d80dea7d803c6e581172e8e1 100644 --- a/src/plugins/todo/todooutputtreeview.cpp +++ b/src/plugins/todo/todooutputtreeview.cpp @@ -50,9 +50,9 @@ TodoOutputTreeView::TodoOutputTreeView(QWidget *parent) : setAttribute(Qt::WA_MacShowFocusRect, false); setSelectionBehavior(QTreeView::SelectRows); - header()->setResizeMode(QHeaderView::Interactive); + header()->setSectionResizeMode(QHeaderView::Interactive); header()->setStretchLastSection(true); - header()->setMovable(false); + header()->setSectionsMovable(false); connect(header(), SIGNAL(sectionResized(int,int,int)), SLOT(todoColumnResized(int,int,int))); loadDisplaySettings(); } diff --git a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp index d2825cd5427c98ea1388e7c539d556735f26f6da..acb36a95e1f76c268a39fb6266b64d1cb17d7ee0 100644 --- a/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp +++ b/src/plugins/valgrind/callgrind/callgrinddatamodel.cpp @@ -248,7 +248,7 @@ QVariant DataModel::data(const QModelIndex &index, int role) const QString entry = QLatin1String("<dt>%1</dt><dd>%2</dd>\n"); // body, function info first - ret += entry.arg(tr("Function:")).arg(Qt::escape(func->name())); + ret += entry.arg(tr("Function:")).arg(func->name().toHtmlEscaped()); ret += entry.arg(tr("File:")).arg(func->file()); if (!func->costItems().isEmpty()) { const CostItem *firstItem = func->costItems().first(); diff --git a/src/plugins/valgrind/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp index a5782a398583b071c30128cc100be57ecc19478b..b1c3a94fb318a228da2728ae1e0618ec5ce5d109 100644 --- a/src/plugins/valgrind/memcheckerrorview.cpp +++ b/src/plugins/valgrind/memcheckerrorview.cpp @@ -168,7 +168,7 @@ static QString makeFrameName(const Frame &frame, const QString &relativeTo, if (frame.line() != -1) path += QLatin1Char(':') + QString::number(frame.line()); - path = Qt::escape(path); + path = path.toHtmlEscaped(); if (link && !f.isEmpty() && QFile::exists(fullPath)) { // make a hyperlink label @@ -177,7 +177,7 @@ static QString makeFrameName(const Frame &frame, const QString &relativeTo, } if (!fn.isEmpty()) - return QCoreApplication::translate("Valgrind::Internal", "%1 in %2").arg(Qt::escape(fn), path); + return QCoreApplication::translate("Valgrind::Internal", "%1 in %2").arg(fn.toHtmlEscaped(), path); if (!path.isEmpty()) return path; return QString::fromLatin1("0x%1").arg(frame.instructionPointer(), 0, 16); diff --git a/tests/auto/debugger/dumpers.qbs b/tests/auto/debugger/dumpers.qbs index e3f10b331c6c4280ebe83233cc58bd6152a9f686..24190b8761d8175b44a4188708400e4d3b525567 100644 --- a/tests/auto/debugger/dumpers.qbs +++ b/tests/auto/debugger/dumpers.qbs @@ -29,7 +29,6 @@ QtcAutotest { 'CDBEXT_PATH="' + project.buildDirectory + '\\\\lib"', 'DUMPERDIR="' + path + '/../../../share/qtcreator/debugger"', 'QT_NO_CAST_FROM_ASCII', - 'QT_DISABLE_DEPRECATED_BEFORE=0x040900' ]) cpp.includePaths: base.concat([project.debuggerDir]) } diff --git a/tests/auto/externaltool/externaltool.qbs b/tests/auto/externaltool/externaltool.qbs index 61fdd0ce99528056a463d04b24ae84b99ecce2a3..99d3e27af57220bddd7d4d21b16dec515b8e0e60 100644 --- a/tests/auto/externaltool/externaltool.qbs +++ b/tests/auto/externaltool/externaltool.qbs @@ -20,8 +20,4 @@ QtcAutotest { name: "Test sources" files: "tst_externaltooltest.cpp" } - - cpp.defines: base.concat([ - "QT_DISABLE_DEPRECATED_BEFORE=0x040900", - ]) } diff --git a/tests/auto/valgrind/valgrindautotest.qbs b/tests/auto/valgrind/valgrindautotest.qbs index 1c702effe034473d521e32bb4d3679f068517857..f51f161cc6a06b67966578a7a75d6a19612c8c83 100644 --- a/tests/auto/valgrind/valgrindautotest.qbs +++ b/tests/auto/valgrind/valgrindautotest.qbs @@ -31,9 +31,5 @@ QtcAutotest { "valgrindrunner.h", "valgrindrunner.cpp", ] } - - cpp.defines: base.concat([ - 'QT_DISABLE_DEPRECATED_BEFORE=0x040900', - ]) cpp.includePaths: base.concat([project.ide_source_tree + "/src/plugins"]) }