Merge "Merge remote-tracking branch 'origin/4.1'"
@@ -2,10 +2,10 @@ import qbs
|
||||
|
||||
QtcProduct {
|
||||
Depends { name: "bundle" }
|
||||
Depends { name: "ib"; condition: qbs.targetOS.contains("osx") }
|
||||
Depends { name: "ib"; condition: qbs.targetOS.contains("macos") }
|
||||
|
||||
Properties {
|
||||
condition: qbs.targetOS.contains("osx")
|
||||
condition: qbs.targetOS.contains("macos")
|
||||
ib.appIconName: "qtcreator"
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ QtcProduct {
|
||||
installDir: qtc.ide_bin_path
|
||||
property bool qtcRunnable: true
|
||||
|
||||
cpp.rpaths: qbs.targetOS.contains("osx") ? ["@executable_path/../Frameworks"]
|
||||
cpp.rpaths: qbs.targetOS.contains("macos") ? ["@executable_path/../Frameworks"]
|
||||
: ["$ORIGIN/../" + qtc.libDirName + "/qtcreator"]
|
||||
cpp.includePaths: [
|
||||
project.sharedSourcesDir + "/qtsingleapplication",
|
||||
@@ -51,7 +51,7 @@ QtcProduct {
|
||||
|
||||
Group {
|
||||
name: "qtcreator.sh"
|
||||
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("osx")
|
||||
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")
|
||||
files: "../../bin/qtcreator.sh"
|
||||
qbs.install: true
|
||||
qbs.installDir: "bin"
|
||||
@@ -74,7 +74,7 @@ QtcProduct {
|
||||
}
|
||||
|
||||
Group {
|
||||
condition: qbs.targetOS.contains("osx")
|
||||
condition: qbs.targetOS.contains("macos")
|
||||
fileTagsFilter: ["aggregate_infoplist", "pkginfo", "compiled_assetcatalog"]
|
||||
qbs.install: true
|
||||
qbs.installSourceBase: product.buildDirectory
|
||||
|
||||
@@ -762,6 +762,11 @@ QByteArray Preprocessor::run(const QString &fileName,
|
||||
return preprocessed;
|
||||
}
|
||||
|
||||
void Preprocessor::setCancelChecker(const Preprocessor::CancelChecker &cancelChecker)
|
||||
{
|
||||
m_cancelChecker = cancelChecker;
|
||||
}
|
||||
|
||||
bool Preprocessor::expandFunctionlikeMacros() const
|
||||
{
|
||||
return m_expandFunctionlikeMacros;
|
||||
@@ -1636,6 +1641,9 @@ void Preprocessor::handlePreprocessorDirective(PPToken *tk)
|
||||
|
||||
void Preprocessor::handleIncludeDirective(PPToken *tk, bool includeNext)
|
||||
{
|
||||
if (m_cancelChecker && m_cancelChecker())
|
||||
return;
|
||||
|
||||
m_state.m_lexer->setScanAngleStringLiteralTokens(true);
|
||||
lex(tk); // consume "include" token
|
||||
m_state.m_lexer->setScanAngleStringLiteralTokens(false);
|
||||
|
||||
@@ -56,6 +56,8 @@
|
||||
#include <QByteArray>
|
||||
#include <QPair>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
class Environment;
|
||||
@@ -81,6 +83,9 @@ public:
|
||||
QByteArray run(const QString &filename, const QByteArray &source,
|
||||
bool noLines = false, bool markGeneratedTokens = true);
|
||||
|
||||
using CancelChecker = std::function<bool()>;
|
||||
void setCancelChecker(const CancelChecker &cancelChecker);
|
||||
|
||||
bool expandFunctionlikeMacros() const;
|
||||
void setExpandFunctionlikeMacros(bool expandFunctionlikeMacros);
|
||||
|
||||
@@ -253,6 +258,7 @@ private:
|
||||
Client *m_client;
|
||||
Environment *m_env;
|
||||
QByteArray m_scratchBuffer;
|
||||
CancelChecker m_cancelChecker;
|
||||
|
||||
bool m_expandFunctionlikeMacros;
|
||||
bool m_keepComments;
|
||||
|
||||
@@ -37,7 +37,3 @@ FORMS += \
|
||||
pluginerrorview.ui \
|
||||
plugindetailsview.ui \
|
||||
pluginerroroverview.ui
|
||||
RESOURCES += pluginview.qrc
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,10 +43,6 @@ Project {
|
||||
"pluginspec_p.h",
|
||||
"pluginview.cpp",
|
||||
"pluginview.h",
|
||||
"pluginview.qrc",
|
||||
"images/error.png",
|
||||
"images/notloaded.png",
|
||||
"images/ok.png",
|
||||
]
|
||||
|
||||
Export {
|
||||
|
||||
@@ -1024,6 +1024,8 @@ static int executeTestPlan(const TestPlan &testPlan)
|
||||
<< QLatin1String("arg0") // fake application name
|
||||
<< QLatin1String("-maxwarnings") << QLatin1String("0"); // unlimit output
|
||||
qExecArguments << functions;
|
||||
// avoid being stuck in QTBUG-24925
|
||||
qExecArguments << "-nocrashhandler";
|
||||
failedTests += QTest::qExec(testObject, qExecArguments);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/categorysortfiltermodel.h>
|
||||
#include <utils/icon.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/itemviews.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/treemodel.h>
|
||||
@@ -90,22 +90,16 @@ static const QIcon &icon(IconIndex icon)
|
||||
using namespace Utils;
|
||||
switch (icon) {
|
||||
case OkIcon: {
|
||||
static const QIcon ok =
|
||||
Icon({{QLatin1String(":/extensionsystem/images/ok.png"),
|
||||
Theme::IconsRunToolBarColor}}, Icon::Tint).icon();
|
||||
static const QIcon ok = Utils::Icons::OK.icon();
|
||||
return ok;
|
||||
}
|
||||
case ErrorIcon: {
|
||||
static const QIcon error =
|
||||
Icon({{QLatin1String(":/extensionsystem/images/error.png"),
|
||||
Theme::IconsErrorColor}}, Icon::Tint).icon();
|
||||
static const QIcon error = Utils::Icons::ERROR.icon();
|
||||
return error;
|
||||
}
|
||||
default:
|
||||
case NotLoadedIcon: {
|
||||
static const QIcon notLoaded =
|
||||
Icon({{QLatin1String(":/extensionsystem/images/notloaded.png"),
|
||||
Theme::IconsErrorColor}}, Icon::Tint).icon();
|
||||
static const QIcon notLoaded = Utils::Icons::NOTLOADED.icon();
|
||||
return notLoaded;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/extensionsystem">
|
||||
<file>images/ok.png</file>
|
||||
<file>images/ok@2x.png</file>
|
||||
<file>images/error.png</file>
|
||||
<file>images/error@2x.png</file>
|
||||
<file>images/notloaded.png</file>
|
||||
<file>images/notloaded@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
BIN
src/libs/qmleditorwidgets/images/alignment_bottom.png
Normal file
|
After Width: | Height: | Size: 91 B |
BIN
src/libs/qmleditorwidgets/images/alignment_center.png
Normal file
|
After Width: | Height: | Size: 105 B |
BIN
src/libs/qmleditorwidgets/images/alignment_left.png
Normal file
|
After Width: | Height: | Size: 103 B |
BIN
src/libs/qmleditorwidgets/images/alignment_middle.png
Normal file
|
After Width: | Height: | Size: 93 B |
BIN
src/libs/qmleditorwidgets/images/alignment_right.png
Normal file
|
After Width: | Height: | Size: 102 B |
BIN
src/libs/qmleditorwidgets/images/alignment_top.png
Normal file
|
After Width: | Height: | Size: 93 B |
BIN
src/libs/qmleditorwidgets/images/anchor_bottom.png
Normal file
|
After Width: | Height: | Size: 91 B |
BIN
src/libs/qmleditorwidgets/images/anchor_bottom@2x.png
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
src/libs/qmleditorwidgets/images/anchor_fill.png
Normal file
|
After Width: | Height: | Size: 196 B |
BIN
src/libs/qmleditorwidgets/images/anchor_fill@2x.png
Normal file
|
After Width: | Height: | Size: 226 B |
BIN
src/libs/qmleditorwidgets/images/anchor_horizontal.png
Normal file
|
After Width: | Height: | Size: 93 B |
BIN
src/libs/qmleditorwidgets/images/anchor_horizontal@2x.png
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
src/libs/qmleditorwidgets/images/anchor_left.png
Normal file
|
After Width: | Height: | Size: 93 B |
BIN
src/libs/qmleditorwidgets/images/anchor_left@2x.png
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
src/libs/qmleditorwidgets/images/anchor_right.png
Normal file
|
After Width: | Height: | Size: 93 B |
BIN
src/libs/qmleditorwidgets/images/anchor_right@2x.png
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
src/libs/qmleditorwidgets/images/anchor_top.png
Normal file
|
After Width: | Height: | Size: 93 B |
BIN
src/libs/qmleditorwidgets/images/anchor_top@2x.png
Normal file
|
After Width: | Height: | Size: 99 B |
BIN
src/libs/qmleditorwidgets/images/anchor_vertical.png
Normal file
|
After Width: | Height: | Size: 93 B |
BIN
src/libs/qmleditorwidgets/images/anchor_vertical@2x.png
Normal file
|
After Width: | Height: | Size: 98 B |
BIN
src/libs/qmleditorwidgets/images/anchoreditem.png
Normal file
|
After Width: | Height: | Size: 141 B |
BIN
src/libs/qmleditorwidgets/images/anchoreditem@2x.png
Normal file
|
After Width: | Height: | Size: 186 B |
BIN
src/libs/qmleditorwidgets/images/style_bold.png
Normal file
|
After Width: | Height: | Size: 194 B |
BIN
src/libs/qmleditorwidgets/images/style_bold@2x.png
Normal file
|
After Width: | Height: | Size: 332 B |
BIN
src/libs/qmleditorwidgets/images/style_italic.png
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
src/libs/qmleditorwidgets/images/style_italic@2x.png
Normal file
|
After Width: | Height: | Size: 256 B |
BIN
src/libs/qmleditorwidgets/images/style_strikeout.png
Normal file
|
After Width: | Height: | Size: 201 B |
BIN
src/libs/qmleditorwidgets/images/style_strikeout@2x.png
Normal file
|
After Width: | Height: | Size: 377 B |
BIN
src/libs/qmleditorwidgets/images/style_underline.png
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
src/libs/qmleditorwidgets/images/style_underline@2x.png
Normal file
|
After Width: | Height: | Size: 319 B |
@@ -39,5 +39,35 @@
|
||||
<file>images/tile-icon-hor-crop.png</file>
|
||||
<file>images/tile-icon-hor - scale.png</file>
|
||||
<file>images/tile-icon-vert-scale.png</file>
|
||||
<file>images/anchor_bottom.png</file>
|
||||
<file>images/anchor_bottom@2x.png</file>
|
||||
<file>images/anchor_fill.png</file>
|
||||
<file>images/anchor_fill@2x.png</file>
|
||||
<file>images/anchor_horizontal.png</file>
|
||||
<file>images/anchor_horizontal@2x.png</file>
|
||||
<file>images/anchor_left.png</file>
|
||||
<file>images/anchor_left@2x.png</file>
|
||||
<file>images/anchor_right.png</file>
|
||||
<file>images/anchor_right@2x.png</file>
|
||||
<file>images/anchor_top.png</file>
|
||||
<file>images/anchor_top@2x.png</file>
|
||||
<file>images/anchor_vertical.png</file>
|
||||
<file>images/anchor_vertical@2x.png</file>
|
||||
<file>images/anchoreditem.png</file>
|
||||
<file>images/anchoreditem@2x.png</file>
|
||||
<file>images/alignment_center.png</file>
|
||||
<file>images/alignment_left.png</file>
|
||||
<file>images/alignment_right.png</file>
|
||||
<file>images/alignment_bottom.png</file>
|
||||
<file>images/alignment_middle.png</file>
|
||||
<file>images/alignment_top.png</file>
|
||||
<file>images/style_bold.png</file>
|
||||
<file>images/style_bold@2x.png</file>
|
||||
<file>images/style_italic.png</file>
|
||||
<file>images/style_italic@2x.png</file>
|
||||
<file>images/style_underline.png</file>
|
||||
<file>images/style_underline@2x.png</file>
|
||||
<file>images/style_strikeout.png</file>
|
||||
<file>images/style_strikeout@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <cplusplus/TypeOfExpression.h>
|
||||
#include <cplusplus/cppmodelmanagerbase.h>
|
||||
#include <cplusplus/CppDocument.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QList>
|
||||
|
||||
@@ -819,6 +820,8 @@ FindExportedCppTypes::FindExportedCppTypes(const CPlusPlus::Snapshot &snapshot)
|
||||
|
||||
QStringList FindExportedCppTypes::operator()(const CPlusPlus::Document::Ptr &document)
|
||||
{
|
||||
QTC_ASSERT(!document.isNull(), return QStringList());
|
||||
|
||||
m_contextProperties.clear();
|
||||
m_exportedTypes.clear();
|
||||
QStringList fileNames;
|
||||
|
||||
@@ -1321,7 +1321,10 @@ void ModelManagerInterface::updateCppQmlTypes(QFutureInterface<void> &interface,
|
||||
if (!scan) {
|
||||
hasNewInfo = newData.remove(fileName) > 0 || hasNewInfo;
|
||||
foreach (const QString &file, newDeclarations[fileName]) {
|
||||
finder(snapshot.document(file));
|
||||
CPlusPlus::Document::Ptr doc = snapshot.document(file);
|
||||
if (doc.isNull())
|
||||
continue;
|
||||
finder(doc);
|
||||
hasNewInfo = rescanExports(file, finder, newData) || hasNewInfo;
|
||||
}
|
||||
continue;
|
||||
|
||||
@@ -69,7 +69,7 @@ Project {
|
||||
result.push("advapi32", "user32")
|
||||
else if (qbs.targetOS.contains("linux"))
|
||||
result.push("rt", "dl");
|
||||
else if (qbs.targetOS.contains("osx"))
|
||||
else if (qbs.targetOS.contains("macos"))
|
||||
result.push("dl");
|
||||
else if (qbs.targetOS.contains("unix"))
|
||||
result.push("rt");
|
||||
@@ -95,7 +95,7 @@ Project {
|
||||
"BOTAN_HAS_ALLOC_MMAP", "BOTAN_HAS_ENTROPY_SRC_DEV_RANDOM",
|
||||
"BOTAN_HAS_ENTROPY_SRC_EGD", "BOTAN_HAS_ENTROPY_SRC_FTW",
|
||||
"BOTAN_HAS_ENTROPY_SRC_UNIX", "BOTAN_HAS_MUTEX_PTHREAD", "BOTAN_HAS_PIPE_UNIXFD_IO")
|
||||
if (qbs.targetOS.contains("osx"))
|
||||
if (qbs.targetOS.contains("macos"))
|
||||
result.push("BOTAN_TARGET_OS_IS_DARWIN", "BOTAN_TARGET_OS_HAS_GETTIMEOFDAY",
|
||||
"BOTAN_HAS_ALLOC_MMAP", "BOTAN_HAS_ENTROPY_SRC_DEV_RANDOM",
|
||||
"BOTAN_HAS_ENTROPY_SRC_EGD", "BOTAN_HAS_ENTROPY_SRC_FTW",
|
||||
|
||||
|
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
|
Before Width: | Height: | Size: 94 B After Width: | Height: | Size: 94 B |
|
Before Width: | Height: | Size: 96 B After Width: | Height: | Size: 96 B |
|
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 165 B |
|
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "synchronousprocess.h"
|
||||
#include "hostosinfo.h"
|
||||
#include "theme/theme.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFileDialog>
|
||||
@@ -226,6 +227,7 @@ PathChooser::PathChooser(QWidget *parent) :
|
||||
connect(d->m_lineEdit, &QLineEdit::textChanged, this, [this] { emit pathChanged(path()); });
|
||||
|
||||
d->m_lineEdit->setMinimumWidth(120);
|
||||
d->m_lineEdit->setErrorColor(creatorTheme()->color(Theme::TextColorError));
|
||||
d->m_hLayout->addWidget(d->m_lineEdit);
|
||||
d->m_hLayout->setSizeConstraint(QLayout::SetMinimumSize);
|
||||
|
||||
|
||||
@@ -66,14 +66,14 @@ QColor StyleHelper::mergedColors(const QColor &colorA, const QColor &colorB, int
|
||||
|
||||
QColor StyleHelper::alphaBlendedColors(const QColor &colorA, const QColor &colorB)
|
||||
{
|
||||
const QRgb base = colorA.rgba();
|
||||
const QRgb overlay = colorB.rgba();
|
||||
const qreal overlayIntensity = qAlpha(overlay) / 255.0;
|
||||
return qRgba(
|
||||
qMin(qRed(base) + qRound(qRed(overlay) * overlayIntensity), 0xff),
|
||||
qMin(qGreen(base) + qRound(qGreen(overlay) * overlayIntensity), 0xff),
|
||||
qMin(qBlue(base) + qRound(qBlue(overlay) * overlayIntensity), 0xff),
|
||||
qMin(qAlpha(base) + qAlpha(overlay), 0xff));
|
||||
const int alpha = colorB.alpha();
|
||||
const int antiAlpha = 255 - alpha;
|
||||
|
||||
return QColor(
|
||||
(colorA.red() * antiAlpha + colorB.red() * alpha) / 255,
|
||||
(colorA.green() * antiAlpha + colorB.green() * alpha) / 255,
|
||||
(colorA.blue() * antiAlpha + colorB.blue() * alpha) / 255
|
||||
);
|
||||
}
|
||||
|
||||
qreal StyleHelper::sidebarFontSize()
|
||||
@@ -114,6 +114,12 @@ QColor StyleHelper::m_requestedBaseColor;
|
||||
|
||||
QColor StyleHelper::baseColor(bool lightColored)
|
||||
{
|
||||
static const bool windowColorAsBase = creatorTheme()->flag(Theme::WindowColorAsBase);
|
||||
if (windowColorAsBase) {
|
||||
static const QColor windowColor = QApplication::palette().color(QPalette::Window);
|
||||
return windowColor;
|
||||
}
|
||||
|
||||
if (!lightColored)
|
||||
return m_baseColor;
|
||||
else
|
||||
|
||||
@@ -279,7 +279,10 @@ public:
|
||||
|
||||
/* ClangCodeModel Plugin */
|
||||
ClangCodeModel_Error_TextMarkColor,
|
||||
ClangCodeModel_Warning_TextMarkColor
|
||||
ClangCodeModel_Warning_TextMarkColor,
|
||||
|
||||
/* QmlDesigner */
|
||||
QmlDesigner_HighlightColor
|
||||
};
|
||||
|
||||
enum Gradient {
|
||||
@@ -323,7 +326,8 @@ public:
|
||||
FlatSideBarIcons,
|
||||
FlatProjectsMode,
|
||||
FlatMenuBar,
|
||||
ToolBarIconShadow
|
||||
ToolBarIconShadow,
|
||||
WindowColorAsBase
|
||||
};
|
||||
|
||||
bool flag(Flag f) const;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "effects.h"
|
||||
#include "reuse.h"
|
||||
|
||||
#include <utils/faketooltip.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -85,6 +86,17 @@ void ToolTip::show(const QPoint &pos, QWidget *content, QWidget *w, const QStrin
|
||||
instance()->showInternal(pos, QVariant::fromValue(content), WidgetContent, w, helpId, rect);
|
||||
}
|
||||
|
||||
void ToolTip::show(const QPoint &pos, QLayout *content, QWidget *w, const QString &helpId, const QRect &rect)
|
||||
{
|
||||
if (content && content->count()) {
|
||||
auto tooltipWidget = new FakeToolTip;
|
||||
tooltipWidget->setLayout(content);
|
||||
instance()->showInternal(pos, QVariant::fromValue(tooltipWidget), WidgetContent, w, helpId, rect);
|
||||
} else {
|
||||
instance()->hideTipWithDelay();
|
||||
}
|
||||
}
|
||||
|
||||
void ToolTip::move(const QPoint &pos, QWidget *w)
|
||||
{
|
||||
if (isVisible())
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QPoint;
|
||||
class QVariant;
|
||||
class QLayout;
|
||||
class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -76,6 +77,8 @@ public:
|
||||
const QString &helpId = QString(), const QRect &rect = QRect());
|
||||
static void show(const QPoint &pos, QWidget *content, QWidget *w = 0,
|
||||
const QString &helpId = QString(), const QRect &rect = QRect());
|
||||
static void show(const QPoint &pos, QLayout *content, QWidget *w = 0,
|
||||
const QString &helpId = QString(), const QRect &rect = QRect());
|
||||
static void move(const QPoint &pos, QWidget *w);
|
||||
static void hide();
|
||||
static void hideImmediately();
|
||||
|
||||
@@ -18,7 +18,7 @@ Project {
|
||||
if (qbs.targetOS.contains("windows")) {
|
||||
libs.push("user32", "iphlpapi", "ws2_32", "shell32");
|
||||
} else if (qbs.targetOS.contains("unix")) {
|
||||
if (!qbs.targetOS.contains("osx"))
|
||||
if (!qbs.targetOS.contains("macos"))
|
||||
libs.push("X11");
|
||||
if (!qbs.targetOS.contains("openbsd"))
|
||||
libs.push("pthread");
|
||||
@@ -29,7 +29,7 @@ Project {
|
||||
cpp.enableExceptions: true
|
||||
|
||||
Properties {
|
||||
condition: qbs.targetOS.contains("osx")
|
||||
condition: qbs.targetOS.contains("macos")
|
||||
cpp.frameworks: ["Foundation"]
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ Project {
|
||||
|
||||
Group {
|
||||
name: "FileUtils_osx"
|
||||
condition: qbs.targetOS.contains("osx")
|
||||
condition: qbs.targetOS.contains("macos")
|
||||
files: [
|
||||
"fileutils_mac.h", "fileutils_mac.mm",
|
||||
]
|
||||
|
||||
@@ -25,5 +25,11 @@
|
||||
<file>images/locked@2x.png</file>
|
||||
<file>images/unlocked.png</file>
|
||||
<file>images/unlocked@2x.png</file>
|
||||
<file>images/error.png</file>
|
||||
<file>images/error@2x.png</file>
|
||||
<file>images/notloaded.png</file>
|
||||
<file>images/notloaded@2x.png</file>
|
||||
<file>images/ok.png</file>
|
||||
<file>images/ok@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -50,6 +50,12 @@ const Utils::Icon ZOOM({
|
||||
{QLatin1String(":/utils/images/zoom.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint);
|
||||
const Utils::Icon ZOOM_TOOLBAR({
|
||||
{QLatin1String(":/utils/images/zoom.png"), Utils::Theme::IconsBaseColor}});
|
||||
const Utils::Icon OK({
|
||||
{QLatin1String(":/utils/images/ok.png"), Utils::Theme::IconsRunToolBarColor}}, Icon::Tint);
|
||||
const Utils::Icon NOTLOADED({
|
||||
{QLatin1String(":/utils/images/notloaded.png"), Utils::Theme::IconsErrorColor}}, Icon::Tint);
|
||||
const Utils::Icon ERROR({
|
||||
{QLatin1String(":/utils/images/error.png"), Utils::Theme::IconsErrorColor}}, Icon::Tint);
|
||||
|
||||
} // namespace Icons
|
||||
} // namespace Utils
|
||||
|
||||
@@ -72,35 +72,35 @@ AndroidAnalyzeSupport::AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig,
|
||||
|
||||
auto runner = new AndroidRunner(this, runConfig, runControl->runMode());
|
||||
|
||||
connect(runControl, &AnalyzerRunControl::finished,
|
||||
connect(runControl, &AnalyzerRunControl::finished, runner,
|
||||
[runner]() { runner->stop(); });
|
||||
|
||||
connect(runControl, &AnalyzerRunControl::starting,
|
||||
connect(runControl, &AnalyzerRunControl::starting, runner,
|
||||
[runner]() { runner->start(); });
|
||||
|
||||
connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
|
||||
connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort, this,
|
||||
[this, runControl](Utils::Port) {
|
||||
runControl->notifyRemoteSetupDone(m_qmlPort);
|
||||
});
|
||||
|
||||
connect(runner, &AndroidRunner::remoteProcessStarted,
|
||||
connect(runner, &AndroidRunner::remoteProcessStarted, this,
|
||||
[this](Utils::Port, Utils::Port qmlPort) {
|
||||
m_qmlPort = qmlPort;
|
||||
});
|
||||
|
||||
connect(runner, &AndroidRunner::remoteProcessFinished,
|
||||
connect(runner, &AndroidRunner::remoteProcessFinished, this,
|
||||
[this, runControl](const QString &errorMsg) {
|
||||
runControl->notifyRemoteFinished();
|
||||
runControl->appendMessage(errorMsg, Utils::NormalMessageFormat);
|
||||
});
|
||||
|
||||
connect(runner, &AndroidRunner::remoteErrorOutput,
|
||||
connect(runner, &AndroidRunner::remoteErrorOutput, this,
|
||||
[this, runControl](const QString &msg) {
|
||||
runControl->appendMessage(msg, Utils::StdErrFormatSameLine);
|
||||
m_outputParser.processOutput(msg);
|
||||
});
|
||||
|
||||
connect(runner, &AndroidRunner::remoteOutput,
|
||||
connect(runner, &AndroidRunner::remoteOutput, this,
|
||||
[this, runControl](const QString &msg) {
|
||||
runControl->appendMessage(msg, Utils::StdOutFormatSameLine);
|
||||
m_outputParser.processOutput(msg);
|
||||
|
||||
@@ -151,7 +151,12 @@ void TestConfiguration::completeTestInformation(int runMode)
|
||||
Runnable runnable = rc->runnable();
|
||||
if (isLocal(rc) && runnable.is<StandardRunnable>()) {
|
||||
StandardRunnable stdRunnable = runnable.as<StandardRunnable>();
|
||||
if (stdRunnable.executable == targetFile) {
|
||||
// we might have an executable that gets installed - in such a case the
|
||||
// runnable's executable and targetFile won't match - but the (unique) display name
|
||||
// of the run configuration should match targetName
|
||||
if (stdRunnable.executable == targetFile
|
||||
|| (!targetName.isEmpty() && rc->displayName() == targetName)) {
|
||||
targetFile = stdRunnable.executable;
|
||||
workDir = Utils::FileUtils::normalizePathName(stdRunnable.workingDirectory);
|
||||
env = stdRunnable.environment;
|
||||
hasDesktopTarget = true;
|
||||
|
||||
@@ -517,7 +517,7 @@ void TestResultsPane::updateRunActions()
|
||||
{
|
||||
QString whyNot;
|
||||
TestTreeModel *model = TestTreeModel::instance();
|
||||
const bool enable = !model->parser()->isParsing() && model->hasTests()
|
||||
const bool enable = !m_testRunning && !model->parser()->isParsing() && model->hasTests()
|
||||
&& ProjectExplorer::ProjectExplorerPlugin::canRunStartupProject(
|
||||
ProjectExplorer::Constants::NORMAL_RUN_MODE, &whyNot);
|
||||
m_runAll->setEnabled(enable);
|
||||
|
||||
@@ -323,6 +323,7 @@ void TestRunner::debugTests()
|
||||
return;
|
||||
}
|
||||
|
||||
connect(this, &TestRunner::requestStopTestRun, runControl, &Debugger::DebuggerRunControl::stop);
|
||||
connect(runControl, &Debugger::DebuggerRunControl::finished, this, &TestRunner::onFinished);
|
||||
ProjectExplorer::ProjectExplorerPlugin::startRunControl(
|
||||
runControl, ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
||||
|
||||
@@ -34,15 +34,22 @@
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
const int SORT_LIMIT = 30000;
|
||||
|
||||
ClangAssistProposalModel::ClangAssistProposalModel(
|
||||
ClangBackEnd::CompletionCorrection neededCorrection)
|
||||
: m_neededCorrection(neededCorrection)
|
||||
{
|
||||
}
|
||||
|
||||
bool ClangAssistProposalModel::containsDuplicates() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ClangAssistProposalModel::isSortable(const QString &/*prefix*/) const
|
||||
{
|
||||
return true;
|
||||
return m_currentItems.size() <= SORT_LIMIT;
|
||||
}
|
||||
|
||||
void ClangAssistProposalModel::sort(const QString &/*prefix*/)
|
||||
|
||||
@@ -39,6 +39,8 @@ class ClangAssistProposalModel : public TextEditor::GenericProposalModel
|
||||
public:
|
||||
ClangAssistProposalModel(ClangBackEnd::CompletionCorrection neededCorrection);
|
||||
|
||||
bool containsDuplicates() const override;
|
||||
|
||||
bool isSortable(const QString &prefix) const override;
|
||||
void sort(const QString &prefix) override;
|
||||
|
||||
|
||||
@@ -91,8 +91,6 @@ QList<AssistProposalItemInterface *> toAssistProposalItems(const CodeCompletions
|
||||
item->addOverload(codeCompletion);
|
||||
} else {
|
||||
item = new ClangAssistProposalItem;
|
||||
QString detail = CompletionChunksToTextConverter::convertToToolTipWithHtml(codeCompletion.chunks());
|
||||
|
||||
items.insert(name, item);
|
||||
|
||||
item->setText(name);
|
||||
@@ -138,7 +136,8 @@ using namespace CPlusPlus;
|
||||
using namespace TextEditor;
|
||||
|
||||
ClangCompletionAssistProcessor::ClangCompletionAssistProcessor()
|
||||
: m_completionOperator(T_EOF_SYMBOL)
|
||||
: CppCompletionAssistProcessor(100)
|
||||
, m_completionOperator(T_EOF_SYMBOL)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -345,10 +345,7 @@ void ClangDiagnosticManager::addClangTextMarks(
|
||||
const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics)
|
||||
{
|
||||
for (const ClangBackEnd::DiagnosticContainer &diagnostic : diagnostics) {
|
||||
auto textMark = new ClangTextMark(filePath(),
|
||||
diagnostic.location().line(),
|
||||
diagnostic.severity());
|
||||
textMark->setToolTip(diagnostic.text());
|
||||
auto textMark = new ClangTextMark(filePath(), diagnostic);
|
||||
m_clangTextMarks.push_back(textMark);
|
||||
m_textDocument->addMark(textMark);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
void addChildrenToLayout(const QString &mainFilePath,
|
||||
const QVector<ClangBackEnd::DiagnosticContainer>::const_iterator first,
|
||||
const QVector<ClangBackEnd::DiagnosticContainer>::const_iterator last,
|
||||
QBoxLayout &boxLayout)
|
||||
QLayout &boxLayout)
|
||||
{
|
||||
for (auto it = first; it != last; ++it)
|
||||
boxLayout.addWidget(createDiagnosticLabel(*it, mainFilePath, IndentDiagnostic));
|
||||
@@ -194,7 +194,7 @@ void addChildrenToLayout(const QString &mainFilePath,
|
||||
|
||||
void setupChildDiagnostics(const QString &mainFilePath,
|
||||
const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics,
|
||||
QBoxLayout &boxLayout)
|
||||
QLayout &boxLayout)
|
||||
{
|
||||
if (diagnostics.size() <= 10) {
|
||||
addChildrenToLayout(mainFilePath, diagnostics.begin(), diagnostics.end(), boxLayout);
|
||||
@@ -214,22 +214,13 @@ void setupChildDiagnostics(const QString &mainFilePath,
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
ClangDiagnosticToolTipWidget::ClangDiagnosticToolTipWidget(
|
||||
const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics,
|
||||
QWidget *parent)
|
||||
: Utils::FakeToolTip(parent)
|
||||
void addToolTipToLayout(const ClangBackEnd::DiagnosticContainer &diagnostic, QLayout *target)
|
||||
{
|
||||
auto *mainLayout = createLayout<QVBoxLayout>();
|
||||
// Set up header and text row for main diagnostic
|
||||
target->addWidget(new MainDiagnosticWidget(diagnostic));
|
||||
|
||||
foreach (const auto &diagnostic, diagnostics) {
|
||||
// Set up header and text row for main diagnostic
|
||||
mainLayout->addWidget(new MainDiagnosticWidget(diagnostic));
|
||||
|
||||
// Set up child rows for notes
|
||||
setupChildDiagnostics(diagnostic.location().filePath(), diagnostic.children(), *mainLayout);
|
||||
}
|
||||
|
||||
setLayout(mainLayout);
|
||||
// Set up child rows for notes
|
||||
setupChildDiagnostics(diagnostic.location().filePath(), diagnostic.children(), *target);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -27,19 +27,14 @@
|
||||
|
||||
#include <clangbackendipc/diagnosticcontainer.h>
|
||||
|
||||
#include <utils/faketooltip.h>
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLayout;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
class ClangDiagnosticToolTipWidget : public Utils::FakeToolTip
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ClangDiagnosticToolTipWidget(
|
||||
const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics,
|
||||
QWidget *parent = 0);
|
||||
};
|
||||
void addToolTipToLayout(const ClangBackEnd::DiagnosticContainer &diagnostic, QLayout *target);
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ClangCodeModel
|
||||
|
||||
@@ -35,7 +35,8 @@ ClangEditorDocumentParser::ClangEditorDocumentParser(const QString &filePath)
|
||||
setConfiguration(config);
|
||||
}
|
||||
|
||||
void ClangEditorDocumentParser::updateHelper(const CppTools::WorkingCopy &)
|
||||
void ClangEditorDocumentParser::updateHelper(const QFutureInterface<void> &,
|
||||
const CppTools::WorkingCopy &)
|
||||
{
|
||||
State state_ = state();
|
||||
state_.projectPart = determineProjectPart(filePath(), configuration(), state_);
|
||||
|
||||
@@ -37,7 +37,8 @@ public:
|
||||
ClangEditorDocumentParser(const QString &filePath);
|
||||
|
||||
private:
|
||||
void updateHelper(const CppTools::WorkingCopy &) override;
|
||||
void updateHelper(const QFutureInterface<void> &future,
|
||||
const CppTools::WorkingCopy &) override;
|
||||
};
|
||||
|
||||
} // namespace ClangCodeModel
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
#include <cplusplus/CppDocument.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/tooltip/tooltip.h>
|
||||
#include <utils/runextensions.h>
|
||||
|
||||
#include <QTextBlock>
|
||||
@@ -244,16 +243,12 @@ bool ClangEditorDocumentProcessor::hasDiagnosticsAt(uint line, uint column) cons
|
||||
return m_diagnosticManager.hasDiagnosticsAt(line, column);
|
||||
}
|
||||
|
||||
void ClangEditorDocumentProcessor::showDiagnosticTooltip(const QPoint &point,
|
||||
QWidget *parent,
|
||||
uint line,
|
||||
uint column) const
|
||||
void ClangEditorDocumentProcessor::addDiagnosticToolTipToLayout(uint line,
|
||||
uint column,
|
||||
QLayout *target) const
|
||||
{
|
||||
const QVector<ClangBackEnd::DiagnosticContainer> diagnostics
|
||||
= m_diagnosticManager.diagnosticsAt(line, column);
|
||||
auto *tooltipWidget = new ClangDiagnosticToolTipWidget(diagnostics, parent);
|
||||
|
||||
::Utils::ToolTip::show(point, tooltipWidget, parent);
|
||||
foreach (const auto &diagnostic, m_diagnosticManager.diagnosticsAt(line, column))
|
||||
addToolTipToLayout(diagnostic, target);
|
||||
}
|
||||
|
||||
ClangBackEnd::FileContainer ClangEditorDocumentProcessor::fileContainerWithArguments() const
|
||||
|
||||
@@ -76,10 +76,7 @@ public:
|
||||
extraRefactoringOperations(const TextEditor::AssistInterface &assistInterface) override;
|
||||
|
||||
bool hasDiagnosticsAt(uint line, uint column) const override;
|
||||
void showDiagnosticTooltip(const QPoint &point,
|
||||
QWidget *parent,
|
||||
uint line,
|
||||
uint column) const override;
|
||||
void addDiagnosticToolTipToLayout(uint line, uint column, QLayout *target) const override;
|
||||
|
||||
ClangBackEnd::FileContainer fileContainerWithArguments() const;
|
||||
|
||||
|
||||
@@ -26,10 +26,12 @@
|
||||
#include "clangtextmark.h"
|
||||
|
||||
#include "clangconstants.h"
|
||||
#include "clangdiagnostictooltipwidget.h"
|
||||
|
||||
#include <utils/icon.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
#include <QLayout>
|
||||
#include <QString>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
@@ -57,11 +59,13 @@ Core::Id cartegoryForSeverity(ClangBackEnd::DiagnosticSeverity severity)
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
ClangTextMark::ClangTextMark(const QString &fileName, int lineNumber, ClangBackEnd::DiagnosticSeverity severity)
|
||||
: TextEditor::TextMark(fileName, lineNumber, cartegoryForSeverity(severity))
|
||||
|
||||
ClangTextMark::ClangTextMark(const QString &fileName, const ClangBackEnd::DiagnosticContainer &diagnostic)
|
||||
: TextEditor::TextMark(fileName, int(diagnostic.location().line()), cartegoryForSeverity(diagnostic.severity())),
|
||||
m_diagnostic(diagnostic)
|
||||
{
|
||||
setPriority(TextEditor::TextMark::HighPriority);
|
||||
setIcon(severity);
|
||||
setIcon(diagnostic.severity());
|
||||
}
|
||||
|
||||
void ClangTextMark::setIcon(ClangBackEnd::DiagnosticSeverity severity)
|
||||
@@ -79,5 +83,10 @@ void ClangTextMark::setIcon(ClangBackEnd::DiagnosticSeverity severity)
|
||||
TextMark::setIcon(errorIcon);
|
||||
}
|
||||
|
||||
void ClangTextMark::addToToolTipLayout(QLayout *target)
|
||||
{
|
||||
Internal::addToolTipToLayout(m_diagnostic, target);
|
||||
}
|
||||
|
||||
} // namespace ClangCodeModel
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <clangbackendipc_global.h>
|
||||
#include <clangbackendipc/diagnosticcontainer.h>
|
||||
|
||||
#include <texteditor/textmark.h>
|
||||
|
||||
@@ -34,10 +35,13 @@ namespace ClangCodeModel {
|
||||
class ClangTextMark : public TextEditor::TextMark
|
||||
{
|
||||
public:
|
||||
ClangTextMark(const QString &fileName, int lineNumber, ClangBackEnd::DiagnosticSeverity severity);
|
||||
ClangTextMark(const QString &fileName, const ClangBackEnd::DiagnosticContainer &diagnostic);
|
||||
|
||||
private:
|
||||
void addToToolTipLayout(QLayout *target);
|
||||
void setIcon(ClangBackEnd::DiagnosticSeverity severity);
|
||||
|
||||
ClangBackEnd::DiagnosticContainer m_diagnostic;
|
||||
};
|
||||
|
||||
} // namespace ClangCodeModel
|
||||
|
||||
@@ -446,6 +446,21 @@ static Core::Id toolchainType(ProjectExplorer::RunConfiguration *runConfiguratio
|
||||
return ToolChainKitInformation::toolChain(runConfiguration->target()->kit(), ToolChain::Language::Cxx)->typeId();
|
||||
}
|
||||
|
||||
static QString executableForVersionCheck(Core::Id toolchainType, const QString &executable)
|
||||
{
|
||||
if (toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) {
|
||||
const QString suffix = QLatin1String("-cl.exe");
|
||||
if (executable.endsWith(suffix, Utils::HostOsInfo::fileNameCaseSensitivity())) {
|
||||
QString modified = executable;
|
||||
modified.chop(suffix.length());
|
||||
modified.append(QLatin1String(".exe"));
|
||||
return modified;
|
||||
}
|
||||
}
|
||||
|
||||
return executable;
|
||||
}
|
||||
|
||||
void ClangStaticAnalyzerRunControl::start()
|
||||
{
|
||||
m_success = false;
|
||||
@@ -458,7 +473,8 @@ void ClangStaticAnalyzerRunControl::start()
|
||||
|
||||
// Check clang executable
|
||||
bool isValidClangExecutable;
|
||||
const QString executable = clangExecutableFromSettings(toolchainType(runConfiguration()),
|
||||
const Core::Id theToolchainType = toolchainType(runConfiguration());
|
||||
const QString executable = clangExecutableFromSettings(theToolchainType,
|
||||
&isValidClangExecutable);
|
||||
if (!isValidClangExecutable) {
|
||||
const QString errorMessage = tr("Clang Static Analyzer: Invalid executable \"%1\", stop.")
|
||||
@@ -471,12 +487,13 @@ void ClangStaticAnalyzerRunControl::start()
|
||||
}
|
||||
|
||||
// Check clang version
|
||||
const ClangExecutableVersion version = clangExecutableVersion(executable);
|
||||
const QString versionCheckExecutable = executableForVersionCheck(theToolchainType, executable);
|
||||
const ClangExecutableVersion version = clangExecutableVersion(versionCheckExecutable);
|
||||
if (!version.isValid()) {
|
||||
const QString warningMessage
|
||||
= tr("Clang Static Analyzer: Running with possibly unsupported version, "
|
||||
"could not determine version from executable \"%1\".")
|
||||
.arg(executable);
|
||||
.arg(versionCheckExecutable);
|
||||
appendMessage(warningMessage + QLatin1Char('\n'), Utils::StdErrFormat);
|
||||
TaskHub::addTask(Task::Warning, warningMessage, Debugger::Constants::ANALYZERTASK_ID);
|
||||
TaskHub::requestPopup();
|
||||
|
||||
@@ -3,7 +3,7 @@ import qbs 1.0
|
||||
QtcPlugin {
|
||||
name: "ClearCase"
|
||||
|
||||
pluginJsonReplacements: ({"CLEARCASE_DISABLED_STR": (qbs.targetOS.contains("osx") ? "true": "false")})
|
||||
pluginJsonReplacements: ({"CLEARCASE_DISABLED_STR": (qbs.targetOS.contains("macos") ? "true": "false")})
|
||||
|
||||
Depends { name: "Qt.widgets" }
|
||||
Depends { name: "Utils" }
|
||||
|
||||
@@ -27,7 +27,7 @@ Project {
|
||||
return ["ole32", "user32"]
|
||||
}
|
||||
|
||||
cpp.frameworks: qbs.targetOS.contains("osx") ? ["AppKit"] : undefined
|
||||
cpp.frameworks: qbs.targetOS.contains("macos") ? ["AppKit"] : undefined
|
||||
|
||||
Group {
|
||||
name: "General"
|
||||
@@ -176,7 +176,7 @@ Project {
|
||||
|
||||
Group {
|
||||
name: "ProgressManager_mac"
|
||||
condition: qbs.targetOS.contains("osx")
|
||||
condition: qbs.targetOS.contains("macos")
|
||||
files: [
|
||||
"progressmanager/progressmanager_mac.mm",
|
||||
]
|
||||
@@ -184,7 +184,7 @@ Project {
|
||||
|
||||
Group {
|
||||
name: "ProgressManager_x11"
|
||||
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("osx")
|
||||
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")
|
||||
files: [
|
||||
"progressmanager/progressmanager_x11.cpp",
|
||||
]
|
||||
@@ -288,7 +288,7 @@ Project {
|
||||
|
||||
Group {
|
||||
name: "Locator_mac"
|
||||
condition: qbs.targetOS.contains("osx")
|
||||
condition: qbs.targetOS.contains("macos")
|
||||
files: [
|
||||
"locator/spotlightlocatorfilter.h",
|
||||
"locator/spotlightlocatorfilter.mm",
|
||||
|
||||
@@ -273,6 +273,7 @@ ProgressManagerPrivate::ProgressManagerPrivate()
|
||||
m_progressViewPinned(false),
|
||||
m_hovered(false)
|
||||
{
|
||||
m_opacityEffect->setOpacity(1);
|
||||
m_instance = this;
|
||||
m_progressView = new ProgressView;
|
||||
// withDelay, so the statusBarWidget has the chance to get the enter event
|
||||
@@ -346,7 +347,7 @@ void ProgressManagerPrivate::init()
|
||||
this, &ProgressManagerPrivate::progressDetailsToggled);
|
||||
toggleButton->setDefaultAction(cmd->action());
|
||||
|
||||
m_progressView->setVisible(m_progressViewPinned);
|
||||
updateVisibility();
|
||||
|
||||
initInternal();
|
||||
}
|
||||
|
||||
@@ -36,9 +36,11 @@
|
||||
#include <texteditor/texteditor.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/tooltip/tooltip.h>
|
||||
|
||||
#include <QTextCursor>
|
||||
#include <QUrl>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
using namespace Core;
|
||||
using namespace TextEditor;
|
||||
@@ -74,8 +76,13 @@ void processWithEditorDocumentProcessor(TextEditorWidget *editorWidget,
|
||||
{
|
||||
if (CppTools::BaseEditorDocumentProcessor *processor = editorDocumentProcessor(editorWidget)) {
|
||||
int line, column;
|
||||
if (Convenience::convertPosition(editorWidget->document(), position, &line, &column))
|
||||
processor->showDiagnosticTooltip(point, editorWidget, line, column);
|
||||
if (Convenience::convertPosition(editorWidget->document(), position, &line, &column)) {
|
||||
auto layout = new QVBoxLayout;
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(2);
|
||||
processor->addDiagnosticToolTipToLayout(line, column, layout);
|
||||
Utils::ToolTip::show(point, layout, editorWidget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,9 +77,16 @@ void BaseEditorDocumentParser::setConfiguration(const Configuration &configurati
|
||||
}
|
||||
|
||||
void BaseEditorDocumentParser::update(const WorkingCopy &workingCopy)
|
||||
{
|
||||
QFutureInterface<void> dummy;
|
||||
update(dummy, workingCopy);
|
||||
}
|
||||
|
||||
void BaseEditorDocumentParser::update(const QFutureInterface<void> &future,
|
||||
const WorkingCopy &workingCopy)
|
||||
{
|
||||
QMutexLocker locker(&m_updateIsRunning);
|
||||
updateHelper(workingCopy);
|
||||
updateHelper(future, workingCopy);
|
||||
}
|
||||
|
||||
BaseEditorDocumentParser::State BaseEditorDocumentParser::state() const
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "cppworkingcopy.h"
|
||||
#include "projectpart.h"
|
||||
|
||||
#include <QFutureInterface>
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
|
||||
@@ -39,7 +40,7 @@ class CPPTOOLS_EXPORT BaseEditorDocumentParser : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
using Ptr = QSharedPointer<BaseEditorDocumentParser>;;
|
||||
using Ptr = QSharedPointer<BaseEditorDocumentParser>;
|
||||
static Ptr get(const QString &filePath);
|
||||
|
||||
struct Configuration {
|
||||
@@ -58,6 +59,7 @@ public:
|
||||
void setConfiguration(const Configuration &configuration);
|
||||
|
||||
void update(const WorkingCopy &workingCopy);
|
||||
void update(const QFutureInterface<void> &future, const WorkingCopy &workingCopy);
|
||||
|
||||
ProjectPart::Ptr projectPart() const;
|
||||
|
||||
@@ -76,7 +78,8 @@ protected:
|
||||
mutable QMutex m_stateAndConfigurationMutex;
|
||||
|
||||
private:
|
||||
virtual void updateHelper(const WorkingCopy &workingCopy) = 0;
|
||||
virtual void updateHelper(const QFutureInterface<void> &future,
|
||||
const WorkingCopy &workingCopy) = 0;
|
||||
|
||||
const QString m_filePath;
|
||||
Configuration m_configuration;
|
||||
|
||||
@@ -63,7 +63,7 @@ bool BaseEditorDocumentProcessor::hasDiagnosticsAt(uint, uint) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void BaseEditorDocumentProcessor::showDiagnosticTooltip(const QPoint &, QWidget *, uint, uint) const
|
||||
void BaseEditorDocumentProcessor::addDiagnosticToolTipToLayout(uint, uint, QLayout *) const
|
||||
{
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ void BaseEditorDocumentProcessor::runParser(QFutureInterface<void> &future,
|
||||
return;
|
||||
}
|
||||
|
||||
parser->update(workingCopy);
|
||||
parser->update(future, workingCopy);
|
||||
CppToolsBridge::finishedRefreshingSourceFiles({parser->filePath()});
|
||||
|
||||
future.setProgressValue(1);
|
||||
|
||||
@@ -65,10 +65,7 @@ public:
|
||||
extraRefactoringOperations(const TextEditor::AssistInterface &assistInterface);
|
||||
|
||||
virtual bool hasDiagnosticsAt(uint line, uint column) const;
|
||||
virtual void showDiagnosticTooltip(const QPoint &point,
|
||||
QWidget *parent,
|
||||
uint line,
|
||||
uint column) const;
|
||||
virtual void addDiagnosticToolTipToLayout(uint line, uint column, QLayout *layout) const;
|
||||
|
||||
signals:
|
||||
// Signal interface to implement
|
||||
|
||||
@@ -55,7 +55,8 @@ BuiltinEditorDocumentParser::BuiltinEditorDocumentParser(const QString &filePath
|
||||
qRegisterMetaType<CPlusPlus::Snapshot>("CPlusPlus::Snapshot");
|
||||
}
|
||||
|
||||
void BuiltinEditorDocumentParser::updateHelper(const WorkingCopy &theWorkingCopy)
|
||||
void BuiltinEditorDocumentParser::updateHelper(const QFutureInterface<void> &future,
|
||||
const WorkingCopy &theWorkingCopy)
|
||||
{
|
||||
if (filePath().isEmpty())
|
||||
return;
|
||||
@@ -181,6 +182,10 @@ void BuiltinEditorDocumentParser::updateHelper(const WorkingCopy &theWorkingCopy
|
||||
if (releaseSourceAndAST_)
|
||||
doc->releaseSourceAndAST();
|
||||
});
|
||||
sourceProcessor.setCancelChecker([future]() {
|
||||
return future.isCanceled();
|
||||
});
|
||||
|
||||
Snapshot globalSnapshot = modelManager->snapshot();
|
||||
globalSnapshot.remove(filePath());
|
||||
sourceProcessor.setGlobalSnapshot(globalSnapshot);
|
||||
|
||||
@@ -58,7 +58,8 @@ public:
|
||||
static Ptr get(const QString &filePath);
|
||||
|
||||
private:
|
||||
void updateHelper(const WorkingCopy &workingCopy) override;
|
||||
void updateHelper(const QFutureInterface<void> &future,
|
||||
const WorkingCopy &workingCopy) override;
|
||||
void addFileAndDependencies(CPlusPlus::Snapshot *snapshot,
|
||||
QSet<Utils::FileName> *toRemove,
|
||||
const Utils::FileName &fileName) const;
|
||||
|
||||
@@ -40,7 +40,7 @@ using namespace CPlusPlus;
|
||||
|
||||
namespace CppTools {
|
||||
|
||||
CppCompletionAssistProcessor::CppCompletionAssistProcessor()
|
||||
CppCompletionAssistProcessor::CppCompletionAssistProcessor(int snippetItemOrder)
|
||||
: m_positionForProposal(-1)
|
||||
, m_preprocessorCompletions(QStringList()
|
||||
<< QLatin1String("define")
|
||||
@@ -72,7 +72,8 @@ CppCompletionAssistProcessor::CppCompletionAssistProcessor()
|
||||
<< QLatin1String("endif"))
|
||||
, m_hintProposal(0)
|
||||
, m_snippetCollector(QLatin1String(CppEditor::Constants::CPP_SNIPPETS_GROUP_ID),
|
||||
QIcon(QLatin1String(":/texteditor/images/snippet.png")))
|
||||
QIcon(QLatin1String(":/texteditor/images/snippet.png")),
|
||||
snippetItemOrder)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace CppTools {
|
||||
class CPPTOOLS_EXPORT CppCompletionAssistProcessor : public TextEditor::IAssistProcessor
|
||||
{
|
||||
public:
|
||||
CppCompletionAssistProcessor();
|
||||
CppCompletionAssistProcessor(int snippetItemOrder = 0);
|
||||
|
||||
protected:
|
||||
void addSnippets();
|
||||
|
||||
@@ -121,6 +121,11 @@ CppSourceProcessor::CppSourceProcessor(const Snapshot &snapshot, DocumentCallbac
|
||||
CppSourceProcessor::~CppSourceProcessor()
|
||||
{ }
|
||||
|
||||
void CppSourceProcessor::setCancelChecker(const CppSourceProcessor::CancelChecker &cancelChecker)
|
||||
{
|
||||
m_preprocess.setCancelChecker(cancelChecker);
|
||||
}
|
||||
|
||||
void CppSourceProcessor::setWorkingCopy(const WorkingCopy &workingCopy)
|
||||
{ m_workingCopy = workingCopy; }
|
||||
|
||||
|
||||
@@ -59,6 +59,9 @@ public:
|
||||
CppSourceProcessor(const CPlusPlus::Snapshot &snapshot, DocumentCallback documentFinished);
|
||||
~CppSourceProcessor();
|
||||
|
||||
using CancelChecker = std::function<bool()>;
|
||||
void setCancelChecker(const CancelChecker &cancelChecker);
|
||||
|
||||
void setWorkingCopy(const CppTools::WorkingCopy &workingCopy);
|
||||
void setHeaderPaths(const ProjectPartHeaderPaths &headerPaths);
|
||||
void setLanguageFeatures(CPlusPlus::LanguageFeatures languageFeatures);
|
||||
|
||||
@@ -80,7 +80,6 @@ ConsoleView::ConsoleView(ConsoleItemModel *model, QWidget *parent) :
|
||||
setFrameStyle(QFrame::NoFrame);
|
||||
setHeaderHidden(true);
|
||||
setRootIsDecorated(false);
|
||||
setUniformRowHeights(true);
|
||||
setEditTriggers(QAbstractItemView::AllEditTriggers);
|
||||
setStyleSheet(QLatin1String("QTreeView::branch:has-siblings:!adjoins-item {"
|
||||
"border-image: none;"
|
||||
|
||||
@@ -265,7 +265,7 @@ void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId,
|
||||
|
||||
ICore::removeAdditionalContext(Context(Id::fromName(m_currentPerspectiveId)));
|
||||
const Perspective *perspective = m_perspectiveForPerspectiveId.value(m_currentPerspectiveId);
|
||||
QWidget *central = perspective->centralWidget();
|
||||
QWidget *central = perspective ? perspective->centralWidget() : nullptr;
|
||||
m_centralWidgetStack->removeWidget(central ? central : m_editorPlaceHolder);
|
||||
}
|
||||
|
||||
|
||||
@@ -664,7 +664,7 @@ void QmlEngine::interruptInferior()
|
||||
{
|
||||
showMessage(INTERRUPT, LogInput);
|
||||
d->runDirectCommand(INTERRUPT);
|
||||
notifyInferiorStopOk();
|
||||
showStatusMessage(tr("Waiting for JavaScript engine to interrupt on next statement."));
|
||||
}
|
||||
|
||||
void QmlEngine::executeStep()
|
||||
@@ -1961,7 +1961,8 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data)
|
||||
}
|
||||
engine->notifyInferiorSpontaneousStop();
|
||||
backtrace();
|
||||
} else if (engine->state() == InferiorStopOk) {
|
||||
} else if (engine->state() == InferiorStopRequested) {
|
||||
engine->notifyInferiorStopOk();
|
||||
backtrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ QtcPlugin {
|
||||
Depends { name: "QmlDebug" }
|
||||
Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] }
|
||||
|
||||
cpp.frameworks: base.concat(qbs.targetOS.contains("osx") ? ["CoreFoundation", "IOKit"] : [])
|
||||
cpp.frameworks: base.concat(qbs.targetOS.contains("macos") ? ["CoreFoundation", "IOKit"] : [])
|
||||
|
||||
files: [
|
||||
"ios.qrc",
|
||||
|
||||
@@ -429,8 +429,17 @@
|
||||
<tabstop>errorFileNameCap</tabstop>
|
||||
<tabstop>errorLineNumberCap</tabstop>
|
||||
<tabstop>errorMessageCap</tabstop>
|
||||
<tabstop>errorStdOutChannel</tabstop>
|
||||
<tabstop>errorStdErrChannel</tabstop>
|
||||
<tabstop>errorOutputMessage</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>warningPattern</tabstop>
|
||||
<tabstop>warningFileNameCap</tabstop>
|
||||
<tabstop>warningLineNumberCap</tabstop>
|
||||
<tabstop>warningMessageCap</tabstop>
|
||||
<tabstop>warningStdOutChannel</tabstop>
|
||||
<tabstop>warningStdErrChannel</tabstop>
|
||||
<tabstop>warningOutputMessage</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
||||
@@ -152,7 +152,7 @@ void TargetSelectorDelegate::paint(QPainter *painter,
|
||||
|
||||
QFontMetrics fm(option.font);
|
||||
QString text = index.data(Qt::DisplayRole).toString();
|
||||
painter->setPen(QColor(255, 255, 255, 160));
|
||||
painter->setPen(creatorTheme()->color(Theme::MiniProjectTargetSelectorTextColor));
|
||||
QString elidedText = fm.elidedText(text, Qt::ElideMiddle, option.rect.width() - 12);
|
||||
if (elidedText != text)
|
||||
const_cast<QAbstractItemModel *>(index.model())->setData(index, text, Qt::ToolTipRole);
|
||||
@@ -174,7 +174,10 @@ ListWidget::ListWidget(QWidget *parent) : QListWidget(parent)
|
||||
setFocusPolicy(Qt::WheelFocus);
|
||||
setItemDelegate(new TargetSelectorDelegate(this));
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
setStyleSheet(QString::fromLatin1("QListWidget { background: #464646; border-style: none; }"));
|
||||
const QColor bgColor = creatorTheme()->color(Theme::MiniProjectTargetSelectorBackgroundColor);
|
||||
const QString bgColorName = creatorTheme()->flag(Theme::FlatToolBars)
|
||||
? bgColor.lighter(120).name() : bgColor.name();
|
||||
setStyleSheet(QString::fromLatin1("QListWidget { background: %1; border-style: none; }").arg(bgColorName));
|
||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Project {
|
||||
|
||||
cpp.defines: base.concat("QTC_CPU=X86Architecture")
|
||||
Properties {
|
||||
condition: qbs.targetOS.contains("osx")
|
||||
condition: qbs.targetOS.contains("macos")
|
||||
cpp.frameworks: base.concat(["Carbon"])
|
||||
}
|
||||
|
||||
|
||||
@@ -135,6 +135,12 @@
|
||||
<header location="global">utils/treeviewcombobox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>projectComboBox</tabstop>
|
||||
<tabstop>addToVersionControlComboBox</tabstop>
|
||||
<tabstop>vcsManageButton</tabstop>
|
||||
<tabstop>scrollArea</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -78,6 +78,99 @@ QPixmap QmlDesignerIconProvider::requestPixmap(const QString &id, QSize *size, c
|
||||
else if (id == "tr")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/tr.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "ok")
|
||||
result = Icon({
|
||||
{ ":/utils/images/ok.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "error")
|
||||
result = Icon({
|
||||
{ ":/utils/images/error.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "anchor-top")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/anchor_top.png", Theme::IconsBaseColor},
|
||||
{ ":/qmldesigner/images/anchoreditem.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "anchor-right")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/anchor_right.png", Theme::IconsBaseColor},
|
||||
{ ":/qmldesigner/images/anchoreditem.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "anchor-bottom")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/anchor_bottom.png", Theme::IconsBaseColor},
|
||||
{ ":/qmldesigner/images/anchoreditem.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "anchor-left")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/anchor_left.png", Theme::IconsBaseColor},
|
||||
{ ":/qmldesigner/images/anchoreditem.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "anchor-horizontal")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/anchor_horizontal.png", Theme::IconsBaseColor},
|
||||
{ ":/qmldesigner/images/anchoreditem.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "anchor-vertical")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/anchor_vertical.png", Theme::IconsBaseColor},
|
||||
{ ":/qmldesigner/images/anchoreditem.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "anchor-fill")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/anchor_fill.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-left")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_left.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-left-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_left.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-center")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_center.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-center-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_center.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-right")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_right.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-right-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_right.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-top")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_top.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-top-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_top.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-middle")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_middle.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-middle-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_middle.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-bottom")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_bottom.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "alignment-bottom-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/alignment_bottom.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "style-bold")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/style_bold.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "style-bold-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/style_bold.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "style-italic")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/style_italic.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "style-italic-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/style_italic.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "style-underline")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/style_underline.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "style-underline-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/style_underline.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "style-strikeout")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/style_strikeout.png", Theme::IconsBaseColor}}, Icon::Tint).pixmap();
|
||||
else if (id == "style-strikeout-h")
|
||||
result = Icon({
|
||||
{ ":/qmldesigner/images/style_strikeout.png", Theme::QmlDesigner_HighlightColor}}, Icon::Tint).pixmap();
|
||||
else
|
||||
qWarning() << Q_FUNC_INFO << "Image not found:" << id;
|
||||
|
||||
|
||||
@@ -27,31 +27,31 @@
|
||||
#include "qmldesignericonprovider.h"
|
||||
|
||||
#include <utils/theme/theme.h>
|
||||
#include <utils/stylehelper.h>
|
||||
|
||||
#include <QRegExp>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
QColor midtone(const QColor &a, const QColor &b)
|
||||
{
|
||||
QColor alphaB = b;
|
||||
alphaB.setAlpha(128);
|
||||
return Utils::StyleHelper::alphaBlendedColors(a ,alphaB);
|
||||
}
|
||||
|
||||
void Theming::insertTheme(QQmlPropertyMap *map)
|
||||
{
|
||||
const QVariantHash creatorTheme = Utils::creatorTheme()->values();
|
||||
for (auto it = creatorTheme.constBegin(); it != creatorTheme.constEnd(); ++it)
|
||||
map->insert(it.key(), it.value());
|
||||
|
||||
/* Custom Colors */
|
||||
|
||||
QColor darkerBackground = Utils::creatorTheme()->color(Utils::Theme::BackgroundColorDark);
|
||||
|
||||
if (darkerBackground.value() < 40)
|
||||
darkerBackground = darkerBackground.lighter(150);
|
||||
|
||||
map->insert("QmlDesignerBackgroundColorDarker", darkerBackground.darker(120));
|
||||
map->insert("QmlDesignerBackgroundColorLighter", darkerBackground.lighter(140));
|
||||
|
||||
if (darkerBackground.value() < 100)
|
||||
map->insert("QmlDesignerBackgroundColorDarkAlternate", darkerBackground.lighter(120));
|
||||
else
|
||||
map->insert("QmlDesignerBackgroundColorDarkAlternate", darkerBackground.lighter(110));
|
||||
/* Define QmlDesigner colors and remove alpha channels */
|
||||
const QColor panelStatusBarBackgroundColor = Utils::creatorTheme()->color(Utils::Theme::PanelStatusBarBackgroundColor);
|
||||
const QColor fancyToolButtonSelectedColor = Utils::creatorTheme()->color(Utils::Theme::FancyToolButtonSelectedColor);
|
||||
const QColor darkerBackground = Utils::StyleHelper::alphaBlendedColors(panelStatusBarBackgroundColor, fancyToolButtonSelectedColor);
|
||||
const QColor fancyToolButtonHoverColor = Utils::creatorTheme()->color(Utils::Theme::FancyToolButtonHoverColor);
|
||||
const QColor buttonColor = Utils::StyleHelper::alphaBlendedColors(panelStatusBarBackgroundColor, fancyToolButtonHoverColor);
|
||||
|
||||
Utils::creatorTheme()->color(Utils::Theme::PanelTextColorLight);
|
||||
QColor tabLight = Utils::creatorTheme()->color(Utils::Theme::PanelTextColorLight);
|
||||
@@ -64,8 +64,12 @@ void Theming::insertTheme(QQmlPropertyMap *map)
|
||||
tabDark = tabDark.darker(260);
|
||||
}
|
||||
|
||||
map->insert("QmlDesignerBackgroundColorDarker", darkerBackground);
|
||||
map->insert("QmlDesignerBackgroundColorDarkAlternate", midtone(panelStatusBarBackgroundColor, buttonColor));
|
||||
map->insert("QmlDesignerTabLight", tabLight);
|
||||
map->insert("QmlDesignerTabDark", tabDark);
|
||||
map->insert("QmlDesignerButtonColor", buttonColor);
|
||||
map->insert("QmlDesignerBorderColor", Utils::creatorTheme()->color(Utils::Theme::SplitterColor));
|
||||
}
|
||||
|
||||
QString Theming::replaceCssColors(const QString &input)
|
||||
|
||||
@@ -424,8 +424,10 @@ void FormEditorView::instanceInformationsChange(const QMultiHash<ModelNode, Info
|
||||
if (qmlItemNode.instanceBoundingRect().isEmpty() &&
|
||||
!(qmlItemNode.propertyAffectedByCurrentState("width")
|
||||
&& qmlItemNode.propertyAffectedByCurrentState("height"))) {
|
||||
rootModelNode().setAuxiliaryData("width", 640);
|
||||
rootModelNode().setAuxiliaryData("height", 480);
|
||||
if (!(rootModelNode().hasAuxiliaryData("width")))
|
||||
rootModelNode().setAuxiliaryData("width", 640);
|
||||
if (!(rootModelNode().hasAuxiliaryData("height")))
|
||||
rootModelNode().setAuxiliaryData("height", 480);
|
||||
rootModelNode().setAuxiliaryData("autoSize", true);
|
||||
formEditorWidget()->updateActions();
|
||||
} else {
|
||||
|
||||
@@ -91,6 +91,7 @@ void SelectionIndicator::setItems(const QList<FormEditorItem*> &itemList)
|
||||
newSelectionIndicatorGraphicsItem->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
||||
|
||||
QPen pen;
|
||||
pen.setJoinStyle(Qt::MiterJoin);
|
||||
pen.setColor(QColor(108, 141, 221));
|
||||
newSelectionIndicatorGraphicsItem->setPen(pen);
|
||||
newSelectionIndicatorGraphicsItem->setCursor(m_cursor);
|
||||
|
||||
@@ -36,11 +36,14 @@
|
||||
|
||||
#include <QVariant>
|
||||
#include <QMetaProperty>
|
||||
#include <QLoggingCategory>
|
||||
#include <QMimeData>
|
||||
#include <QPainter>
|
||||
#include <QPen>
|
||||
#include <qdebug.h>
|
||||
|
||||
static Q_LOGGING_CATEGORY(itemlibraryPopulate, "itemlibrary.populate")
|
||||
|
||||
static bool inline registerItemLibrarySortedModel() {
|
||||
qmlRegisterType<QmlDesigner::ItemLibrarySectionModel>();
|
||||
return true;
|
||||
@@ -150,23 +153,35 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
|
||||
if (import.isLibraryImport())
|
||||
imports << import.url() + QLatin1Char(' ') + import.version();
|
||||
|
||||
|
||||
qCInfo(itemlibraryPopulate) << Q_FUNC_INFO;
|
||||
foreach (ItemLibraryEntry entry, itemLibraryInfo->entries()) {
|
||||
|
||||
NodeMetaInfo metaInfo = model->metaInfo(entry.typeName());
|
||||
bool valid = metaInfo.isValid() && metaInfo.majorVersion() == entry.majorVersion();
|
||||
bool isItem = valid && metaInfo.isSubclassOf("QtQuick.Item");
|
||||
qCInfo(itemlibraryPopulate) << entry.typeName() << entry.majorVersion() << entry.minorVersion();
|
||||
|
||||
if (!isItem && valid) {
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << metaInfo.typeName() << "is not a QtQuick.Item";
|
||||
qDebug() << Utils::transform(metaInfo.superClasses(), &NodeMetaInfo::typeName);
|
||||
}
|
||||
NodeMetaInfo metaInfo = model->metaInfo(entry.typeName());
|
||||
|
||||
if (valid
|
||||
&& isItem //We can change if the navigator does support pure QObjects
|
||||
&& (entry.requiredImport().isEmpty()
|
||||
|| model->hasImport(entryToImport(entry), true, true))) {
|
||||
qCInfo(itemlibraryPopulate) << "valid: " << metaInfo.isValid() << metaInfo.majorVersion() << metaInfo.minorVersion();
|
||||
|
||||
bool valid = metaInfo.isValid() && metaInfo.majorVersion() == entry.majorVersion();
|
||||
bool isItem = valid && metaInfo.isSubclassOf("QtQuick.Item");
|
||||
|
||||
qCInfo(itemlibraryPopulate) << "isItem: " << isItem;
|
||||
|
||||
qCInfo(itemlibraryPopulate) << "required import: " << entry.requiredImport() << entryToImport(entry).toImportString();
|
||||
|
||||
if (!isItem && valid) {
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << metaInfo.typeName() << "is not a QtQuick.Item";
|
||||
qDebug() << Utils::transform(metaInfo.superClasses(), &NodeMetaInfo::typeName);
|
||||
}
|
||||
|
||||
if (valid
|
||||
&& isItem //We can change if the navigator does support pure QObjects
|
||||
&& (entry.requiredImport().isEmpty()
|
||||
|| model->hasImport(entryToImport(entry), true, true))) {
|
||||
QString itemSectionName = entry.category();
|
||||
qCInfo(itemlibraryPopulate) << "Adding:" << entry.typeName() << "to:" << entry.category();
|
||||
ItemLibrarySection *sectionModel = sectionByName(itemSectionName);
|
||||
|
||||
if (sectionModel == 0) {
|
||||
|
||||