forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.2'
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -144,6 +144,7 @@ tmp/
|
||||
/tests/auto/cplusplus/checksymbols/tst_checksymbols
|
||||
/tests/auto/cplusplus/codegen/tst_codegen
|
||||
/tests/auto/cplusplus/cxx11/tst_cxx11
|
||||
/tests/auto/cplusplus/cxx11/tst_c99
|
||||
/tests/auto/cplusplus/lexer/tst_lexer
|
||||
/tests/auto/cplusplus/misc/tst_misc
|
||||
/tests/auto/cplusplus/simplifytypes/tst_simplifytypes
|
||||
|
8
README
8
README
@@ -10,16 +10,14 @@ Windows XP SP3 or later
|
||||
(K)Ubuntu Linux 11.10 (32-bit and 64-bit) or later
|
||||
Mac OS X 10.7 or later
|
||||
|
||||
Building the sources requires Qt 5.2.0 or later.
|
||||
Building the sources requires Qt 5.3.1 or later.
|
||||
It is also possible to build with Qt 4.8.x, but in that case the Welcome mode,
|
||||
QML Profiler, and the WinRT and Qbs support are disabled.
|
||||
The Qt Quick Designer can only be compiled with Qt 5.3.1 or later , because
|
||||
it requires QQuickWidget.
|
||||
|
||||
Compiling Qt Creator
|
||||
====================
|
||||
Prerequisites:
|
||||
* Qt 5.2.0 or later (with restrictions also Qt 4.8.x)
|
||||
* Qt 5.3.1 or later (with restrictions also Qt 4.8.x)
|
||||
* On Windows:
|
||||
- ActiveState Active Perl
|
||||
- MinGW or Visual Studio 2010 or later
|
||||
@@ -191,7 +189,7 @@ http://qt-project.org/wiki/Building_Qt_5_from_Git .
|
||||
able to find all dependent Qt-libraries and plugins when being launched by the
|
||||
system. The easiest way to provide them for Qt 5 is to run the tool windeployqt:
|
||||
|
||||
windeployqt -svg -xml -designercomponents -script -concurrent -network -quick -test -sql -printsupport -qthelp -qmldir share\qtcreator -qmldir src\plugins\qmlprofiler bin\qtcreator.exe
|
||||
windeployqt -svg -xml -designercomponents -script -concurrent -network -quick -quickwidgets -test -sql -printsupport -qthelp -qmldir share\qtcreator -qmldir src\plugins\qmlprofiler bin\qtcreator.exe
|
||||
|
||||
Note that unlike on Unix, you cannot overwrite executables that are running.
|
||||
Thus, if you want to work on Qt Creator using Qt Creator, you need a
|
||||
|
@@ -25,7 +25,8 @@ QtcProduct {
|
||||
|
||||
cpp.defines: base.concat([name.toUpperCase() + "_LIBRARY"])
|
||||
cpp.installNamePrefix: "@rpath/PlugIns/"
|
||||
cpp.rpaths: qbs.targetOS.contains("osx") ? ["@loader_path/..", "@executable_path/.."]
|
||||
cpp.rpaths: qbs.targetOS.contains("osx")
|
||||
? ["@loader_path/..", "@loader_path/", "@executable_path/.."]
|
||||
: ["$ORIGIN", "$ORIGIN/.."]
|
||||
cpp.linkerFlags: {
|
||||
var flags = base;
|
||||
|
@@ -41,21 +41,26 @@ exists(src/shared/qbs/qbs.pro) {
|
||||
system("echo QBSLIBDIR = $${maybe_backslash}\"$${IDE_LIBRARY_PATH}$${maybe_backslash}\" >> $$qmake_cache")
|
||||
system("echo QBS_INSTALL_PREFIX = $${QTC_PREFIX} >> $$qmake_cache")
|
||||
system("echo QBS_LIB_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator >> $$qmake_cache")
|
||||
system("echo QBS_RESOURCES_BUILD_DIR = $${maybe_backslash}\"$${IDE_DATA_PATH}/qbs$${maybe_backslash}\" >> $$qmake_cache")
|
||||
QBS_RESOURCES_BUILD_DIR = $${IDE_DATA_PATH}/qbs
|
||||
system("echo QBS_RESOURCES_BUILD_DIR = $${maybe_backslash}\"$${QBS_RESOURCES_BUILD_DIR}$${maybe_backslash}\" >> $$qmake_cache")
|
||||
system("echo QBS_RESOURCES_INSTALL_DIR = $${QTC_PREFIX}/share/qtcreator/qbs >> $$qmake_cache")
|
||||
macx {
|
||||
system("echo QBS_PLUGINS_BUILD_DIR = $${maybe_backslash}\"$${IDE_LIBRARY_PATH}$${maybe_backslash}\" >> $$qmake_cache")
|
||||
QBS_PLUGINS_BUILD_DIR = $${IDE_LIBRARY_PATH}
|
||||
system("echo QBS_APPS_RPATH_DIR = @loader_path/../PlugIns >> $$qmake_cache")
|
||||
} else {
|
||||
system("echo QBS_PLUGINS_BUILD_DIR = $${maybe_backslash}\"$${IDE_BUILD_TREE}/$${IDE_LIBRARY_BASENAME}/qtcreator/$${maybe_backslash}\" >> $$qmake_cache")
|
||||
QBS_PLUGINS_BUILD_DIR = $${IDE_BUILD_TREE}/$${IDE_LIBRARY_BASENAME}/qtcreator
|
||||
system("echo QBS_APPS_RPATH_DIR = '\\\$\\\$ORIGIN/../'/lib/qtcreator >> $$qmake_cache")
|
||||
}
|
||||
system("echo QBS_PLUGINS_BUILD_DIR = $${maybe_backslash}\"$${QBS_PLUGINS_BUILD_DIR}$${maybe_backslash}\" >> $$qmake_cache")
|
||||
system("echo QBS_PLUGINS_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator >> $$qmake_cache")
|
||||
system("echo QBS_LIBRARY_DIRNAME = $${IDE_LIBRARY_BASENAME} >> $$qmake_cache")
|
||||
system("echo QBS_APPS_DESTDIR = $${maybe_backslash}\"$${IDE_BIN_PATH}$${maybe_backslash}\">> $$qmake_cache")
|
||||
QBS_APPS_DESTDIR = $${IDE_BIN_PATH}
|
||||
system("echo QBS_APPS_DESTDIR = $${maybe_backslash}\"$${QBS_APPS_DESTDIR}$${maybe_backslash}\">> $$qmake_cache")
|
||||
system("echo QBS_APPS_INSTALL_DIR = $${QTC_PREFIX}/bin >> $$qmake_cache")
|
||||
system("echo QBS_RELATIVE_PLUGINS_PATH = $${maybe_backslash}\$$${maybe_backslash}\$relative_path$${maybe_backslash}\($${maybe_backslash}\$$${maybe_backslash}\$QBS_PLUGINS_BUILD_DIR, $${maybe_backslash}\$$${maybe_backslash}\$QBS_APPS_DESTDIR$${maybe_backslash}\)" >> $$qmake_cache)
|
||||
system("echo QBS_RELATIVE_SEARCH_PATH = $${maybe_backslash}\$$${maybe_backslash}\$relative_path$${maybe_backslash}\($${maybe_backslash}\$$${maybe_backslash}\$QBS_RESOURCES_BUILD_DIR, $${maybe_backslash}\$$${maybe_backslash}\$QBS_APPS_DESTDIR$${maybe_backslash}\)" >> $$qmake_cache)
|
||||
QBS_RELATIVE_PLUGINS_PATH = $$relative_path($$QBS_PLUGINS_BUILD_DIR, $$QBS_APPS_DESTDIR$$)
|
||||
system("echo QBS_RELATIVE_PLUGINS_PATH = $${QBS_RELATIVE_PLUGINS_PATH}" >> $$qmake_cache)
|
||||
QBS_RELATIVE_SEARCH_PATH = $$relative_path($$QBS_RESOURCES_BUILD_DIR, $$QBS_APPS_DESTDIR)
|
||||
system("echo QBS_RELATIVE_SEARCH_PATH = $${QBS_RELATIVE_SEARCH_PATH}" >> $$qmake_cache)
|
||||
system("echo CONFIG += qbs_no_dev_install >> $$qmake_cache")
|
||||
}
|
||||
|
||||
|
@@ -753,13 +753,19 @@ class DumperBase:
|
||||
self.putType(type)
|
||||
self.putNumChild(1)
|
||||
format = self.currentItemFormat()
|
||||
isDefault = format == None and str(innerType.unqualified()) == "char"
|
||||
if isDefault or format == 0 or format == 1 or format == 2:
|
||||
isDefault1 = format == None and str(innerType.unqualified()) == "char"
|
||||
isDefault2 = format == None and str(innerType.unqualified()) == "wchar_t"
|
||||
if isDefault1 or isDefault2 or format == 0 or format == 1 or format == 2:
|
||||
blob = self.readMemory(self.addressOf(value), type.sizeof)
|
||||
|
||||
if isDefault:
|
||||
if isDefault1:
|
||||
# Use Latin1 as default for char [].
|
||||
self.putValue(blob, Hex2EncodedLatin1)
|
||||
elif isDefault2:
|
||||
if type.sizeof == 2:
|
||||
self.putValue(blob, Hex4EncodedLittleEndian)
|
||||
else:
|
||||
self.putValue(blob, Hex8EncodedLittleEndian)
|
||||
elif format == 0:
|
||||
# Explicitly requested Latin1 formatting.
|
||||
self.putValue(blob, Hex2EncodedLatin1)
|
||||
|
@@ -58,7 +58,7 @@ Row {
|
||||
|
||||
property variant backendValue: backendValues.horizontalAlignment;
|
||||
|
||||
property variant value: backendValue.value
|
||||
property variant value: backendValue.enumeration
|
||||
|
||||
property bool baseStateFlag: isBaseState;
|
||||
|
||||
|
@@ -59,7 +59,7 @@ Row {
|
||||
|
||||
property variant backendValue: backendValues.verticalAlignment;
|
||||
|
||||
property variant value: backendValue.value
|
||||
property variant value: backendValue.enumeration
|
||||
|
||||
property bool baseStateFlag: isBaseState;
|
||||
|
||||
|
@@ -94,7 +94,7 @@ ButtonRow {
|
||||
|
||||
onClicked: {
|
||||
if (checked) {
|
||||
anchorBackend.verticalCentered = false;
|
||||
anchorBackend.horizontalCentered = false;
|
||||
anchorBackend.leftAnchored = true;
|
||||
} else {
|
||||
anchorBackend.leftAnchored = false;
|
||||
@@ -112,7 +112,7 @@ ButtonRow {
|
||||
|
||||
onClicked: {
|
||||
if (checked) {
|
||||
anchorBackend.verticalCentered = false;
|
||||
anchorBackend.horizontalCentered = false;
|
||||
anchorBackend.rightAnchored = true;
|
||||
} else {
|
||||
anchorBackend.rightAnchored = false;
|
||||
|
@@ -100,6 +100,7 @@ Section {
|
||||
text: qsTr("Format")
|
||||
}
|
||||
ComboBox {
|
||||
scope: "Text"
|
||||
visible: showFormatProperty
|
||||
model: ["PlainText", "RichText", "AutoText"]
|
||||
backendValue: backendValues.textFormat
|
||||
|
@@ -112,7 +112,7 @@ RowLayout {
|
||||
|
||||
ButtonRow {
|
||||
id: buttonRow
|
||||
opacity: anchorRow.showAlternativeTargets ? 1 : 0
|
||||
opacity: 0
|
||||
|
||||
property variant relativeTarget: anchorBackend.relativeAnchorTargetTop
|
||||
|
||||
|
@@ -39,6 +39,7 @@ Column {
|
||||
useLineEdit: true
|
||||
showIsWrapping: true
|
||||
showVerticalAlignment: true
|
||||
showFormatProperty: true
|
||||
}
|
||||
|
||||
Section {
|
||||
|
5
src/libs/3rdparty/botan/botan.cpp
vendored
5
src/libs/3rdparty/botan/botan.cpp
vendored
@@ -37528,6 +37528,7 @@ Power_Mod::Power_Mod(const BigInt& n, Usage_Hints hints)
|
||||
*/
|
||||
Power_Mod::Power_Mod(const Power_Mod& other)
|
||||
{
|
||||
Q_UNUSED(hints);
|
||||
core = 0;
|
||||
if(other.core)
|
||||
core = other.core->copy();
|
||||
@@ -46650,6 +46651,8 @@ bool has_mlock()
|
||||
*/
|
||||
bool lock_mem(void* ptr, size_t bytes)
|
||||
{
|
||||
Q_UNUSED(ptr);
|
||||
Q_UNUSED(bytes);
|
||||
#if defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK)
|
||||
return (::mlock(static_cast<char*>(ptr), bytes) == 0);
|
||||
#elif defined(BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK)
|
||||
@@ -46664,6 +46667,8 @@ bool lock_mem(void* ptr, size_t bytes)
|
||||
*/
|
||||
void unlock_mem(void* ptr, size_t bytes)
|
||||
{
|
||||
Q_UNUSED(ptr);
|
||||
Q_UNUSED(bytes);
|
||||
#if defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK)
|
||||
::munlock(static_cast<char*>(ptr), bytes);
|
||||
#elif defined(BOTAN_TARGET_OS_HAS_WIN32_VIRTUAL_LOCK)
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include "qmljsqrcparser.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/function.h>
|
||||
|
||||
#include <QCryptographicHash>
|
||||
|
||||
@@ -616,7 +615,7 @@ CoreImport ImportDependencies::coreImport(const QString &importId) const
|
||||
|
||||
void ImportDependencies::iterateOnCandidateImports(
|
||||
const ImportKey &key, const ViewerContext &vContext,
|
||||
Utils::function<bool (const ImportMatchStrength &,const Export &,const CoreImport &)>
|
||||
std::function<bool (const ImportMatchStrength &,const Export &,const CoreImport &)>
|
||||
const &iterF) const
|
||||
{
|
||||
switch (key.type) {
|
||||
@@ -817,7 +816,7 @@ void ImportDependencies::removeExport(const QString &importId, const ImportKey &
|
||||
|
||||
void ImportDependencies::iterateOnCoreImports(
|
||||
const ViewerContext &vContext,
|
||||
Utils::function<bool (const CoreImport &)> const &iterF) const
|
||||
std::function<bool (const CoreImport &)> const &iterF) const
|
||||
{
|
||||
QMapIterator<QString, CoreImport> i(m_coreImports);
|
||||
while (i.hasNext()) {
|
||||
@@ -829,7 +828,7 @@ void ImportDependencies::iterateOnCoreImports(
|
||||
|
||||
void ImportDependencies::iterateOnLibraryImports(
|
||||
const ViewerContext &vContext,
|
||||
Utils::function<bool (const ImportMatchStrength &,
|
||||
std::function<bool (const ImportMatchStrength &,
|
||||
const Export &,
|
||||
const CoreImport &)> const &iterF) const
|
||||
{
|
||||
@@ -865,7 +864,7 @@ void ImportDependencies::iterateOnLibraryImports(
|
||||
void ImportDependencies::iterateOnSubImports(
|
||||
const ImportKey &baseKey,
|
||||
const ViewerContext &vContext,
|
||||
Utils::function<bool (const ImportMatchStrength &,
|
||||
std::function<bool (const ImportMatchStrength &,
|
||||
const Export &,
|
||||
const CoreImport &)> const &iterF) const
|
||||
{
|
||||
|
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <languageutils/componentversion.h>
|
||||
#include <utils/qtcoverride.h>
|
||||
#include <utils/function.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
@@ -44,6 +43,8 @@
|
||||
#include <QSet>
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include <functional>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QCryptographicHash;
|
||||
QT_END_NAMESPACE
|
||||
@@ -192,7 +193,7 @@ public:
|
||||
|
||||
CoreImport coreImport(const QString &importId) const;
|
||||
void iterateOnCandidateImports(const ImportKey &key, const ViewerContext &vContext,
|
||||
Utils::function<bool(const ImportMatchStrength &,
|
||||
std::function<bool(const ImportMatchStrength &,
|
||||
const Export &,
|
||||
const CoreImport &)> const &iterF) const;
|
||||
ImportElements candidateImports(const ImportKey &key, const ViewerContext &vContext) const;
|
||||
@@ -209,13 +210,13 @@ public:
|
||||
const QString &requiredPath);
|
||||
|
||||
void iterateOnCoreImports(const ViewerContext &vContext,
|
||||
Utils::function<bool(const CoreImport &)> const &iterF) const;
|
||||
std::function<bool(const CoreImport &)> const &iterF) const;
|
||||
void iterateOnLibraryImports(const ViewerContext &vContext,
|
||||
Utils::function<bool(const ImportMatchStrength &,
|
||||
std::function<bool(const ImportMatchStrength &,
|
||||
const Export &,
|
||||
const CoreImport &)> const &iterF) const;
|
||||
void iterateOnSubImports(const ImportKey &baseKey, const ViewerContext &vContext,
|
||||
Utils::function<bool(const ImportMatchStrength &,
|
||||
std::function<bool(const ImportMatchStrength &,
|
||||
const Export &,
|
||||
const CoreImport &)> const &iterF) const;
|
||||
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include "qmljstypedescriptionreader.h"
|
||||
|
||||
#include <cplusplus/cppmodelmanagerbase.h>
|
||||
#include <utils/function.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/runextensions.h>
|
||||
|
||||
@@ -815,7 +814,7 @@ void ModelManagerInterface::parseLoop(QSet<QString> &scannedPaths,
|
||||
ModelManagerInterface *modelManager,
|
||||
Language::Enum mainLanguage,
|
||||
bool emitDocChangedOnDisk,
|
||||
Utils::function<bool(qreal)> reportProgress)
|
||||
std::function<bool(qreal)> reportProgress)
|
||||
{
|
||||
for (int i = 0; i < files.size(); ++i) {
|
||||
if (!reportProgress(qreal(i) / files.size()))
|
||||
@@ -1379,6 +1378,19 @@ void ModelManagerInterface::joinAllThreads()
|
||||
future.waitForFinished();
|
||||
}
|
||||
|
||||
Document::Ptr ModelManagerInterface::ensuredGetDocumentForPath(const QString &filePath)
|
||||
{
|
||||
QmlJS::Document::Ptr document = newestSnapshot().document(filePath);
|
||||
if (!document) {
|
||||
document = QmlJS::Document::create(filePath, QmlJS::Language::Qml);
|
||||
QMutexLocker lock(&m_mutex);
|
||||
|
||||
m_newestSnapshot.insert(document);
|
||||
}
|
||||
|
||||
return document;
|
||||
}
|
||||
|
||||
void ModelManagerInterface::resetCodeModel()
|
||||
{
|
||||
QStringList documents;
|
||||
|
@@ -199,6 +199,9 @@ public:
|
||||
|
||||
// Blocks until all parsing threads are done. Used for testing.
|
||||
void joinAllThreads();
|
||||
|
||||
QmlJS::Document::Ptr ensuredGetDocumentForPath(const QString &filePath);
|
||||
|
||||
public slots:
|
||||
virtual void resetCodeModel();
|
||||
void removeProjectInfo(ProjectExplorer::Project *project);
|
||||
@@ -226,7 +229,7 @@ protected:
|
||||
static void parseLoop(QSet<QString> &scannedPaths, QSet<QString> &newLibraries,
|
||||
WorkingCopy workingCopyInternal, QStringList files, ModelManagerInterface *modelManager,
|
||||
QmlJS::Language::Enum mainLanguage, bool emitDocChangedOnDisk,
|
||||
Utils::function<bool (qreal)> reportProgress);
|
||||
std::function<bool (qreal)> reportProgress);
|
||||
static void parse(QFutureInterface<void> &future,
|
||||
WorkingCopy workingCopyInternal,
|
||||
QStringList files,
|
||||
|
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "basetreeview.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFontMetrics>
|
||||
#include <QHeaderView>
|
||||
#include <QItemDelegate>
|
||||
#include <QLabel>
|
||||
@@ -75,36 +77,21 @@ BaseTreeView::BaseTreeView(QWidget *parent)
|
||||
SLOT(rowClickedHelper(QModelIndex)));
|
||||
connect(header(), SIGNAL(sectionClicked(int)),
|
||||
SLOT(toggleColumnWidth(int)));
|
||||
|
||||
m_alwaysAdjustColumns = false;
|
||||
|
||||
m_layoutTimer.setSingleShot(true);
|
||||
m_layoutTimer.setInterval(20);
|
||||
connect(&m_layoutTimer, SIGNAL(timeout()), this, SLOT(resizeColumnsFinish()));
|
||||
}
|
||||
|
||||
void BaseTreeView::setModel(QAbstractItemModel *model)
|
||||
void BaseTreeView::setModel(QAbstractItemModel *m)
|
||||
{
|
||||
disconnectColumnAdjustment();
|
||||
Utils::TreeView::setModel(model);
|
||||
connectColumnAdjustment();
|
||||
}
|
||||
|
||||
void BaseTreeView::connectColumnAdjustment()
|
||||
{
|
||||
if (m_alwaysAdjustColumns && model()) {
|
||||
connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(resizeColumns()));
|
||||
connect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(resizeColumns()));
|
||||
connect(model(), SIGNAL(layoutChanged()), this, SLOT(resizeColumns()));
|
||||
const char *sig = "columnAdjustmentRequested()";
|
||||
if (model()) {
|
||||
int index = model()->metaObject()->indexOfSignal(sig);
|
||||
if (index != -1)
|
||||
disconnect(model(), SIGNAL(columnAdjustmentRequested()), this, SLOT(resizeColumns()));
|
||||
}
|
||||
}
|
||||
|
||||
void BaseTreeView::disconnectColumnAdjustment()
|
||||
{
|
||||
if (m_alwaysAdjustColumns && model()) {
|
||||
disconnect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(resizeColumns()));
|
||||
disconnect(this, SIGNAL(collapsed(QModelIndex)), this, SLOT(resizeColumns()));
|
||||
disconnect(model(), SIGNAL(layoutChanged()), this, SLOT(resizeColumns()));
|
||||
Utils::TreeView::setModel(m);
|
||||
if (m) {
|
||||
int index = m->metaObject()->indexOfSignal(sig);
|
||||
if (index != -1)
|
||||
connect(m, SIGNAL(columnAdjustmentRequested()), this, SLOT(resizeColumns()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,61 +108,54 @@ void BaseTreeView::resizeColumns()
|
||||
QHeaderView *h = header();
|
||||
if (!h)
|
||||
return;
|
||||
const int n = h->count();
|
||||
if (n) {
|
||||
for (int i = 0; i != n; ++i)
|
||||
h->setResizeMode(i, QHeaderView::ResizeToContents);
|
||||
m_layoutTimer.start();
|
||||
|
||||
for (int i = 0, n = h->count(); i != n; ++i) {
|
||||
int targetSize = suggestedColumnSize(i);
|
||||
if (targetSize > 0)
|
||||
h->resizeSection(i, targetSize);
|
||||
}
|
||||
}
|
||||
|
||||
void BaseTreeView::resizeColumnsFinish()
|
||||
int BaseTreeView::suggestedColumnSize(int column) const
|
||||
{
|
||||
QHeaderView *h = header();
|
||||
if (!h)
|
||||
return;
|
||||
return -1;
|
||||
|
||||
QModelIndex a = indexAt(QPoint(1, 1));
|
||||
a = a.sibling(a.row(), column);
|
||||
QFontMetrics fm(font());
|
||||
for (int i = 0, n = h->count(); i != n; ++i) {
|
||||
int headerSize = fm.width(model()->headerData(i, Qt::Horizontal).toString());
|
||||
int targetSize = qMax(sizeHintForColumn(i), headerSize);
|
||||
if (targetSize > 0) {
|
||||
h->setResizeMode(i, QHeaderView::Interactive);
|
||||
h->resizeSection(i, targetSize);
|
||||
int m = fm.width(model()->headerData(column, Qt::Horizontal).toString());
|
||||
const int ind = indentation();
|
||||
for (int i = 0; i < 100 && a.isValid(); ++i) {
|
||||
const QString s = model()->data(a).toString();
|
||||
int w = fm.width(s) + 10;
|
||||
if (column == 0) {
|
||||
for (QModelIndex b = a.parent(); b.isValid(); b = b.parent())
|
||||
w += ind;
|
||||
}
|
||||
if (w > m)
|
||||
m = w;
|
||||
a = indexBelow(a);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
void BaseTreeView::toggleColumnWidth(int logicalIndex)
|
||||
{
|
||||
QHeaderView *h = header();
|
||||
const int currentSize = h->sectionSize(logicalIndex);
|
||||
if (currentSize == sizeHintForColumn(logicalIndex)) {
|
||||
const int suggestedSize = suggestedColumnSize(logicalIndex);
|
||||
if (currentSize == suggestedSize) {
|
||||
QFontMetrics fm(font());
|
||||
int headerSize = fm.width(model()->headerData(logicalIndex, Qt::Horizontal).toString());
|
||||
int minSize = 10 * fm.width(QLatin1Char('x'));
|
||||
h->resizeSection(logicalIndex, qMax(minSize, headerSize));
|
||||
} else {
|
||||
resizeColumnToContents(logicalIndex);
|
||||
h->resizeSection(logicalIndex, suggestedSize);
|
||||
}
|
||||
}
|
||||
|
||||
void BaseTreeView::reset()
|
||||
{
|
||||
Utils::TreeView::reset();
|
||||
if (m_alwaysAdjustColumns)
|
||||
resizeColumns();
|
||||
}
|
||||
|
||||
void BaseTreeView::setAlwaysAdjustColumns(bool on)
|
||||
{
|
||||
if (on == m_alwaysAdjustColumns)
|
||||
return;
|
||||
disconnectColumnAdjustment();
|
||||
m_alwaysAdjustColumns = on;
|
||||
connectColumnAdjustment();
|
||||
}
|
||||
|
||||
QModelIndexList BaseTreeView::activeRows() const
|
||||
{
|
||||
QItemSelectionModel *selection = selectionModel();
|
||||
|
@@ -34,8 +34,6 @@
|
||||
|
||||
#include "itemviews.h"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT BaseTreeView : public Utils::TreeView
|
||||
@@ -53,24 +51,16 @@ public:
|
||||
void mousePressEvent(QMouseEvent *ev);
|
||||
|
||||
public slots:
|
||||
void reset();
|
||||
|
||||
void resizeColumns();
|
||||
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
|
||||
void setAlwaysAdjustColumns(bool on);
|
||||
|
||||
private slots:
|
||||
void resizeColumnsFinish();
|
||||
void rowActivatedHelper(const QModelIndex &index) { rowActivated(index); }
|
||||
void rowClickedHelper(const QModelIndex &index) { rowClicked(index); }
|
||||
void toggleColumnWidth(int logicalIndex);
|
||||
|
||||
private:
|
||||
void connectColumnAdjustment();
|
||||
void disconnectColumnAdjustment();
|
||||
|
||||
bool m_alwaysAdjustColumns;
|
||||
QTimer m_layoutTimer;
|
||||
int suggestedColumnSize(int column) const;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
|
@@ -85,15 +85,6 @@ Utils::FileName BuildableHelperLibrary::findSystemQt(const Utils::Environment &e
|
||||
return Utils::FileName();
|
||||
}
|
||||
|
||||
QString BuildableHelperLibrary::qtInstallDataDir(const Utils::FileName &qmakePath)
|
||||
{
|
||||
QProcess proc;
|
||||
proc.start(qmakePath.toString(), QStringList() << QLatin1String("-query") << QLatin1String("QT_INSTALL_DATA"));
|
||||
if (proc.waitForFinished())
|
||||
return QString::fromLocal8Bit(proc.readAll()).trimmed();
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath)
|
||||
{
|
||||
bool qmakeIsExecutable;
|
||||
|
@@ -51,9 +51,6 @@ public:
|
||||
// returns something like qmake4, qmake, qmake-qt4 or whatever distributions have chosen (used by QtVersion)
|
||||
static QStringList possibleQMakeCommands();
|
||||
|
||||
static QString qtInstallHeadersDir(const QString &qmakePath);
|
||||
static QString qtInstallDataDir(const FileName &qmakePath);
|
||||
|
||||
static QString byInstallDataHelper(const QString &sourcePath,
|
||||
const QStringList &sourceFileNames,
|
||||
const QStringList &installDirectories,
|
||||
|
@@ -1,69 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "function.h"
|
||||
|
||||
namespace {
|
||||
// just compilation tests
|
||||
|
||||
void test();
|
||||
|
||||
void functionUser(Utils::function<int()> generator, Utils::function<void(int)> consumer)
|
||||
{
|
||||
consumer(generator());
|
||||
}
|
||||
|
||||
struct GenFunctor
|
||||
{
|
||||
int operator()() { return 29; }
|
||||
};
|
||||
|
||||
struct ConsumerFunctor
|
||||
{
|
||||
void operator()(int) {}
|
||||
};
|
||||
|
||||
int generatorF()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
|
||||
void consumerF(int i)
|
||||
{
|
||||
if (i < 0)
|
||||
test();
|
||||
}
|
||||
|
||||
void test()
|
||||
{
|
||||
functionUser(GenFunctor(), ConsumerFunctor());
|
||||
functionUser(&generatorF, &consumerF);
|
||||
}
|
||||
|
||||
} // end namespace
|
@@ -1,48 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QTC_FUNCTION_H
|
||||
#define QTC_FUNCTION_H
|
||||
|
||||
#include <functional>
|
||||
#if !(__cplusplus > 199711L || __GXX_EXPERIMENTAL_CXX0X__ || _MSC_VER >= 1600 || defined( _LIBCPP_VERSION )) || \
|
||||
(defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402))
|
||||
#define USE_TR1
|
||||
#endif
|
||||
|
||||
#ifdef USE_TR1
|
||||
# ifdef __GNUC__
|
||||
# include <tr1/functional>
|
||||
# endif
|
||||
namespace Utils { using std::tr1::function; }
|
||||
#else
|
||||
namespace Utils { using std::function; }
|
||||
#endif
|
||||
|
||||
#endif // QTC_FUNCTION_H
|
@@ -82,7 +82,6 @@ SOURCES += $$PWD/environment.cpp \
|
||||
$$PWD/tooltip/tips.cpp \
|
||||
$$PWD/tooltip/tipcontents.cpp \
|
||||
$$PWD/unixutils.cpp \
|
||||
$$PWD/function.cpp \
|
||||
$$PWD/ansiescapecodehandler.cpp \
|
||||
$$PWD/execmenu.cpp \
|
||||
$$PWD/completinglineedit.cpp \
|
||||
@@ -173,7 +172,6 @@ HEADERS += \
|
||||
$$PWD/tooltip/effects.h \
|
||||
$$PWD/unixutils.h \
|
||||
$$PWD/qtcoverride.h \
|
||||
$$PWD/function.h \
|
||||
$$PWD/ansiescapecodehandler.h \
|
||||
$$PWD/execmenu.h \
|
||||
$$PWD/completinglineedit.h \
|
||||
|
@@ -89,8 +89,6 @@ QtcLibrary {
|
||||
"filewizardpage.ui",
|
||||
"flowlayout.cpp",
|
||||
"flowlayout.h",
|
||||
"function.cpp",
|
||||
"function.h",
|
||||
"historycompleter.cpp",
|
||||
"historycompleter.h",
|
||||
"hostosinfo.h",
|
||||
|
@@ -460,7 +460,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(QString *error) const
|
||||
QVector<AndroidDeviceInfo> devices;
|
||||
QProcess adbProc;
|
||||
adbProc.start(adbToolPath().toString(), QStringList() << QLatin1String("devices"));
|
||||
if (!adbProc.waitForFinished(5000)) {
|
||||
if (!adbProc.waitForFinished(10000)) {
|
||||
adbProc.kill();
|
||||
if (error)
|
||||
*error = QApplication::translate("AndroidConfiguration",
|
||||
@@ -729,7 +729,7 @@ bool AndroidConfig::isBootToQt(const QString &device) const
|
||||
|
||||
QProcess adbProc;
|
||||
adbProc.start(adbToolPath().toString(), arguments);
|
||||
if (!adbProc.waitForFinished(5000)) {
|
||||
if (!adbProc.waitForFinished(10000)) {
|
||||
adbProc.kill();
|
||||
return false;
|
||||
}
|
||||
@@ -745,7 +745,7 @@ int AndroidConfig::getSDKVersion(const QString &device) const
|
||||
|
||||
QProcess adbProc;
|
||||
adbProc.start(adbToolPath().toString(), arguments);
|
||||
if (!adbProc.waitForFinished(5000)) {
|
||||
if (!adbProc.waitForFinished(10000)) {
|
||||
adbProc.kill();
|
||||
return -1;
|
||||
}
|
||||
@@ -768,7 +768,7 @@ QString AndroidConfig::getProductModel(const QString &device) const
|
||||
|
||||
QProcess adbProc;
|
||||
adbProc.start(adbToolPath().toString(), arguments);
|
||||
if (!adbProc.waitForFinished(5000)) {
|
||||
if (!adbProc.waitForFinished(10000)) {
|
||||
adbProc.kill();
|
||||
return device;
|
||||
}
|
||||
@@ -788,7 +788,7 @@ bool AndroidConfig::hasFinishedBooting(const QString &device) const
|
||||
|
||||
QProcess adbProc;
|
||||
adbProc.start(adbToolPath().toString(), arguments);
|
||||
if (!adbProc.waitForFinished(5000)) {
|
||||
if (!adbProc.waitForFinished(10000)) {
|
||||
adbProc.kill();
|
||||
return false;
|
||||
}
|
||||
@@ -811,7 +811,7 @@ QStringList AndroidConfig::getAbis(const QString &device) const
|
||||
|
||||
QProcess adbProc;
|
||||
adbProc.start(adbToolPath().toString(), arguments);
|
||||
if (!adbProc.waitForFinished(5000)) {
|
||||
if (!adbProc.waitForFinished(10000)) {
|
||||
adbProc.kill();
|
||||
return result;
|
||||
}
|
||||
|
@@ -281,7 +281,7 @@ unsigned int AndroidDeployStep::remoteModificationTime(const QString &fullDestin
|
||||
QStringList arguments = AndroidDeviceInfo::adbSelector(m_deviceSerialNumber);
|
||||
arguments << QLatin1String("ls") << destination;
|
||||
process.start(AndroidConfigurations::currentConfig().adbToolPath().toString(), arguments);
|
||||
if (!process.waitForFinished(5000)
|
||||
if (!process.waitForFinished(10000)
|
||||
|| process.exitCode() != 0)
|
||||
return 0;
|
||||
QByteArray output = process.readAll();
|
||||
|
@@ -240,7 +240,7 @@ void AndroidRunner::asyncStart()
|
||||
emit remoteProcessFinished(tr("Failed to forward C++ debugging ports. Reason: %1.").arg(adb.errorString()));
|
||||
return;
|
||||
}
|
||||
if (!adb.waitForFinished(5000)) {
|
||||
if (!adb.waitForFinished(10000)) {
|
||||
emit remoteProcessFinished(tr("Failed to forward C++ debugging ports."));
|
||||
return;
|
||||
}
|
||||
@@ -283,7 +283,7 @@ void AndroidRunner::asyncStart()
|
||||
emit remoteProcessFinished(tr("Failed to start the activity. Reason: %1.").arg(adb.errorString()));
|
||||
return;
|
||||
}
|
||||
if (!adb.waitForFinished(5000)) {
|
||||
if (!adb.waitForFinished(10000)) {
|
||||
adb.terminate();
|
||||
emit remoteProcessFinished(tr("Unable to start \"%1\".").arg(m_packageName));
|
||||
return;
|
||||
|
@@ -66,16 +66,10 @@ namespace Bookmarks {
|
||||
namespace Internal {
|
||||
|
||||
BookmarkDelegate::BookmarkDelegate(QObject *parent)
|
||||
: QStyledItemDelegate(parent), m_normalPixmap(0), m_selectedPixmap(0)
|
||||
: QStyledItemDelegate(parent)
|
||||
{
|
||||
}
|
||||
|
||||
BookmarkDelegate::~BookmarkDelegate()
|
||||
{
|
||||
delete m_normalPixmap;
|
||||
delete m_selectedPixmap;
|
||||
}
|
||||
|
||||
QSize BookmarkDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
@@ -90,14 +84,13 @@ QSize BookmarkDelegate::sizeHint(const QStyleOptionViewItem &option, const QMode
|
||||
|
||||
void BookmarkDelegate::generateGradientPixmap(int width, int height, const QColor &color, bool selected) const
|
||||
{
|
||||
|
||||
QColor c = color;
|
||||
c.setAlpha(0);
|
||||
|
||||
QPixmap *pixmap = new QPixmap(width+1, height);
|
||||
pixmap->fill(c);
|
||||
QPixmap pixmap(width+1, height);
|
||||
pixmap.fill(c);
|
||||
|
||||
QPainter painter(pixmap);
|
||||
QPainter painter(&pixmap);
|
||||
painter.setPen(Qt::NoPen);
|
||||
|
||||
QLinearGradient lg;
|
||||
@@ -154,7 +147,7 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
|
||||
|
||||
// TopLeft
|
||||
QString topLeft = index.data(BookmarkManager::Filename ).toString();
|
||||
QString topLeft = index.data(BookmarkManager::Filename).toString();
|
||||
painter->drawText(6, 2 + opt.rect.top() + fm.ascent(), topLeft);
|
||||
|
||||
QString topRight = index.data(BookmarkManager::LineNumber).toString();
|
||||
@@ -162,7 +155,7 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
int fwidth = fm.width(topLeft);
|
||||
if (fwidth + lwidth > opt.rect.width()) {
|
||||
int left = opt.rect.right() - lwidth;
|
||||
painter->drawPixmap(left, opt.rect.top(), selected? *m_selectedPixmap : *m_normalPixmap);
|
||||
painter->drawPixmap(left, opt.rect.top(), selected ? m_selectedPixmap : m_normalPixmap);
|
||||
}
|
||||
// topRight
|
||||
painter->drawText(opt.rect.right() - fm.width(topRight) - 6 , 2 + opt.rect.top() + fm.ascent(), topRight);
|
||||
@@ -213,24 +206,31 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
BookmarkView::BookmarkView(QWidget *parent) :
|
||||
Utils::ListView(parent),
|
||||
m_bookmarkContext(new BookmarkContext(this)),
|
||||
m_manager(0)
|
||||
BookmarkView::BookmarkView(BookmarkManager *manager) :
|
||||
m_bookmarkContext(new Core::IContext(this)),
|
||||
m_manager(manager)
|
||||
{
|
||||
setWindowTitle(tr("Bookmarks"));
|
||||
|
||||
connect(this, SIGNAL(clicked(QModelIndex)),
|
||||
this, SLOT(gotoBookmark(QModelIndex)));
|
||||
connect(this, SIGNAL(activated(QModelIndex)),
|
||||
this, SLOT(gotoBookmark(QModelIndex)));
|
||||
m_bookmarkContext->setWidget(this);
|
||||
m_bookmarkContext->setContext(Core::Context(Constants::BOOKMARKS_CONTEXT));
|
||||
|
||||
ICore::addContextObject(m_bookmarkContext);
|
||||
|
||||
Utils::ListView::setModel(manager);
|
||||
|
||||
setItemDelegate(new BookmarkDelegate(this));
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setFocusPolicy(Qt::NoFocus);
|
||||
setSelectionModel(manager->selectionModel());
|
||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
|
||||
connect(this, SIGNAL(clicked(QModelIndex)),
|
||||
this, SLOT(gotoBookmark(QModelIndex)));
|
||||
connect(this, SIGNAL(activated(QModelIndex)),
|
||||
this, SLOT(gotoBookmark(QModelIndex)));
|
||||
}
|
||||
|
||||
BookmarkView::~BookmarkView()
|
||||
@@ -311,17 +311,6 @@ void BookmarkView::removeAll()
|
||||
}
|
||||
}
|
||||
|
||||
void BookmarkView::setModel(QAbstractItemModel *model)
|
||||
{
|
||||
BookmarkManager *manager = qobject_cast<BookmarkManager *>(model);
|
||||
QTC_ASSERT(manager, return);
|
||||
m_manager = manager;
|
||||
Utils::ListView::setModel(model);
|
||||
setSelectionModel(manager->selectionModel());
|
||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
}
|
||||
|
||||
void BookmarkView::gotoBookmark(const QModelIndex &index)
|
||||
{
|
||||
Bookmark *bk = m_manager->bookmarkForIndex(index);
|
||||
@@ -329,17 +318,6 @@ void BookmarkView::gotoBookmark(const QModelIndex &index)
|
||||
m_manager->removeBookmark(bk);
|
||||
}
|
||||
|
||||
////
|
||||
// BookmarkContext
|
||||
////
|
||||
|
||||
BookmarkContext::BookmarkContext(QWidget *widget)
|
||||
: Core::IContext(widget)
|
||||
{
|
||||
setWidget(widget);
|
||||
setContext(Core::Context(Constants::BOOKMARKS_CONTEXT));
|
||||
}
|
||||
|
||||
////
|
||||
// BookmarkManager
|
||||
////
|
||||
@@ -414,15 +392,15 @@ QVariant BookmarkManager::data(const QModelIndex &index, int role) const
|
||||
|
||||
if (role == BookmarkManager::Filename)
|
||||
return m_bookmarksList.at(index.row())->fileName();
|
||||
else if (role == BookmarkManager::LineNumber)
|
||||
if (role == BookmarkManager::LineNumber)
|
||||
return m_bookmarksList.at(index.row())->lineNumber();
|
||||
else if (role == BookmarkManager::Directory)
|
||||
if (role == BookmarkManager::Directory)
|
||||
return m_bookmarksList.at(index.row())->path();
|
||||
else if (role == BookmarkManager::LineText)
|
||||
if (role == BookmarkManager::LineText)
|
||||
return m_bookmarksList.at(index.row())->lineText();
|
||||
else if (role == BookmarkManager::Note)
|
||||
if (role == BookmarkManager::Note)
|
||||
return m_bookmarksList.at(index.row())->note();
|
||||
else if (role == Qt::ToolTipRole)
|
||||
if (role == Qt::ToolTipRole)
|
||||
return QDir::toNativeSeparators(m_bookmarksList.at(index.row())->filePath());
|
||||
|
||||
return QVariant();
|
||||
@@ -521,20 +499,17 @@ void BookmarkManager::removeBookmark(Bookmark *bookmark)
|
||||
saveBookmarks();
|
||||
}
|
||||
|
||||
Bookmark *BookmarkManager::bookmarkForIndex(const QModelIndex &index)
|
||||
Bookmark *BookmarkManager::bookmarkForIndex(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid() || index.row() >= m_bookmarksList.size())
|
||||
return 0;
|
||||
return m_bookmarksList.at(index.row());
|
||||
}
|
||||
|
||||
|
||||
bool BookmarkManager::gotoBookmark(Bookmark *bookmark)
|
||||
{
|
||||
if (ITextEditor *editor = qobject_cast<ITextEditor *>(EditorManager::openEditorAt(bookmark->filePath(),
|
||||
bookmark->lineNumber()))) {
|
||||
return (editor->currentLine() == bookmark->lineNumber());
|
||||
}
|
||||
if (IEditor *editor = EditorManager::openEditorAt(bookmark->filePath(), bookmark->lineNumber()))
|
||||
return editor->currentLine() == bookmark->lineNumber();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -812,7 +787,7 @@ void BookmarkManager::saveBookmarks()
|
||||
SessionManager::setValue(QLatin1String("Bookmarks"), list);
|
||||
}
|
||||
|
||||
void BookmarkManager::operateTooltip(TextEditor::ITextEditor *textEditor, const QPoint &pos, Bookmark *mark)
|
||||
void BookmarkManager::operateTooltip(ITextEditor *textEditor, const QPoint &pos, Bookmark *mark)
|
||||
{
|
||||
if (!mark)
|
||||
return;
|
||||
@@ -834,15 +809,15 @@ void BookmarkManager::loadBookmarks()
|
||||
updateActionStatus();
|
||||
}
|
||||
|
||||
void BookmarkManager::handleBookmarkRequest(TextEditor::ITextEditor *textEditor,
|
||||
void BookmarkManager::handleBookmarkRequest(ITextEditor *textEditor,
|
||||
int line,
|
||||
TextEditor::ITextEditor::MarkRequestKind kind)
|
||||
ITextEditor::MarkRequestKind kind)
|
||||
{
|
||||
if (kind == TextEditor::ITextEditor::BookmarkRequest && textEditor->document())
|
||||
if (kind == ITextEditor::BookmarkRequest && textEditor->document())
|
||||
toggleBookmark(textEditor->document()->filePath(), line);
|
||||
}
|
||||
|
||||
void BookmarkManager::handleBookmarkTooltipRequest(TextEditor::ITextEditor *textEditor, const QPoint &pos,
|
||||
void BookmarkManager::handleBookmarkTooltipRequest(ITextEditor *textEditor, const QPoint &pos,
|
||||
int line)
|
||||
{
|
||||
if (textEditor->document()) {
|
||||
@@ -881,8 +856,7 @@ QKeySequence BookmarkViewFactory::activationSequence() const
|
||||
|
||||
Core::NavigationView BookmarkViewFactory::createWidget()
|
||||
{
|
||||
BookmarkView *bookmarkView = new BookmarkView();
|
||||
bookmarkView->setModel(m_manager);
|
||||
BookmarkView *bookmarkView = new BookmarkView(m_manager);
|
||||
Core::NavigationView view;
|
||||
view.widget = bookmarkView;
|
||||
return view;
|
||||
|
@@ -63,7 +63,7 @@ public:
|
||||
void updateBookmark(Bookmark *bookmark);
|
||||
void removeBookmark(Bookmark *bookmark); // Does not remove the mark
|
||||
void removeAllBookmarks();
|
||||
Bookmark *bookmarkForIndex(const QModelIndex &index);
|
||||
Bookmark *bookmarkForIndex(const QModelIndex &index) const;
|
||||
|
||||
enum State { NoBookMarks, HasBookMarks, HasBookmarksInDocument };
|
||||
State state() const;
|
||||
@@ -118,7 +118,7 @@ private slots:
|
||||
private:
|
||||
void documentPrevNext(bool next);
|
||||
|
||||
Bookmark* findBookmark(const QString &path, const QString &fileName, int lineNumber);
|
||||
Bookmark *findBookmark(const QString &path, const QString &fileName, int lineNumber);
|
||||
void addBookmark(Bookmark *bookmark, bool userset = true);
|
||||
void addBookmark(const QString &s);
|
||||
static QString bookmarkToString(const Bookmark *b);
|
||||
@@ -139,58 +139,60 @@ private:
|
||||
class BookmarkView : public Utils::ListView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BookmarkView(QWidget *parent = 0);
|
||||
explicit BookmarkView(BookmarkManager *manager);
|
||||
~BookmarkView();
|
||||
void setModel(QAbstractItemModel *model);
|
||||
|
||||
public slots:
|
||||
void gotoBookmark(const QModelIndex &index);
|
||||
|
||||
protected slots:
|
||||
void removeFromContextMenu();
|
||||
void removeAll();
|
||||
|
||||
protected:
|
||||
void contextMenuEvent(QContextMenuEvent *event);
|
||||
void removeBookmark(const QModelIndex &index);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
|
||||
private:
|
||||
BookmarkContext *m_bookmarkContext;
|
||||
Core::IContext *m_bookmarkContext;
|
||||
QModelIndex m_contextMenuIndex;
|
||||
BookmarkManager *m_manager;
|
||||
};
|
||||
|
||||
class BookmarkContext : public Core::IContext
|
||||
{
|
||||
public:
|
||||
BookmarkContext(QWidget *widget);
|
||||
};
|
||||
|
||||
class BookmarkViewFactory : public Core::INavigationWidgetFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BookmarkViewFactory(BookmarkManager *bm);
|
||||
|
||||
private:
|
||||
QString displayName() const;
|
||||
int priority() const;
|
||||
Core::Id id() const;
|
||||
QKeySequence activationSequence() const;
|
||||
Core::NavigationView createWidget();
|
||||
private:
|
||||
|
||||
BookmarkManager *m_manager;
|
||||
};
|
||||
|
||||
class BookmarkDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BookmarkDelegate(QObject * parent = 0);
|
||||
~BookmarkDelegate();
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
BookmarkDelegate(QObject *parent = 0);
|
||||
|
||||
private:
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
void generateGradientPixmap(int width, int height, const QColor &color, bool selected) const;
|
||||
mutable QPixmap *m_normalPixmap;
|
||||
mutable QPixmap *m_selectedPixmap;
|
||||
|
||||
mutable QPixmap m_normalPixmap;
|
||||
mutable QPixmap m_selectedPixmap;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -52,13 +52,10 @@ using namespace Bookmarks::Constants;
|
||||
using namespace Bookmarks::Internal;
|
||||
using namespace TextEditor;
|
||||
|
||||
BookmarksPlugin *BookmarksPlugin::m_instance = 0;
|
||||
|
||||
BookmarksPlugin::BookmarksPlugin()
|
||||
: m_bookmarkManager(0),
|
||||
m_bookmarkMarginActionLineNumber(0)
|
||||
{
|
||||
m_instance = this;
|
||||
}
|
||||
|
||||
void BookmarksPlugin::extensionsInitialized()
|
||||
|
@@ -58,8 +58,6 @@ public:
|
||||
BookmarksPlugin();
|
||||
~BookmarksPlugin();
|
||||
|
||||
static BookmarksPlugin *instance() { return m_instance; }
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorMessage);
|
||||
void extensionsInitialized();
|
||||
|
||||
|
@@ -1,45 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "cmakehighlighterfactory.h"
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakehighlighter.h"
|
||||
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
|
||||
CMakeHighlighterFactory::CMakeHighlighterFactory()
|
||||
{
|
||||
setId(CMakeProjectManager::Constants::CMAKE_EDITOR_ID);
|
||||
addMimeType(CMakeProjectManager::Constants::CMAKEMIMETYPE);
|
||||
}
|
||||
|
||||
TextEditor::SyntaxHighlighter *CMakeHighlighterFactory::createHighlighter() const
|
||||
{
|
||||
return new CMakeHighlighter;
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CMAKEHIGHLIGHTERFACTORY_H
|
||||
#define CMAKEHIGHLIGHTERFACTORY_H
|
||||
|
||||
#include <texteditor/ihighlighterfactory.h>
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class CMakeHighlighterFactory : public TextEditor::IHighlighterFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CMakeHighlighterFactory();
|
||||
|
||||
virtual TextEditor::SyntaxHighlighter *createHighlighter() const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace CMakeProjectManager
|
||||
|
||||
#endif // CMAKEHIGHLIGHTERFACTORY_H
|
@@ -737,10 +737,12 @@ void CMakeProject::updateApplicationAndDeploymentTargets()
|
||||
QString absoluteSourcePath = sourceDir.absolutePath();
|
||||
if (!absoluteSourcePath.endsWith(QLatin1Char('/')))
|
||||
absoluteSourcePath.append(QLatin1Char('/'));
|
||||
if (deploymentStream.device()) {
|
||||
while (!deploymentStream.atEnd()) {
|
||||
QStringList file = deploymentStream.readLine().split(QLatin1Char(':'));
|
||||
deploymentData.addFile(absoluteSourcePath + file.at(0), deploymentPrefix + file.at(1));
|
||||
}
|
||||
}
|
||||
|
||||
t->setApplicationTargets(appTargetList);
|
||||
t->setDeploymentData(deploymentData);
|
||||
|
@@ -13,7 +13,6 @@ HEADERS = cmakebuildinfo.h \
|
||||
cmakeeditorfactory.h \
|
||||
cmakeeditor.h \
|
||||
cmakehighlighter.h \
|
||||
cmakehighlighterfactory.h \
|
||||
cmakelocatorfilter.h \
|
||||
cmakefilecompletionassist.h \
|
||||
cmaketool.h \
|
||||
@@ -32,7 +31,6 @@ SOURCES = cmakeproject.cpp \
|
||||
cmakeeditorfactory.cpp \
|
||||
cmakeeditor.cpp \
|
||||
cmakehighlighter.cpp \
|
||||
cmakehighlighterfactory.cpp \
|
||||
cmakelocatorfilter.cpp \
|
||||
cmakefilecompletionassist.cpp \
|
||||
cmaketool.cpp \
|
||||
|
@@ -32,8 +32,6 @@ QtcPlugin {
|
||||
"cmakefilecompletionassist.h",
|
||||
"cmakehighlighter.cpp",
|
||||
"cmakehighlighter.h",
|
||||
"cmakehighlighterfactory.cpp",
|
||||
"cmakehighlighterfactory.h",
|
||||
"cmakelocatorfilter.cpp",
|
||||
"cmakelocatorfilter.h",
|
||||
"cmakeopenprojectwizard.cpp",
|
||||
|
@@ -36,11 +36,12 @@
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakelocatorfilter.h"
|
||||
#include "cmakefilecompletionassist.h"
|
||||
#include "cmakehighlighterfactory.h"
|
||||
#include "cmakehighlighter.h"
|
||||
|
||||
#include <coreplugin/featureprovider.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
#include <texteditor/highlighterfactory.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QDebug>
|
||||
@@ -82,7 +83,13 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
|
||||
addAutoReleasedObject(new CMakeLocatorFilter);
|
||||
addAutoReleasedObject(new CMakeFileCompletionAssistProvider(cmp));
|
||||
addAutoReleasedObject(new CMakeFeatureProvider);
|
||||
addAutoReleasedObject(new CMakeHighlighterFactory);
|
||||
|
||||
auto hf = new TextEditor::HighlighterFactory;
|
||||
hf->setProductType<CMakeHighlighter>();
|
||||
hf->setId(CMakeProjectManager::Constants::CMAKE_EDITOR_ID);
|
||||
hf->addMimeType(CMakeProjectManager::Constants::CMAKEMIMETYPE);
|
||||
addAutoReleasedObject(hf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -206,7 +206,6 @@ FORMS += dialogs/newdialog.ui \
|
||||
dialogs/openwithdialog.ui \
|
||||
generalsettings.ui \
|
||||
dialogs/externaltoolconfig.ui \
|
||||
variablechooser.ui \
|
||||
mimetypesettingspage.ui \
|
||||
mimetypemagicdialog.ui \
|
||||
removefiledialog.ui \
|
||||
|
@@ -90,7 +90,7 @@ QtcPlugin {
|
||||
"tabpositionindicator.cpp", "tabpositionindicator.h",
|
||||
"textdocument.cpp", "textdocument.h",
|
||||
"toolsettings.cpp", "toolsettings.h",
|
||||
"variablechooser.cpp", "variablechooser.h", "variablechooser.ui",
|
||||
"variablechooser.cpp", "variablechooser.h",
|
||||
"variablemanager.cpp", "variablemanager.h",
|
||||
"vcsmanager.cpp", "vcsmanager.h",
|
||||
"versiondialog.cpp", "versiondialog.h",
|
||||
|
@@ -28,20 +28,101 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "variablechooser.h"
|
||||
#include "ui_variablechooser.h"
|
||||
#include "variablemanager.h"
|
||||
#include "coreconstants.h"
|
||||
|
||||
#include <utils/fancylineedit.h> // IconButton
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QTimer>
|
||||
#include <QApplication>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QTextEdit>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QListWidget>
|
||||
#include <QListWidgetItem>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QPointer>
|
||||
#include <QTextEdit>
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
using namespace Core;
|
||||
namespace Core {
|
||||
namespace Internal {
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
*/
|
||||
class VariableChooserPrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
VariableChooserPrivate(VariableChooser *parent)
|
||||
: q(parent),
|
||||
m_defaultDescription(tr("Select a variable to insert.")),
|
||||
m_lineEdit(0),
|
||||
m_textEdit(0),
|
||||
m_plainTextEdit(0)
|
||||
{
|
||||
m_variableList = new QListWidget(q);
|
||||
m_variableList->setAttribute(Qt::WA_MacSmallSize);
|
||||
m_variableList->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
foreach (const QByteArray &variable, VariableManager::variables())
|
||||
m_variableList->addItem(QString::fromLatin1(variable));
|
||||
|
||||
m_variableDescription = new QLabel(q);
|
||||
m_variableDescription->setText(m_defaultDescription);
|
||||
m_variableDescription->setMinimumSize(QSize(0, 60));
|
||||
m_variableDescription->setAlignment(Qt::AlignLeft|Qt::AlignTop);
|
||||
m_variableDescription->setWordWrap(true);
|
||||
m_variableDescription->setAttribute(Qt::WA_MacSmallSize);
|
||||
|
||||
QVBoxLayout *verticalLayout = new QVBoxLayout(q);
|
||||
verticalLayout->setContentsMargins(3, 3, 3, 12);
|
||||
verticalLayout->addWidget(m_variableList);
|
||||
verticalLayout->addWidget(m_variableDescription);
|
||||
|
||||
connect(m_variableList, SIGNAL(currentTextChanged(QString)),
|
||||
this, SLOT(updateDescription(QString)));
|
||||
connect(m_variableList, SIGNAL(itemActivated(QListWidgetItem*)),
|
||||
this, SLOT(handleItemActivated(QListWidgetItem*)));
|
||||
connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)),
|
||||
this, SLOT(updateCurrentEditor(QWidget*,QWidget*)));
|
||||
updateCurrentEditor(0, qApp->focusWidget());
|
||||
}
|
||||
|
||||
void createIconButton()
|
||||
{
|
||||
m_iconButton = new Utils::IconButton;
|
||||
m_iconButton->setPixmap(QPixmap(QLatin1String(":/core/images/replace.png")));
|
||||
m_iconButton->setToolTip(tr("Insert variable"));
|
||||
m_iconButton->hide();
|
||||
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(updatePositionAndShow()));
|
||||
}
|
||||
|
||||
public slots:
|
||||
void updateDescription(const QString &variable);
|
||||
void updateCurrentEditor(QWidget *old, QWidget *widget);
|
||||
void handleItemActivated(QListWidgetItem *item);
|
||||
void insertVariable(const QString &variable);
|
||||
void updatePositionAndShow();
|
||||
|
||||
public:
|
||||
QWidget *currentWidget();
|
||||
|
||||
VariableChooser *q;
|
||||
QString m_defaultDescription;
|
||||
QPointer<QLineEdit> m_lineEdit;
|
||||
QPointer<QTextEdit> m_textEdit;
|
||||
QPointer<QPlainTextEdit> m_plainTextEdit;
|
||||
QPointer<Utils::IconButton> m_iconButton;
|
||||
|
||||
QListWidget *m_variableList;
|
||||
QLabel *m_variableDescription;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
using namespace Internal;
|
||||
|
||||
/*!
|
||||
* \class Core::VariableChooser
|
||||
@@ -92,30 +173,12 @@ const char VariableChooser::kVariableSupportProperty[] = "QtCreator.VariableSupp
|
||||
*/
|
||||
VariableChooser::VariableChooser(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Internal::Ui::VariableChooser),
|
||||
m_lineEdit(0),
|
||||
m_textEdit(0),
|
||||
m_plainTextEdit(0)
|
||||
d(new VariableChooserPrivate(this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
m_defaultDescription = ui->variableDescription->text();
|
||||
ui->variableList->setAttribute(Qt::WA_MacSmallSize);
|
||||
ui->variableList->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
ui->variableDescription->setAttribute(Qt::WA_MacSmallSize);
|
||||
setWindowTitle(tr("Variables"));
|
||||
setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setFocusProxy(ui->variableList);
|
||||
|
||||
foreach (const QByteArray &variable, VariableManager::variables())
|
||||
ui->variableList->addItem(QString::fromLatin1(variable));
|
||||
|
||||
connect(ui->variableList, SIGNAL(currentTextChanged(QString)),
|
||||
this, SLOT(updateDescription(QString)));
|
||||
connect(ui->variableList, SIGNAL(itemActivated(QListWidgetItem*)),
|
||||
this, SLOT(handleItemActivated(QListWidgetItem*)));
|
||||
connect(qApp, SIGNAL(focusChanged(QWidget*,QWidget*)),
|
||||
this, SLOT(updateCurrentEditor(QWidget*,QWidget*)));
|
||||
updateCurrentEditor(0, qApp->focusWidget());
|
||||
setFocusProxy(d->m_variableList);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -123,8 +186,8 @@ VariableChooser::VariableChooser(QWidget *parent) :
|
||||
*/
|
||||
VariableChooser::~VariableChooser()
|
||||
{
|
||||
delete m_iconButton;
|
||||
delete ui;
|
||||
delete d->m_iconButton;
|
||||
delete d;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -140,19 +203,19 @@ void VariableChooser::addVariableSupport(QWidget *textcontrol)
|
||||
/*!
|
||||
* \internal
|
||||
*/
|
||||
void VariableChooser::updateDescription(const QString &variable)
|
||||
void VariableChooserPrivate::updateDescription(const QString &variable)
|
||||
{
|
||||
if (variable.isNull())
|
||||
ui->variableDescription->setText(m_defaultDescription);
|
||||
m_variableDescription->setText(m_defaultDescription);
|
||||
else
|
||||
ui->variableDescription->setText(VariableManager::variableDescription(variable.toUtf8())
|
||||
m_variableDescription->setText(VariableManager::variableDescription(variable.toUtf8())
|
||||
+ QLatin1String("<p>") + tr("Current Value: %1").arg(VariableManager::value(variable.toUtf8())));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
*/
|
||||
void VariableChooser::updateCurrentEditor(QWidget *old, QWidget *widget)
|
||||
void VariableChooserPrivate::updateCurrentEditor(QWidget *old, QWidget *widget)
|
||||
{
|
||||
if (old)
|
||||
old->removeEventFilter(this);
|
||||
@@ -162,9 +225,9 @@ void VariableChooser::updateCurrentEditor(QWidget *old, QWidget *widget)
|
||||
bool handle = false;
|
||||
QWidget *parent = widget;
|
||||
while (parent) {
|
||||
if (parent == this)
|
||||
if (parent == q)
|
||||
return;
|
||||
if (parent == this->parentWidget()) {
|
||||
if (parent == q->parentWidget()) {
|
||||
handle = true;
|
||||
break;
|
||||
}
|
||||
@@ -178,7 +241,7 @@ void VariableChooser::updateCurrentEditor(QWidget *old, QWidget *widget)
|
||||
m_lineEdit = 0;
|
||||
m_textEdit = 0;
|
||||
m_plainTextEdit = 0;
|
||||
QVariant variablesSupportProperty = widget->property(kVariableSupportProperty);
|
||||
QVariant variablesSupportProperty = widget->property(VariableChooser::kVariableSupportProperty);
|
||||
bool supportsVariables = (variablesSupportProperty.isValid()
|
||||
? variablesSupportProperty.toBool() : false);
|
||||
if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget))
|
||||
@@ -188,7 +251,7 @@ void VariableChooser::updateCurrentEditor(QWidget *old, QWidget *widget)
|
||||
else if (QPlainTextEdit *plainTextEdit = qobject_cast<QPlainTextEdit *>(widget))
|
||||
m_plainTextEdit = (supportsVariables ? plainTextEdit : 0);
|
||||
if (!(m_lineEdit || m_textEdit || m_plainTextEdit))
|
||||
hide();
|
||||
q->hide();
|
||||
|
||||
QWidget *current = currentWidget();
|
||||
if (current != previousWidget) {
|
||||
@@ -202,7 +265,7 @@ void VariableChooser::updateCurrentEditor(QWidget *old, QWidget *widget)
|
||||
if (!m_iconButton)
|
||||
createIconButton();
|
||||
int margin = m_iconButton->pixmap().width() + 8;
|
||||
if (style()->inherits("OxygenStyle"))
|
||||
if (q->style()->inherits("OxygenStyle"))
|
||||
margin = qMax(24, margin);
|
||||
if (m_lineEdit)
|
||||
m_lineEdit->setTextMargins(0, 0, margin, 0);
|
||||
@@ -215,36 +278,25 @@ void VariableChooser::updateCurrentEditor(QWidget *old, QWidget *widget)
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
*/
|
||||
void VariableChooser::createIconButton()
|
||||
{
|
||||
m_iconButton = new Utils::IconButton;
|
||||
m_iconButton->setPixmap(QPixmap(QLatin1String(":/core/images/replace.png")));
|
||||
m_iconButton->setToolTip(tr("Insert variable"));
|
||||
m_iconButton->hide();
|
||||
connect(m_iconButton, SIGNAL(clicked()), this, SLOT(updatePositionAndShow()));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
*/
|
||||
void VariableChooser::updatePositionAndShow()
|
||||
void VariableChooserPrivate::updatePositionAndShow()
|
||||
{
|
||||
if (parentWidget()) {
|
||||
QPoint parentCenter = parentWidget()->mapToGlobal(parentWidget()->geometry().center());
|
||||
move(parentCenter.x() - width()/2, parentCenter.y() - height()/2);
|
||||
if (QWidget *w = q->parentWidget()) {
|
||||
QPoint parentCenter = w->mapToGlobal(w->geometry().center());
|
||||
q->move(parentCenter.x() - q->width()/2, parentCenter.y() - q->height()/2);
|
||||
}
|
||||
show();
|
||||
raise();
|
||||
activateWindow();
|
||||
q->show();
|
||||
q->raise();
|
||||
q->activateWindow();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
*/
|
||||
QWidget *VariableChooser::currentWidget()
|
||||
QWidget *VariableChooserPrivate::currentWidget()
|
||||
{
|
||||
if (m_lineEdit)
|
||||
return m_lineEdit;
|
||||
@@ -256,7 +308,7 @@ QWidget *VariableChooser::currentWidget()
|
||||
/*!
|
||||
* \internal
|
||||
*/
|
||||
void VariableChooser::handleItemActivated(QListWidgetItem *item)
|
||||
void VariableChooserPrivate::handleItemActivated(QListWidgetItem *item)
|
||||
{
|
||||
if (item)
|
||||
insertVariable(item->text());
|
||||
@@ -265,7 +317,7 @@ void VariableChooser::handleItemActivated(QListWidgetItem *item)
|
||||
/*!
|
||||
* \internal
|
||||
*/
|
||||
void VariableChooser::insertVariable(const QString &variable)
|
||||
void VariableChooserPrivate::insertVariable(const QString &variable)
|
||||
{
|
||||
const QString &text = QLatin1String("%{") + variable + QLatin1String("}");
|
||||
if (m_lineEdit) {
|
||||
@@ -312,3 +364,7 @@ bool VariableChooser::eventFilter(QObject *, QEvent *event)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
#include "variablechooser.moc"
|
||||
|
@@ -32,21 +32,11 @@
|
||||
|
||||
#include "core_global.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLineEdit;
|
||||
class QTextEdit;
|
||||
class QPlainTextEdit;
|
||||
class QListWidgetItem;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class IconButton; }
|
||||
|
||||
namespace Core {
|
||||
|
||||
namespace Internal { namespace Ui { class VariableChooser; } }
|
||||
namespace Internal { class VariableChooserPrivate; }
|
||||
|
||||
class CORE_EXPORT VariableChooser : public QWidget
|
||||
{
|
||||
@@ -63,23 +53,8 @@ protected:
|
||||
void keyPressEvent(QKeyEvent *ke);
|
||||
bool eventFilter(QObject *, QEvent *event);
|
||||
|
||||
private slots:
|
||||
void updateDescription(const QString &variable);
|
||||
void updateCurrentEditor(QWidget *old, QWidget *widget);
|
||||
void handleItemActivated(QListWidgetItem *item);
|
||||
void insertVariable(const QString &variable);
|
||||
void updatePositionAndShow();
|
||||
|
||||
private:
|
||||
QWidget *currentWidget();
|
||||
void createIconButton();
|
||||
|
||||
Internal::Ui::VariableChooser *ui;
|
||||
QString m_defaultDescription;
|
||||
QPointer<QLineEdit> m_lineEdit;
|
||||
QPointer<QTextEdit> m_textEdit;
|
||||
QPointer<QPlainTextEdit> m_plainTextEdit;
|
||||
QPointer<Utils::IconButton> m_iconButton;
|
||||
Internal::VariableChooserPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Core::Internal::VariableChooser</class>
|
||||
<widget class="QWidget" name="Core::Internal::VariableChooser">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>218</width>
|
||||
<height>321</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Variables</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListWidget" name="variableList"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="variableDescription">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select a variable to insert.</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@@ -19,7 +19,6 @@ HEADERS += \
|
||||
cppfollowsymbolundercursor.h \
|
||||
cppfunctiondecldeflink.h \
|
||||
cpphighlighter.h \
|
||||
cpphighlighterfactory.h \
|
||||
cpphoverhandler.h \
|
||||
cppincludehierarchy.h \
|
||||
cppincludehierarchyitem.h \
|
||||
@@ -52,7 +51,6 @@ SOURCES += \
|
||||
cppfollowsymbolundercursor.cpp \
|
||||
cppfunctiondecldeflink.cpp \
|
||||
cpphighlighter.cpp \
|
||||
cpphighlighterfactory.cpp \
|
||||
cpphoverhandler.cpp \
|
||||
cppincludehierarchy.cpp \
|
||||
cppincludehierarchyitem.cpp \
|
||||
|
@@ -37,7 +37,6 @@ QtcPlugin {
|
||||
"cppfollowsymbolundercursor.cpp", "cppfollowsymbolundercursor.h",
|
||||
"cppfunctiondecldeflink.cpp", "cppfunctiondecldeflink.h",
|
||||
"cpphighlighter.cpp", "cpphighlighter.h",
|
||||
"cpphighlighterfactory.cpp", "cpphighlighterfactory.h",
|
||||
"cpphoverhandler.cpp", "cpphoverhandler.h",
|
||||
"cppincludehierarchy.cpp", "cppincludehierarchy.h",
|
||||
"cppincludehierarchyitem.cpp", "cppincludehierarchyitem.h",
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include "cppeditor.h"
|
||||
#include "cppeditoroutline.h"
|
||||
#include "cppfilewizard.h"
|
||||
#include "cpphighlighterfactory.h"
|
||||
#include "cpphighlighter.h"
|
||||
#include "cpphoverhandler.h"
|
||||
#include "cppincludehierarchy.h"
|
||||
#include "cppoutline.h"
|
||||
@@ -55,6 +55,7 @@
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/highlighterfactory.h>
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
@@ -165,7 +166,15 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
|
||||
addAutoReleasedObject(new CppTypeHierarchyFactory);
|
||||
addAutoReleasedObject(new CppIncludeHierarchyFactory);
|
||||
addAutoReleasedObject(new CppSnippetProvider);
|
||||
addAutoReleasedObject(new CppHighlighterFactory);
|
||||
|
||||
auto hf = new TextEditor::HighlighterFactory;
|
||||
hf->setProductType<CppHighlighter>();
|
||||
hf->setId(CppEditor::Constants::CPPEDITOR_ID);
|
||||
hf->addMimeType(CppEditor::Constants::C_SOURCE_MIMETYPE);
|
||||
hf->addMimeType(CppEditor::Constants::C_HEADER_MIMETYPE);
|
||||
hf->addMimeType(CppEditor::Constants::CPP_SOURCE_MIMETYPE);
|
||||
hf->addMimeType(CppEditor::Constants::CPP_HEADER_MIMETYPE);
|
||||
addAutoReleasedObject(hf);
|
||||
|
||||
m_quickFixProvider = new CppQuickFixAssistProvider;
|
||||
addAutoReleasedObject(m_quickFixProvider);
|
||||
|
@@ -1,48 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "cpphighlighterfactory.h"
|
||||
#include "cppeditorconstants.h"
|
||||
#include "cpphighlighter.h"
|
||||
|
||||
using namespace CppEditor::Internal;
|
||||
|
||||
CppHighlighterFactory::CppHighlighterFactory()
|
||||
{
|
||||
setId(CppEditor::Constants::CPPEDITOR_ID);
|
||||
addMimeType(CppEditor::Constants::C_SOURCE_MIMETYPE);
|
||||
addMimeType(CppEditor::Constants::C_HEADER_MIMETYPE);
|
||||
addMimeType(CppEditor::Constants::CPP_SOURCE_MIMETYPE);
|
||||
addMimeType(CppEditor::Constants::CPP_HEADER_MIMETYPE);
|
||||
}
|
||||
|
||||
TextEditor::SyntaxHighlighter *CppHighlighterFactory::createHighlighter() const
|
||||
{
|
||||
return new CppHighlighter;
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CPPHIGHLIGHTERFACTORY_H
|
||||
#define CPPHIGHLIGHTERFACTORY_H
|
||||
|
||||
#include <texteditor/ihighlighterfactory.h>
|
||||
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CppHighlighterFactory : public TextEditor::IHighlighterFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CppHighlighterFactory();
|
||||
|
||||
virtual TextEditor::SyntaxHighlighter *createHighlighter() const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace CppEditor
|
||||
|
||||
#endif // CPPHIGHLIGHTERFACTORY_H
|
@@ -113,10 +113,8 @@ CppOutlineWidget::CppOutlineWidget(CPPEditorWidget *editor) :
|
||||
|
||||
connect(m_editor->outline(), SIGNAL(modelIndexChanged(QModelIndex)),
|
||||
this, SLOT(updateSelectionInTree(QModelIndex)));
|
||||
connect(m_treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||
this, SLOT(updateSelectionInText(QItemSelection)));
|
||||
connect(m_treeView, SIGNAL(activated(QModelIndex)),
|
||||
this, SLOT(focusEditor()));
|
||||
this, SLOT(onItemActivated(QModelIndex)));
|
||||
}
|
||||
|
||||
QList<QAction*> CppOutlineWidget::filterMenuActions() const
|
||||
@@ -152,17 +150,6 @@ void CppOutlineWidget::updateSelectionInTree(const QModelIndex &index)
|
||||
m_blockCursorSync = false;
|
||||
}
|
||||
|
||||
void CppOutlineWidget::updateSelectionInText(const QItemSelection &selection)
|
||||
{
|
||||
if (!syncCursor())
|
||||
return;
|
||||
|
||||
if (!selection.indexes().isEmpty()) {
|
||||
QModelIndex proxyIndex = selection.indexes().first();
|
||||
updateTextCursor(proxyIndex);
|
||||
}
|
||||
}
|
||||
|
||||
void CppOutlineWidget::updateTextCursor(const QModelIndex &proxyIndex)
|
||||
{
|
||||
QModelIndex index = m_proxyModel->mapToSource(proxyIndex);
|
||||
@@ -182,8 +169,12 @@ void CppOutlineWidget::updateTextCursor(const QModelIndex &proxyIndex)
|
||||
}
|
||||
}
|
||||
|
||||
void CppOutlineWidget::focusEditor()
|
||||
void CppOutlineWidget::onItemActivated(const QModelIndex &index)
|
||||
{
|
||||
if (!index.isValid())
|
||||
return;
|
||||
|
||||
updateTextCursor(index);
|
||||
m_editor->setFocus();
|
||||
}
|
||||
|
||||
|
@@ -77,9 +77,8 @@ public:
|
||||
private slots:
|
||||
void modelUpdated();
|
||||
void updateSelectionInTree(const QModelIndex &index);
|
||||
void updateSelectionInText(const QItemSelection &selection);
|
||||
void updateTextCursor(const QModelIndex &index);
|
||||
void focusEditor();
|
||||
void onItemActivated(const QModelIndex &index);
|
||||
|
||||
private:
|
||||
bool syncCursor();
|
||||
|
@@ -5,7 +5,6 @@
|
||||
|
||||
#include <cplusplus/PreprocessorEnvironment.h>
|
||||
#include <cplusplus/pp-engine.h>
|
||||
#include <utils/function.h>
|
||||
#include <utils/qtcoverride.h>
|
||||
|
||||
#include <QHash>
|
||||
@@ -13,6 +12,8 @@
|
||||
#include <QSet>
|
||||
#include <QStringList>
|
||||
|
||||
#include <functional>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QTextCodec;
|
||||
QT_END_NAMESPACE
|
||||
|
@@ -32,8 +32,6 @@
|
||||
|
||||
#include "cpptools_global.h"
|
||||
|
||||
#include <utils/function.h>
|
||||
|
||||
#include <QIcon>
|
||||
#include <QSharedPointer>
|
||||
#include <QMetaType>
|
||||
|
@@ -360,7 +360,7 @@ DebuggerSettings::DebuggerSettings()
|
||||
insertItem(LoadGdbInit, item);
|
||||
|
||||
item = new SavedAction(this);
|
||||
item->setSettingsKey(debugModeGroup, QLatin1String("LoadGdbDumpers"));
|
||||
item->setSettingsKey(debugModeGroup, QLatin1String("LoadGdbDumpers1"));
|
||||
item->setDefaultValue(QString());
|
||||
item->setCheckable(true);
|
||||
item->setDefaultValue(true);
|
||||
|
@@ -531,20 +531,13 @@ public:
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
static QWidget *addSearch(BaseTreeView *treeView, const QString &title,
|
||||
const char *objectName, bool adjustColumns = false)
|
||||
const char *objectName)
|
||||
{
|
||||
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
|
||||
treeView->setAlternatingRowColors(act->isChecked());
|
||||
QObject::connect(act, SIGNAL(toggled(bool)),
|
||||
treeView, SLOT(setAlternatingRowColorsHelper(bool)));
|
||||
|
||||
if (adjustColumns) {
|
||||
act = debuggerCore()->action(AlwaysAdjustColumnWidths);
|
||||
treeView->setAlwaysAdjustColumns(act->isChecked());
|
||||
QObject::connect(act, SIGNAL(toggled(bool)),
|
||||
treeView, SLOT(setAlwaysAdjustColumns(bool)));
|
||||
}
|
||||
|
||||
QWidget *widget = TreeViewFind::createSearchableWrapper(treeView);
|
||||
widget->setObjectName(QLatin1String(objectName));
|
||||
widget->setWindowTitle(title);
|
||||
@@ -2815,16 +2808,16 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
m_threadsWindow = addSearch(m_threadsView, tr("Threads"), DOCKWIDGET_THREADS);
|
||||
|
||||
m_returnView = new WatchTreeView(ReturnType);
|
||||
m_returnWindow = addSearch(m_returnView, tr("Locals and Expressions"), "CppDebugReturn", true);
|
||||
m_returnWindow = addSearch(m_returnView, tr("Locals and Expressions"), "CppDebugReturn");
|
||||
|
||||
m_localsView = new WatchTreeView(LocalsType);
|
||||
m_localsWindow = addSearch(m_localsView, tr("Locals and Expressions"), "CppDebugLocals", true);
|
||||
m_localsWindow = addSearch(m_localsView, tr("Locals and Expressions"), "CppDebugLocals");
|
||||
|
||||
m_watchersView = new WatchTreeView(WatchersType);
|
||||
m_watchersWindow = addSearch(m_watchersView, tr("Locals and Expressions"), "CppDebugWatchers", true);
|
||||
m_watchersWindow = addSearch(m_watchersView, tr("Locals and Expressions"), "CppDebugWatchers");
|
||||
|
||||
m_inspectorView = new WatchTreeView(InspectType);
|
||||
m_inspectorWindow = addSearch(m_inspectorView, tr("Locals and Expressions"), "Inspector", true);
|
||||
m_inspectorWindow = addSearch(m_inspectorView, tr("Locals and Expressions"), "Inspector");
|
||||
|
||||
// Snapshot
|
||||
m_snapshotHandler = new SnapshotHandler;
|
||||
|
@@ -53,7 +53,7 @@ namespace Internal {
|
||||
*/
|
||||
|
||||
MemoryView::MemoryView(QWidget *binEditor, QWidget *parent) :
|
||||
QWidget(parent, Qt::Tool|Qt::WindowStaysOnTopHint), m_binEditor(binEditor)
|
||||
QWidget(parent, Qt::Tool), m_binEditor(binEditor)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
|
@@ -242,6 +242,7 @@ public:
|
||||
signals:
|
||||
void currentIndexRequested(const QModelIndex &idx);
|
||||
void itemIsExpanded(const QModelIndex &idx);
|
||||
void columnAdjustmentRequested();
|
||||
|
||||
private:
|
||||
QVariant data(const QModelIndex &idx, int role) const;
|
||||
@@ -1248,6 +1249,7 @@ bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role
|
||||
} else {
|
||||
m_expandedINames.remove(data.iname);
|
||||
}
|
||||
emit columnAdjustmentRequested();
|
||||
break;
|
||||
|
||||
case LocalsTypeFormatRole:
|
||||
@@ -1566,6 +1568,7 @@ void WatchModel::insertBulkData(const QList<WatchData> &list)
|
||||
insertDataItem(list.at(i), false);
|
||||
#endif
|
||||
CHECK(checkTree());
|
||||
emit columnAdjustmentRequested();
|
||||
}
|
||||
|
||||
static void debugRecursion(QDebug &d, const WatchItem *item, int depth)
|
||||
|
@@ -754,6 +754,8 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
||||
|
||||
QAction actSetWatchpointAtObjectAddress(0);
|
||||
QAction actSetWatchpointAtPointerAddress(0);
|
||||
actSetWatchpointAtPointerAddress.setText(tr("Add Data Breakpoint at Pointer's Address"));
|
||||
actSetWatchpointAtPointerAddress.setEnabled(false);
|
||||
const bool canSetWatchpoint = engine->hasCapability(WatchpointByAddressCapability);
|
||||
if (canSetWatchpoint && address) {
|
||||
actSetWatchpointAtObjectAddress
|
||||
@@ -764,9 +766,9 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
||||
actSetWatchpointAtPointerAddress
|
||||
.setText(tr("Add Data Breakpoint at Pointer's Address (0x%1)")
|
||||
.arg(pointerAddress, 0, 16));
|
||||
actSetWatchpointAtPointerAddress.setCheckable(true);
|
||||
actSetWatchpointAtPointerAddress
|
||||
.setChecked(mi0.data(LocalsIsWatchpointAtPointerAddressRole).toBool());
|
||||
actSetWatchpointAtPointerAddress.setEnabled(true);
|
||||
}
|
||||
} else {
|
||||
actSetWatchpointAtObjectAddress.setText(tr("Add Data Breakpoint"));
|
||||
@@ -873,7 +875,6 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
||||
QMenu breakpointMenu;
|
||||
breakpointMenu.setTitle(tr("Add Data Breakpoint..."));
|
||||
breakpointMenu.addAction(&actSetWatchpointAtObjectAddress);
|
||||
if (canSetWatchpoint && address)
|
||||
breakpointMenu.addAction(&actSetWatchpointAtPointerAddress);
|
||||
breakpointMenu.addAction(&actSetWatchpointAtExpression);
|
||||
|
||||
|
@@ -262,7 +262,7 @@ void FormEditorW::fullInit()
|
||||
m_formeditor->setIntegration(m_integration);
|
||||
// Connect Qt Designer help request to HelpManager.
|
||||
connect(m_integration, SIGNAL(creatorHelpRequested(QUrl)),
|
||||
HelpManager::instance(), SIGNAL(helpRequested(QUrl)));
|
||||
HelpManager::instance(), SLOT(handleHelpRequest(QUrl)));
|
||||
|
||||
/**
|
||||
* This will initialize our TabOrder, Signals and slots and Buddy editors.
|
||||
|
@@ -46,7 +46,7 @@
|
||||
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <texteditor/basetextdocumentlayout.h>
|
||||
#include <texteditor/ihighlighterfactory.h>
|
||||
#include <texteditor/highlighterfactory.h>
|
||||
#include <texteditor/syntaxhighlighter.h>
|
||||
#include <texteditor/basetextdocument.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
@@ -64,8 +64,8 @@
|
||||
#include <utils/tooltip/tipcontents.h>
|
||||
#include <utils/tooltip/tooltip.h>
|
||||
|
||||
static const int FILE_LEVEL = 1;
|
||||
static const int CHUNK_LEVEL = 2;
|
||||
//static const int FILE_LEVEL = 1;
|
||||
//static const int CHUNK_LEVEL = 2;
|
||||
|
||||
using namespace Core;
|
||||
using namespace TextEditor;
|
||||
@@ -110,7 +110,7 @@ protected:
|
||||
|
||||
private:
|
||||
SideDiffEditorWidget *m_editor;
|
||||
QMap<QString, IHighlighterFactory *> m_mimeTypeToHighlighterFactory;
|
||||
QMap<QString, HighlighterFactory *> m_mimeTypeToHighlighterFactory;
|
||||
QList<SyntaxHighlighter *> m_highlighters;
|
||||
QList<QTextDocument *> m_documents;
|
||||
};
|
||||
@@ -235,9 +235,9 @@ MultiHighlighter::MultiHighlighter(SideDiffEditorWidget *editor, QTextDocument *
|
||||
: SyntaxHighlighter(document),
|
||||
m_editor(editor)
|
||||
{
|
||||
const QList<IHighlighterFactory *> &factories =
|
||||
ExtensionSystem::PluginManager::getObjects<TextEditor::IHighlighterFactory>();
|
||||
foreach (IHighlighterFactory *factory, factories) {
|
||||
const QList<HighlighterFactory *> &factories =
|
||||
ExtensionSystem::PluginManager::getObjects<TextEditor::HighlighterFactory>();
|
||||
foreach (HighlighterFactory *factory, factories) {
|
||||
QStringList mimeTypes = factory->mimeTypes();
|
||||
foreach (const QString &mimeType, mimeTypes)
|
||||
m_mimeTypeToHighlighterFactory.insert(mimeType, factory);
|
||||
@@ -274,7 +274,7 @@ void MultiHighlighter::setDocuments(const QList<QPair<DiffFileInfo, QString> > &
|
||||
QTextDocument *document = new QTextDocument(contents);
|
||||
const MimeType mimeType = MimeDatabase::findByFile(QFileInfo(fileInfo.fileName));
|
||||
SyntaxHighlighter *highlighter = 0;
|
||||
if (const IHighlighterFactory *factory = m_mimeTypeToHighlighterFactory.value(mimeType.type())) {
|
||||
if (const HighlighterFactory *factory = m_mimeTypeToHighlighterFactory.value(mimeType.type())) {
|
||||
highlighter = factory->createHighlighter();
|
||||
if (highlighter)
|
||||
highlighter->setDocument(document);
|
||||
|
@@ -45,7 +45,7 @@
|
||||
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <texteditor/basetextdocumentlayout.h>
|
||||
#include <texteditor/ihighlighterfactory.h>
|
||||
#include <texteditor/highlighterfactory.h>
|
||||
#include <texteditor/syntaxhighlighter.h>
|
||||
#include <texteditor/basetextdocument.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
@@ -63,8 +63,8 @@
|
||||
#include <utils/tooltip/tipcontents.h>
|
||||
#include <utils/tooltip/tooltip.h>
|
||||
|
||||
static const int FILE_LEVEL = 1;
|
||||
static const int CHUNK_LEVEL = 2;
|
||||
//static const int FILE_LEVEL = 1;
|
||||
//static const int CHUNK_LEVEL = 2;
|
||||
|
||||
using namespace Core;
|
||||
using namespace TextEditor;
|
||||
|
@@ -369,11 +369,8 @@ GitDiffEditorReloader::GitDiffEditorReloader(QObject *parent)
|
||||
|
||||
void GitDiffEditorReloader::reload()
|
||||
{
|
||||
const QString workingDirectory = m_diffType == DiffShow
|
||||
? m_gitClient->findRepositoryForDirectory(m_workingDirectory)
|
||||
: m_workingDirectory;
|
||||
GitDiffHandler *handler = new GitDiffHandler(diffEditorController(),
|
||||
workingDirectory);
|
||||
m_workingDirectory);
|
||||
connect(handler, SIGNAL(destroyed()), this, SLOT(reloadFinished()));
|
||||
|
||||
switch (m_diffType) {
|
||||
|
@@ -11,7 +11,6 @@ glsleditorfactory.h \
|
||||
glsleditorplugin.h \
|
||||
glslfilewizard.h \
|
||||
glslhighlighter.h \
|
||||
glslhighlighterfactory.h \
|
||||
glslautocompleter.h \
|
||||
glslindenter.h \
|
||||
glslhoverhandler.h \
|
||||
@@ -25,7 +24,6 @@ glsleditorfactory.cpp \
|
||||
glsleditorplugin.cpp \
|
||||
glslfilewizard.cpp \
|
||||
glslhighlighter.cpp \
|
||||
glslhighlighterfactory.cpp \
|
||||
glslautocompleter.cpp \
|
||||
glslindenter.cpp \
|
||||
glslhoverhandler.cpp \
|
||||
|
@@ -34,8 +34,6 @@ QtcPlugin {
|
||||
"glslfilewizard.h",
|
||||
"glslhighlighter.cpp",
|
||||
"glslhighlighter.h",
|
||||
"glslhighlighterfactory.cpp",
|
||||
"glslhighlighterfactory.h",
|
||||
"glslhoverhandler.cpp",
|
||||
"glslhoverhandler.h",
|
||||
"glslindenter.cpp",
|
||||
|
@@ -69,7 +69,3 @@ Core::IEditor *GLSLEditorFactory::createEditor()
|
||||
TextEditor::TextEditorSettings::initializeEditor(rc);
|
||||
return rc->editor();
|
||||
}
|
||||
|
||||
void GLSLEditorFactory::updateEditorInfoBar(Core::IEditor *)
|
||||
{
|
||||
}
|
||||
|
@@ -43,9 +43,6 @@ public:
|
||||
GLSLEditorFactory(QObject *parent);
|
||||
|
||||
Core::IEditor *createEditor();
|
||||
|
||||
private slots:
|
||||
void updateEditorInfoBar(Core::IEditor *editor);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include "glslfilewizard.h"
|
||||
#include "glslhoverhandler.h"
|
||||
#include "glslcompletionassist.h"
|
||||
#include "glslhighlighterfactory.h"
|
||||
#include "glslhighlighter.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <projectexplorer/taskhub.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <texteditor/highlighterfactory.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/textfilewizard.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -219,7 +220,15 @@ bool GLSLEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
|
||||
wizard->setId(QLatin1String("K.GLSL"));
|
||||
addAutoReleasedObject(wizard);
|
||||
|
||||
addAutoReleasedObject(new GLSLHighlighterFactory);
|
||||
auto hf = new TextEditor::HighlighterFactory;
|
||||
hf->setProductType<Highlighter>();
|
||||
hf->setId(GLSLEditor::Constants::C_GLSLEDITOR_ID);
|
||||
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE);
|
||||
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_VERT);
|
||||
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG);
|
||||
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_VERT_ES);
|
||||
hf->addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG_ES);
|
||||
addAutoReleasedObject(hf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -1,49 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "glslhighlighterfactory.h"
|
||||
#include "glsleditorconstants.h"
|
||||
#include "glslhighlighter.h"
|
||||
|
||||
using namespace GLSLEditor::Internal;
|
||||
|
||||
GLSLHighlighterFactory::GLSLHighlighterFactory()
|
||||
{
|
||||
setId(GLSLEditor::Constants::C_GLSLEDITOR_ID);
|
||||
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE);
|
||||
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_VERT);
|
||||
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG);
|
||||
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_VERT_ES);
|
||||
addMimeType(GLSLEditor::Constants::GLSL_MIMETYPE_FRAG_ES);
|
||||
}
|
||||
|
||||
TextEditor::SyntaxHighlighter *GLSLHighlighterFactory::createHighlighter() const
|
||||
{
|
||||
return new Highlighter;
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef GLSLHIGHLIGHTERFACTORY_H
|
||||
#define GLSLHIGHLIGHTERFACTORY_H
|
||||
|
||||
#include <texteditor/ihighlighterfactory.h>
|
||||
|
||||
namespace GLSLEditor {
|
||||
namespace Internal {
|
||||
|
||||
class GLSLHighlighterFactory : public TextEditor::IHighlighterFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GLSLHighlighterFactory();
|
||||
|
||||
virtual TextEditor::SyntaxHighlighter *createHighlighter() const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace GLSLEditor
|
||||
|
||||
#endif // GLSLHIGHLIGHTERFACTORY_H
|
@@ -466,7 +466,8 @@ void HelpPlugin::setupUi()
|
||||
m_toggleSideBarAction = new QAction(QIcon(QLatin1String(Core::Constants::ICON_TOGGLE_SIDEBAR)),
|
||||
tr("Show Sidebar"), this);
|
||||
m_toggleSideBarAction->setCheckable(true);
|
||||
connect(m_toggleSideBarAction, SIGNAL(triggered(bool)), this, SLOT(showHideSidebar()));
|
||||
m_toggleSideBarAction->setChecked(m_isSidebarVisible);
|
||||
connect(m_toggleSideBarAction, SIGNAL(triggered(bool)), this, SLOT(setSideBarVisible(bool)));
|
||||
cmd = ActionManager::registerAction(m_toggleSideBarAction, Core::Constants::TOGGLE_SIDEBAR, modecontext);
|
||||
}
|
||||
|
||||
@@ -606,9 +607,11 @@ void HelpPlugin::slotHideRightPane()
|
||||
RightPaneWidget::instance()->setShown(false);
|
||||
}
|
||||
|
||||
void HelpPlugin::showHideSidebar()
|
||||
void HelpPlugin::setSideBarVisible(bool visible)
|
||||
{
|
||||
m_sideBar->setVisible(!m_sideBar->isVisible());
|
||||
if (visible == m_sideBar->isVisible())
|
||||
return;
|
||||
m_sideBar->setVisible(visible);
|
||||
onSideBarVisibilityChanged();
|
||||
}
|
||||
|
||||
@@ -1004,6 +1007,7 @@ void HelpPlugin::slotReportBug()
|
||||
void HelpPlugin::onSideBarVisibilityChanged()
|
||||
{
|
||||
m_isSidebarVisible = m_sideBar->isVisible();
|
||||
m_toggleSideBarAction->setChecked(m_isSidebarVisible);
|
||||
m_toggleSideBarAction->setToolTip(m_isSidebarVisible ? tr("Hide Sidebar") : tr("Show Sidebar"));
|
||||
}
|
||||
|
||||
|
@@ -103,7 +103,7 @@ private slots:
|
||||
void saveExternalWindowSettings();
|
||||
void switchToHelpMode(const QUrl &source);
|
||||
void slotHideRightPane();
|
||||
void showHideSidebar();
|
||||
void setSideBarVisible(bool visible);
|
||||
|
||||
void updateSideBarSource();
|
||||
void updateSideBarSource(const QUrl &newUrl);
|
||||
|
@@ -18,7 +18,6 @@ HEADERS += \
|
||||
wizard/pythonclasswizarddialog.h \
|
||||
wizard/pythonsourcegenerator.h \
|
||||
tools/pythonhighlighter.h \
|
||||
tools/pythonhighlighterfactory.h \
|
||||
tools/pythonindenter.h \
|
||||
tools/lexical/pythonformattoken.h \
|
||||
tools/lexical/pythonscanner.h \
|
||||
@@ -35,6 +34,5 @@ SOURCES += \
|
||||
wizard/pythonclassnamepage.cpp \
|
||||
wizard/pythonsourcegenerator.cpp \
|
||||
tools/pythonhighlighter.cpp \
|
||||
tools/pythonhighlighterfactory.cpp \
|
||||
tools/pythonindenter.cpp \
|
||||
tools/lexical/pythonscanner.cpp
|
||||
|
@@ -33,7 +33,6 @@ QtcPlugin {
|
||||
"lexical/pythonscanner.h", "lexical/pythonscanner.cpp",
|
||||
"lexical/sourcecodestream.h",
|
||||
"pythonhighlighter.h", "pythonhighlighter.cpp",
|
||||
"pythonhighlighterfactory.h", "pythonhighlighterfactory.cpp",
|
||||
"pythonindenter.cpp", "pythonindenter.h"
|
||||
]
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include "wizard/pythonclasswizard.h"
|
||||
#include "pythoneditorwidget.h"
|
||||
#include "pythoneditorfactory.h"
|
||||
#include "tools/pythonhighlighterfactory.h"
|
||||
#include "tools/pythonhighlighter.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/highlighterfactory.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QCoreApplication>
|
||||
@@ -229,7 +230,12 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
|
||||
// Add Python files and classes creation dialogs
|
||||
addAutoReleasedObject(new FileWizard);
|
||||
addAutoReleasedObject(new ClassWizard);
|
||||
addAutoReleasedObject(new Internal::PythonHighlighterFactory);
|
||||
|
||||
auto hf = new TextEditor::HighlighterFactory;
|
||||
hf->setId(Constants::C_PYTHONEDITOR_ID);
|
||||
hf->setProductType<PythonHighlighter>();
|
||||
hf->addMimeType(QLatin1String(Constants::C_PY_MIMETYPE));
|
||||
addAutoReleasedObject(hf);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -1,45 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "pythonhighlighterfactory.h"
|
||||
#include "../pythoneditorconstants.h"
|
||||
#include "pythonhighlighter.h"
|
||||
|
||||
using namespace PythonEditor::Internal;
|
||||
|
||||
PythonHighlighterFactory::PythonHighlighterFactory()
|
||||
{
|
||||
setId(Constants::C_PYTHONEDITOR_ID);
|
||||
addMimeType(QLatin1String(Constants::C_PY_MIMETYPE));
|
||||
}
|
||||
|
||||
TextEditor::SyntaxHighlighter *PythonHighlighterFactory::createHighlighter() const
|
||||
{
|
||||
return new PythonHighlighter;
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef PYTHONHIGHLIGHTERFACTORY_H
|
||||
#define PYTHONHIGHLIGHTERFACTORY_H
|
||||
|
||||
#include <texteditor/ihighlighterfactory.h>
|
||||
|
||||
namespace PythonEditor {
|
||||
namespace Internal {
|
||||
|
||||
class PythonHighlighterFactory : public TextEditor::IHighlighterFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PythonHighlighterFactory();
|
||||
|
||||
virtual TextEditor::SyntaxHighlighter *createHighlighter() const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace PythonEditor
|
||||
|
||||
#endif // PYTHONHIGHLIGHTERFACTORY_H
|
@@ -6,7 +6,7 @@ isEmpty(QBS_INSTALL_DIR) {
|
||||
QBS_SOURCE_DIR = $$PWD/../../shared/qbs
|
||||
include($$QBS_SOURCE_DIR/src/lib/corelib/use_corelib.pri)
|
||||
include($$QBS_SOURCE_DIR/src/lib/qtprofilesetup/use_qtprofilesetup.pri)
|
||||
macx:QMAKE_LFLAGS += -Wl,-rpath,@loader_path/../ # Mac: fix rpath for qbscore soname
|
||||
macx:QMAKE_LFLAGS += -Wl,-rpath,@loader_path/ # Mac: fix rpath for qbscore soname
|
||||
} else {
|
||||
include($${QBS_INSTALL_DIR}/include/qbs/use_installed_corelib.pri)
|
||||
include($${QBS_INSTALL_DIR}/include/qbs/use_installed_qtprofilesetup.pri)
|
||||
|
@@ -1,47 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "profilehighlighterfactory.h"
|
||||
#include "qmakeprojectmanagerconstants.h"
|
||||
#include "profilehighlighter.h"
|
||||
|
||||
using namespace QmakeProjectManager::Internal;
|
||||
|
||||
ProFileHighlighterFactory::ProFileHighlighterFactory()
|
||||
{
|
||||
setId(QmakeProjectManager::Constants::PROFILE_EDITOR_ID);
|
||||
addMimeType(QmakeProjectManager::Constants::PROFILE_MIMETYPE);
|
||||
addMimeType(QmakeProjectManager::Constants::PROINCLUDEFILE_MIMETYPE);
|
||||
addMimeType(QmakeProjectManager::Constants::PROFEATUREFILE_MIMETYPE);
|
||||
}
|
||||
|
||||
TextEditor::SyntaxHighlighter *ProFileHighlighterFactory::createHighlighter() const
|
||||
{
|
||||
return new ProFileHighlighter;
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Digia. For licensing terms and
|
||||
** conditions see http://qt.digia.com/licensing. For further information
|
||||
** use the contact form at http://qt.digia.com/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Digia gives you certain additional
|
||||
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef PROFILEHIGHLIGHTERFACTORY_H
|
||||
#define PROFILEHIGHLIGHTERFACTORY_H
|
||||
|
||||
#include <texteditor/ihighlighterfactory.h>
|
||||
|
||||
namespace QmakeProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class ProFileHighlighterFactory : public TextEditor::IHighlighterFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProFileHighlighterFactory();
|
||||
|
||||
virtual TextEditor::SyntaxHighlighter *createHighlighter() const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmakeProjectManager
|
||||
|
||||
#endif // PROFILEHIGHLIGHTERFACTORY_H
|
@@ -16,7 +16,6 @@ HEADERS += \
|
||||
qmakenodes.h \
|
||||
profileeditor.h \
|
||||
profilehighlighter.h \
|
||||
profilehighlighterfactory.h \
|
||||
profileeditorfactory.h \
|
||||
profilehoverhandler.h \
|
||||
wizards/qtprojectparameters.h \
|
||||
@@ -68,7 +67,6 @@ SOURCES += \
|
||||
qmakenodes.cpp \
|
||||
profileeditor.cpp \
|
||||
profilehighlighter.cpp \
|
||||
profilehighlighterfactory.cpp \
|
||||
profileeditorfactory.cpp \
|
||||
profilehoverhandler.cpp \
|
||||
wizards/qtprojectparameters.cpp \
|
||||
|
@@ -36,7 +36,6 @@ QtcPlugin {
|
||||
"profileeditor.cpp", "profileeditor.h",
|
||||
"profileeditorfactory.cpp", "profileeditorfactory.h",
|
||||
"profilehighlighter.cpp", "profilehighlighter.h",
|
||||
"profilehighlighterfactory.cpp", "profilehighlighterfactory.h",
|
||||
"profilehoverhandler.cpp", "profilehoverhandler.h",
|
||||
"qmakebuildinfo.h",
|
||||
"qmakeparser.cpp", "qmakeparser.h",
|
||||
|
@@ -50,7 +50,7 @@
|
||||
#include "externaleditors.h"
|
||||
#include "profilecompletionassist.h"
|
||||
#include "qmakekitinformation.h"
|
||||
#include "profilehighlighterfactory.h"
|
||||
#include "profilehighlighter.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
@@ -65,6 +65,7 @@
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/highlighterfactory.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/parameteraction.h>
|
||||
|
||||
@@ -142,7 +143,14 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
|
||||
|
||||
addAutoReleasedObject(new ProFileCompletionAssistProvider);
|
||||
addAutoReleasedObject(new ProFileHoverHandler(this));
|
||||
addAutoReleasedObject(new ProFileHighlighterFactory);
|
||||
|
||||
auto hf = new TextEditor::HighlighterFactory;
|
||||
hf->setProductType<ProFileHighlighter>();
|
||||
hf->setId(QmakeProjectManager::Constants::PROFILE_EDITOR_ID);
|
||||
hf->addMimeType(QmakeProjectManager::Constants::PROFILE_MIMETYPE);
|
||||
hf->addMimeType(QmakeProjectManager::Constants::PROINCLUDEFILE_MIMETYPE);
|
||||
hf->addMimeType(QmakeProjectManager::Constants::PROFEATUREFILE_MIMETYPE);
|
||||
addAutoReleasedObject(hf);
|
||||
|
||||
//menus
|
||||
Core::ActionContainer *mbuild =
|
||||
|
@@ -33,6 +33,8 @@
|
||||
|
||||
#include <nodeabstractproperty.h>
|
||||
|
||||
#include <coreplugin/documentmanager.h>
|
||||
|
||||
#include <QVariant>
|
||||
#include <QtDebug>
|
||||
|
||||
@@ -129,6 +131,27 @@ Utils::CrumblePath *CrumbleBar::crumblePath()
|
||||
return m_crumblePath;
|
||||
}
|
||||
|
||||
void CrumbleBar::showSaveDialog()
|
||||
{
|
||||
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
|
||||
|
||||
if (settings.alwaysSaveInCrumbleBar) {
|
||||
Core::DocumentManager::saveModifiedDocumentSilently(currentDesignDocument()->editor()->document());
|
||||
} else {
|
||||
bool alwaysSave;
|
||||
bool canceled;
|
||||
|
||||
Core::DocumentManager::saveModifiedDocument(currentDesignDocument()->editor()->document(),
|
||||
tr("Save the changes to preview them correctly."),
|
||||
&canceled,
|
||||
tr("Always save when leaving subcomponent"),
|
||||
&alwaysSave);
|
||||
|
||||
settings.alwaysSaveInCrumbleBar = alwaysSave;
|
||||
QmlDesignerPlugin::instance()->setSettings(settings);
|
||||
}
|
||||
}
|
||||
|
||||
void CrumbleBar::onCrumblePathElementClicked(const QVariant &data)
|
||||
{
|
||||
CrumbleBarInfo clickedCrumbleBarInfo = data.value<CrumbleBarInfo>();
|
||||
@@ -149,6 +172,7 @@ void CrumbleBar::onCrumblePathElementClicked(const QVariant &data)
|
||||
currentDesignDocument()->changeToDocumentModel();
|
||||
QmlDesignerPlugin::instance()->viewManager().setComponentViewToMaster();
|
||||
} else {
|
||||
showSaveDialog();
|
||||
crumblePath()->popElement();
|
||||
nextFileIsCalledInternally();
|
||||
Core::EditorManager::openEditor(clickedCrumbleBarInfo.fileName, Core::Id(),
|
||||
|
@@ -54,6 +54,7 @@ private slots:
|
||||
|
||||
private:
|
||||
void updateVisibility();
|
||||
void showSaveDialog();
|
||||
|
||||
private:
|
||||
bool m_isInternalCalled;
|
||||
|
@@ -315,11 +315,11 @@ void DragTool::dragLeaveEvent(QGraphicsSceneDragDropEvent * event)
|
||||
if (event->mimeData()->hasFormat("application/vnd.bauhaus.itemlibraryinfo") ||
|
||||
event->mimeData()->hasFormat("application/vnd.bauhaus.libraryresource")) {
|
||||
event->accept();
|
||||
if (m_dragNode.isValid())
|
||||
m_dragNode.destroy();
|
||||
|
||||
m_moveManipulator.end();
|
||||
clear();
|
||||
if (m_dragNode.isValid())
|
||||
m_dragNode.destroy();
|
||||
|
||||
commitTransaction();
|
||||
|
||||
|
@@ -91,7 +91,10 @@ QUrl FileResourcesModel::path() const
|
||||
|
||||
void FileResourcesModel::setFilter(const QString &filter)
|
||||
{
|
||||
if (m_filter != filter) {
|
||||
m_filter = filter;
|
||||
setupModel();
|
||||
}
|
||||
}
|
||||
|
||||
QString FileResourcesModel::filter() const
|
||||
@@ -173,4 +176,6 @@ void FileResourcesModel::setupModel()
|
||||
}
|
||||
|
||||
m_lock = false;
|
||||
|
||||
emit fileModelChanged();
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ class FileResourcesModel : public QObject
|
||||
Q_PROPERTY(QString filter READ filter WRITE setFilter)
|
||||
Q_PROPERTY(QVariant modelNodeBackendProperty READ modelNodeBackend WRITE setModelNodeBackend NOTIFY modelNodeBackendChanged)
|
||||
Q_PROPERTY(QUrl path READ path WRITE setPath)
|
||||
Q_PROPERTY(QStringList fileModel READ fileModel NOTIFY modelNodeBackendChanged)
|
||||
Q_PROPERTY(QStringList fileModel READ fileModel NOTIFY fileModelChanged)
|
||||
|
||||
public:
|
||||
explicit FileResourcesModel(QObject *parent = 0);
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
signals:
|
||||
void fileNameChanged(const QUrl &fileName);
|
||||
void modelNodeBackendChanged();
|
||||
void fileModelChanged();
|
||||
|
||||
public slots:
|
||||
|
||||
|
@@ -117,9 +117,20 @@ static void fixUrl(const QmlDesigner::ModelNode &modelNode, const QmlDesigner::P
|
||||
}
|
||||
}
|
||||
|
||||
static bool compareVariants(const QVariant &value1, const QVariant &value2)
|
||||
/* The comparison of variants is not symmetric because of implicit conversion.
|
||||
* QVariant(string) == QVariant(QColor) does for example ignore the alpha channel,
|
||||
* because the color is converted to a string ignoring the alpha channel.
|
||||
* By comparing the variants in both directions we gain a symmetric comparison.
|
||||
*/
|
||||
{
|
||||
return (value1 == value2)
|
||||
&& (value2 == value1);
|
||||
}
|
||||
|
||||
void PropertyEditorValue::setValueWithEmit(const QVariant &value)
|
||||
{
|
||||
if (m_value != value || isBound()) {
|
||||
if (!compareVariants(value, m_value ) || isBound()) {
|
||||
QVariant newValue = value;
|
||||
if (modelNode().isValid() && modelNode().metaInfo().isValid() && modelNode().metaInfo().hasProperty(name()))
|
||||
if (modelNode().metaInfo().propertyTypeName(name()) == "QUrl")
|
||||
@@ -129,6 +140,7 @@ void PropertyEditorValue::setValueWithEmit(const QVariant &value)
|
||||
return;
|
||||
if (cleverColorCompare(newValue, m_value))
|
||||
return;
|
||||
|
||||
setValue(newValue);
|
||||
m_isBound = false;
|
||||
emit valueChanged(name(), value);
|
||||
@@ -139,7 +151,7 @@ void PropertyEditorValue::setValueWithEmit(const QVariant &value)
|
||||
|
||||
void PropertyEditorValue::setValue(const QVariant &value)
|
||||
{
|
||||
if ((m_value != value) &&
|
||||
if (!compareVariants(m_value, value) &&
|
||||
!cleverDoubleCompare(value, m_value) &&
|
||||
!cleverColorCompare(value, m_value))
|
||||
|
||||
|
@@ -45,8 +45,6 @@ ComponentsPlugin::ComponentsPlugin()
|
||||
{
|
||||
TabViewIndexModel::registerDeclarativeType();
|
||||
DesignerActionManager *actionManager = &QmlDesignerPlugin::instance()->viewManager().designerActionManager();
|
||||
actionManager->addDesignerAction(new AddTabDesignerAction);
|
||||
actionManager->addDesignerAction(new EnterTabDesignerAction);
|
||||
}
|
||||
|
||||
QString ComponentsPlugin::pluginName() const
|
||||
|
@@ -56,7 +56,7 @@ public /*slots*/:
|
||||
};
|
||||
|
||||
EnterTabDesignerAction::EnterTabDesignerAction()
|
||||
: AbstractActionGroup(QCoreApplication::translate("TabViewToolAction", "Edit Tab"))
|
||||
: AbstractActionGroup(QCoreApplication::translate("TabViewToolAction", "Step into Tab"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ void EnterTabDesignerAction::createActionForTab(const ModelNode &modelNode)
|
||||
QmlDesigner::QmlItemNode itemNode(modelNode);
|
||||
|
||||
if (itemNode.isValid()) {
|
||||
QString what = QString(QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Edit: %1")).
|
||||
QString what = QString(QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Step into: %1")).
|
||||
arg(itemNode.instanceValue("title").toString());
|
||||
EnterTabAction *selectionAction = new EnterTabAction(what);
|
||||
|
||||
|
@@ -34,18 +34,10 @@
|
||||
#include <cxxabi.h>
|
||||
#endif
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QMessageBox>
|
||||
|
||||
static void showAsyncWarning(const QString &title, const QString &desciption)
|
||||
{
|
||||
QMessageBox *messageBox = new QMessageBox(QMessageBox::Warning, title, desciption, QMessageBox::Ok, Core::ICore::dialogParent());
|
||||
messageBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
messageBox->setModal(true);
|
||||
messageBox->show();
|
||||
}
|
||||
#include <qmldesignerwarning.h>
|
||||
|
||||
/*!
|
||||
\defgroup CoreExceptions
|
||||
@@ -163,7 +155,7 @@ QString Exception::description() const
|
||||
void Exception::showException(const QString &title) const
|
||||
{
|
||||
QString composedTitle = title.isEmpty() ? QCoreApplication::translate("QmlDesigner", "Error") : title;
|
||||
showAsyncWarning(composedTitle, description());
|
||||
QmlDesignerWarning::show(composedTitle, description());
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@@ -34,7 +34,6 @@
|
||||
|
||||
#include "propertycontainer.h"
|
||||
#include <QPointer>
|
||||
#include <qqml.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QCryptographicHash>
|
||||
#include <QDateTime>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
@@ -42,10 +43,11 @@
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <qmldesignerwarning.h>
|
||||
#include "puppetbuildprogressdialog.h"
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
@@ -130,6 +132,11 @@ QProcess *PuppetCreator::puppetProcess(const QString &puppetPath,
|
||||
}
|
||||
puppetProcess->start(puppetPath, QStringList() << socketToken << puppetMode << "-graphicssystem raster");
|
||||
|
||||
if (!qgetenv("DEBUG_QML_PUPPET").isEmpty())
|
||||
QMessageBox::information(Core::ICore::dialogParent(),
|
||||
QStringLiteral("Puppet is starting ..."),
|
||||
QStringLiteral("You can now attach your debugger to the puppet."));
|
||||
|
||||
return puppetProcess;
|
||||
}
|
||||
|
||||
@@ -160,9 +167,22 @@ bool PuppetCreator::build(const QString &qmlPuppetProjectFilePath) const
|
||||
buildSucceeded = startBuildProcess(buildDirectory.path(), buildCommand(), QStringList(), &progressDialog);
|
||||
progressDialog.hide();
|
||||
}
|
||||
} else {
|
||||
buildSucceeded = true;
|
||||
|
||||
if (!buildSucceeded)
|
||||
QmlDesignerWarning::show(QCoreApplication::translate("PuppetCreator", "Emulation layer building was unsuccessful"),
|
||||
QCoreApplication::translate("PuppetCreator",
|
||||
"The emulation layer(Qml Puppet) cannot was built. "
|
||||
"So now the fallback version will be used "
|
||||
"which is not supporting all features."
|
||||
));
|
||||
}
|
||||
} else {
|
||||
QmlDesignerWarning::show(QCoreApplication::translate("PuppetCreator", "Qt Version is not supported"),
|
||||
QCoreApplication::translate("PuppetCreator",
|
||||
"The emulation layer(Qml Puppet) cannot be built because the Qt version is to old "
|
||||
"or it can not run native on your computer. So now the fallback version will be used "
|
||||
"which is not supporting all features."
|
||||
));
|
||||
}
|
||||
|
||||
return buildSucceeded;
|
||||
@@ -302,7 +322,7 @@ bool PuppetCreator::startBuildProcess(const QString &buildDirectoryPath,
|
||||
|
||||
process.waitForFinished();
|
||||
|
||||
if (process.exitStatus() == QProcess::NormalExit || process.exitCode() == 0)
|
||||
if (process.exitStatus() == QProcess::NormalExit && process.exitCode() == 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
@@ -42,7 +42,8 @@ DesignerSettings::DesignerSettings()
|
||||
warningsInDesigner(true),
|
||||
designerWarningsInEditor(false),
|
||||
showDebugView(false),
|
||||
enableDebugView(false)
|
||||
enableDebugView(false),
|
||||
alwaysSaveInCrumbleBar(false)
|
||||
{}
|
||||
|
||||
void DesignerSettings::fromSettings(QSettings *settings)
|
||||
@@ -63,6 +64,8 @@ void DesignerSettings::fromSettings(QSettings *settings)
|
||||
QLatin1String(QmlDesigner::Constants::QML_SHOW_DEBUGVIEW), QVariant(false)).toBool();
|
||||
enableDebugView = settings->value(
|
||||
QLatin1String(QmlDesigner::Constants::QML_ENABLE_DEBUGVIEW), QVariant(false)).toBool();
|
||||
alwaysSaveInCrumbleBar = settings->value(
|
||||
QLatin1String(QmlDesigner::Constants::QML_ALWAYS_SAFE_IN_CRUMBLEBAR), QVariant(false)).toBool();
|
||||
|
||||
settings->endGroup();
|
||||
settings->endGroup();
|
||||
@@ -80,6 +83,7 @@ void DesignerSettings::toSettings(QSettings *settings) const
|
||||
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_WARNIN_FOR_DESIGNER_FEATURES_IN_EDITOR_KEY), designerWarningsInEditor);
|
||||
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_SHOW_DEBUGVIEW), showDebugView);
|
||||
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_ENABLE_DEBUGVIEW), enableDebugView);
|
||||
settings->setValue(QLatin1String(QmlDesigner::Constants::QML_ALWAYS_SAFE_IN_CRUMBLEBAR), alwaysSaveInCrumbleBar);
|
||||
|
||||
settings->endGroup();
|
||||
settings->endGroup();
|
||||
@@ -93,5 +97,6 @@ bool DesignerSettings::equals(const DesignerSettings &other) const
|
||||
&& warningsInDesigner == other.warningsInDesigner
|
||||
&& designerWarningsInEditor == other.designerWarningsInEditor
|
||||
&& showDebugView == other.showDebugView
|
||||
&& enableDebugView == other.enableDebugView;
|
||||
&& enableDebugView == other.enableDebugView
|
||||
&& alwaysSaveInCrumbleBar == other.alwaysSaveInCrumbleBar;
|
||||
}
|
||||
|
@@ -55,6 +55,7 @@ public:
|
||||
bool designerWarningsInEditor;
|
||||
bool showDebugView;
|
||||
bool enableDebugView;
|
||||
bool alwaysSaveInCrumbleBar;
|
||||
};
|
||||
|
||||
inline bool operator==(const DesignerSettings &s1, const DesignerSettings &s2)
|
||||
|
@@ -64,6 +64,7 @@ const char QML_WARNIN_FOR_FEATURES_IN_DESIGNER_KEY[] = "WarnAboutQtQuickFeatures
|
||||
const char QML_WARNIN_FOR_DESIGNER_FEATURES_IN_EDITOR_KEY[] = "WarnAboutQtQuickDesignerFeaturesInCodeEditor";
|
||||
const char QML_SHOW_DEBUGVIEW[] = "ShowQtQuickDesignerDebugView";
|
||||
const char QML_ENABLE_DEBUGVIEW[] = "EnableQtQuickDesignerDebugView";
|
||||
const char QML_ALWAYS_SAFE_IN_CRUMBLEBAR[] = "AlwaysSafeInCrumbleBar";
|
||||
|
||||
const char QML_DESIGNER_SUBFOLDER[] = "/designer/";
|
||||
|
||||
|
@@ -270,14 +270,14 @@ void QmlDesignerPlugin::jumpTextCursorToSelectedModelNode()
|
||||
{
|
||||
// visual editor -> text editor
|
||||
ModelNode selectedNode;
|
||||
if (!currentDesignDocument()->rewriterView()->selectedModelNodes().isEmpty())
|
||||
selectedNode = currentDesignDocument()->rewriterView()->selectedModelNodes().first();
|
||||
if (!rewriterView()->selectedModelNodes().isEmpty())
|
||||
selectedNode = rewriterView()->selectedModelNodes().first();
|
||||
|
||||
if (selectedNode.isValid()) {
|
||||
const int nodeOffset = currentDesignDocument()->rewriterView()->nodeOffset(selectedNode);
|
||||
const int nodeOffset = rewriterView()->nodeOffset(selectedNode);
|
||||
if (nodeOffset > 0) {
|
||||
const ModelNode currentSelectedNode
|
||||
= currentDesignDocument()->rewriterView()->nodeAtTextCursorPosition(currentDesignDocument()->plainTextEdit()->textCursor().position());
|
||||
= rewriterView()->nodeAtTextCursorPosition(currentDesignDocument()->plainTextEdit()->textCursor().position());
|
||||
if (currentSelectedNode != selectedNode) {
|
||||
int line, column;
|
||||
currentDesignDocument()->textEditor()->convertPosition(nodeOffset, &line, &column);
|
||||
@@ -290,9 +290,9 @@ void QmlDesignerPlugin::jumpTextCursorToSelectedModelNode()
|
||||
void QmlDesignerPlugin::selectModelNodeUnderTextCursor()
|
||||
{
|
||||
const int cursorPosition = currentDesignDocument()->plainTextEdit()->textCursor().position();
|
||||
ModelNode modelNode = currentDesignDocument()->rewriterView()->nodeAtTextCursorPosition(cursorPosition);
|
||||
ModelNode modelNode = rewriterView()->nodeAtTextCursorPosition(cursorPosition);
|
||||
if (modelNode.isValid())
|
||||
currentDesignDocument()->rewriterView()->setSelectedModelNode(modelNode);
|
||||
rewriterView()->setSelectedModelNode(modelNode);
|
||||
}
|
||||
|
||||
void QmlDesignerPlugin::activateAutoSynchronization()
|
||||
@@ -321,7 +321,7 @@ void QmlDesignerPlugin::activateAutoSynchronization()
|
||||
|
||||
currentDesignDocument()->updateSubcomponentManager();
|
||||
|
||||
connect(currentDesignDocument()->rewriterView(),
|
||||
connect(rewriterView(),
|
||||
SIGNAL(errorsChanged(QList<RewriterView::Error>)),
|
||||
data->mainWidget,
|
||||
SLOT(updateErrorStatus(QList<RewriterView::Error>)));
|
||||
@@ -334,7 +334,7 @@ void QmlDesignerPlugin::deactivateAutoSynchronization()
|
||||
viewManager().detachRewriterView();
|
||||
documentManager().currentDesignDocument()->resetToDocumentModel();
|
||||
|
||||
disconnect(currentDesignDocument()->rewriterView(),
|
||||
disconnect(rewriterView(),
|
||||
SIGNAL(errorsChanged(QList<RewriterView::Error>)),
|
||||
data->mainWidget,
|
||||
SLOT(updateErrorStatus(QList<RewriterView::Error>)));
|
||||
@@ -343,14 +343,21 @@ void QmlDesignerPlugin::deactivateAutoSynchronization()
|
||||
|
||||
void QmlDesignerPlugin::resetModelSelection()
|
||||
{
|
||||
if (currentDesignDocument()->rewriterView() && currentDesignDocument()->currentModel())
|
||||
currentDesignDocument()->rewriterView()->setSelectedModelNodes(QList<ModelNode>());
|
||||
if (rewriterView() && currentDesignDocument()->currentModel())
|
||||
rewriterView()->setSelectedModelNodes(QList<ModelNode>());
|
||||
}
|
||||
|
||||
RewriterView *QmlDesignerPlugin::rewriterView() const
|
||||
{
|
||||
return currentDesignDocument()->rewriterView();
|
||||
}
|
||||
|
||||
static bool checkIfEditorIsQtQuick(Core::IEditor *editor)
|
||||
{
|
||||
if (editor)
|
||||
if (editor && editor->document()->id() == QmlJSEditor::Constants::C_QMLJSEDITOR_ID) {
|
||||
QmlJS::Document::Ptr document = QmlJS::ModelManagerInterface::instance()->snapshot().document(editor->document()->filePath());
|
||||
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
QmlJS::Document::Ptr document = modelManager->ensuredGetDocumentForPath(editor->document()->filePath());
|
||||
if (!document.isNull())
|
||||
return document->language() == QmlJS::Language::QmlQtQuick1
|
||||
|| document->language() == QmlJS::Language::QmlQtQuick2
|
||||
|
@@ -113,6 +113,7 @@ private: // functions
|
||||
void activateAutoSynchronization();
|
||||
void deactivateAutoSynchronization();
|
||||
void resetModelSelection();
|
||||
RewriterView *rewriterView() const;
|
||||
|
||||
private: // variables
|
||||
QmlDesignerPluginData *data;
|
||||
|
@@ -6,80 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>684</width>
|
||||
<height>607</height>
|
||||
<width>726</width>
|
||||
<height>774</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="3" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string>Debugging</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_4">
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="designerShowDebuggerCheckBox">
|
||||
<property name="text">
|
||||
<string>Show the debugging view</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="designerEnableDebuggerCheckBox">
|
||||
<property name="text">
|
||||
<string>Enable the debugging view</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Warnings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="designerWarningsCheckBox">
|
||||
<property name="toolTip">
|
||||
<string>Warns about QML features which are not properly supported by the Qt Quick Designer.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warn about unsupported features in the Qt Quick Designer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="designerWarningsInEditorCheckBox">
|
||||
<property name="toolTip">
|
||||
<string>Also warns in the code editor about QML features which are not properly supported by the Qt Quick Designer.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warn about unsupported features of Qt Quick Designer in the code editor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
@@ -199,6 +133,72 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string>Debugging</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_4">
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="designerShowDebuggerCheckBox">
|
||||
<property name="text">
|
||||
<string>Show the debugging view</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="designerEnableDebuggerCheckBox">
|
||||
<property name="text">
|
||||
<string>Enable the debugging view</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Warnings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="designerWarningsCheckBox">
|
||||
<property name="toolTip">
|
||||
<string>Warns about QML features which are not properly supported by the Qt Quick Designer.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warn about unsupported features in the Qt Quick Designer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="designerWarningsInEditorCheckBox">
|
||||
<property name="toolTip">
|
||||
<string>Also warns in the code editor about QML features which are not properly supported by the Qt Quick Designer.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warn about unsupported features of Qt Quick Designer in the code editor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -211,6 +211,28 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Subcomponents</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Always save when leaving subcomponent in bread crumb</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
@@ -13,7 +13,6 @@ HEADERS += \
|
||||
qmlexpressionundercursor.h \
|
||||
qmlfilewizard.h \
|
||||
qmljshighlighter.h \
|
||||
qmljshighlighterfactory.h \
|
||||
qmljshoverhandler.h \
|
||||
qmljspreviewrunner.h \
|
||||
qmljscomponentfromobjectdef.h \
|
||||
@@ -46,7 +45,6 @@ SOURCES += \
|
||||
qmlexpressionundercursor.cpp \
|
||||
qmlfilewizard.cpp \
|
||||
qmljshighlighter.cpp \
|
||||
qmljshighlighterfactory.cpp \
|
||||
qmljshoverhandler.cpp \
|
||||
qmljspreviewrunner.cpp \
|
||||
qmljscomponentfromobjectdef.cpp \
|
||||
|
@@ -51,8 +51,6 @@ QtcPlugin {
|
||||
"qmljsfindreferences.h",
|
||||
"qmljshighlighter.cpp",
|
||||
"qmljshighlighter.h",
|
||||
"qmljshighlighterfactory.cpp",
|
||||
"qmljshighlighterfactory.h",
|
||||
"qmljshoverhandler.cpp",
|
||||
"qmljshoverhandler.h",
|
||||
"qmljsoutline.cpp",
|
||||
|
@@ -44,7 +44,6 @@
|
||||
#include "quicktoolbarsettingspage.h"
|
||||
#include "qmljscompletionassist.h"
|
||||
#include "qmljsquickfixassist.h"
|
||||
#include "qmljshighlighterfactory.h"
|
||||
|
||||
#include <qmljs/qmljsicons.h>
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
@@ -64,6 +63,7 @@
|
||||
#include <projectexplorer/taskhub.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/textfilewizard.h>
|
||||
#include <texteditor/highlighterfactory.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/json.h>
|
||||
|
||||
@@ -114,7 +114,17 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
{
|
||||
m_modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
addAutoReleasedObject(new QmlJSSnippetProvider);
|
||||
addAutoReleasedObject(new QmlJSHighlighterFactory);
|
||||
|
||||
auto hf = new TextEditor::HighlighterFactory;
|
||||
hf->setProductType<Highlighter>();
|
||||
hf->setId(Constants::C_QMLJSEDITOR_ID);
|
||||
hf->addMimeType(QmlJSTools::Constants::QML_MIMETYPE);
|
||||
hf->addMimeType(QmlJSTools::Constants::QMLPROJECT_MIMETYPE);
|
||||
hf->addMimeType(QmlJSTools::Constants::QBS_MIMETYPE);
|
||||
hf->addMimeType(QmlJSTools::Constants::QMLTYPES_MIMETYPE);
|
||||
hf->addMimeType(QmlJSTools::Constants::JS_MIMETYPE);
|
||||
hf->addMimeType(QmlJSTools::Constants::JSON_MIMETYPE);
|
||||
addAutoReleasedObject(hf);
|
||||
|
||||
// QML task updating manager
|
||||
m_qmlTaskManager = new QmlTaskManager;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user