forked from qt-creator/qt-creator
Do not use deprecated Qt functionality.
Replace all* remaining deprecated Qt 4 functions with their Qt 5 counterparts. This means we no longer need to define the QT_DISABLE_DEPRECATED_BEFORE macro. This patch is relatively small because most source-compatible changes of this kind have been done before. * The one exception is the QmlDesigner, which uses QWeakPointer in a deprecated way all over the place. Change-Id: Id4b839c6685f3b5bdf2b89137f95231758ec53c7 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"] : [])
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -7,8 +7,4 @@ build_all:!build_pass {
|
||||
CONFIG += release
|
||||
}
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
|
||||
}
|
||||
|
||||
include(qmlpuppet.pri)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -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>"));
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>");
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>";
|
||||
|
||||
@@ -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())) :
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -90,6 +90,7 @@ public:
|
||||
~NavigatorTreeModel();
|
||||
|
||||
Qt::DropActions supportedDropActions() const;
|
||||
Qt::DropActions supportedDragActions() const;
|
||||
|
||||
QStringList mimeTypes() const;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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(); }
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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"));
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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])
|
||||
}
|
||||
|
||||
@@ -20,8 +20,4 @@ QtcAutotest {
|
||||
name: "Test sources"
|
||||
files: "tst_externaltooltest.cpp"
|
||||
}
|
||||
|
||||
cpp.defines: base.concat([
|
||||
"QT_DISABLE_DEPRECATED_BEFORE=0x040900",
|
||||
])
|
||||
}
|
||||
|
||||
@@ -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"])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user