Merge remote-tracking branch 'origin/4.11'

Change-Id: Ica0d173a08ff3f0296e875aa324d5bb6974bd90f
This commit is contained in:
Eike Ziller
2020-01-08 07:13:32 +01:00
36 changed files with 763 additions and 518 deletions

View File

@@ -173,6 +173,20 @@ def error(message):
def showException(msg, exType, exValue, exTraceback): def showException(msg, exType, exValue, exTraceback):
DumperBase.showException(msg, exType, exValue, exTraceback) DumperBase.showException(msg, exType, exValue, exTraceback)
class Timer:
def __init__(self, d, desc):
self.d = d
self.desc = desc + '-' + d.currentIName
def __enter__(self):
self.starttime = time.time()
def __exit__(self, exType, exValue, exTraceBack):
elapsed = int(1000 * (time.time() - self.starttime))
self.d.timings.append([self.desc, elapsed])
class Children: class Children:
def __init__(self, d, numChild = 1, childType = None, childNumChild = None, def __init__(self, d, numChild = 1, childType = None, childNumChild = None,
maxNumChild = None, addrBase = None, addrStep = None): maxNumChild = None, addrBase = None, addrStep = None):
@@ -261,6 +275,9 @@ class DumperBase:
except: except:
pass pass
def timer(self, desc):
return Timer(self, desc)
def __init__(self): def __init__(self):
self.isCdb = False self.isCdb = False
self.isGdb = False self.isGdb = False
@@ -372,12 +389,10 @@ class DumperBase:
self.counts = {} self.counts = {}
self.structPatternCache = {} self.structPatternCache = {}
self.pretimings = {}
self.timings = [] self.timings = []
def resetStats(self): def resetStats(self):
# Timing collection # Timing collection
self.pretimings = {}
self.timings = [] self.timings = []
pass pass
@@ -392,15 +407,6 @@ class DumperBase:
else: else:
self.counts[key] = 1 self.counts[key] = 1
def preping(self, key):
return
self.pretimings[key] = time.time()
def ping(self, key):
return
elapsed = int(1000 * (time.time() - self.pretimings[key]))
self.timings.append([key, elapsed])
def childRange(self): def childRange(self):
if self.currentMaxNumChild is None: if self.currentMaxNumChild is None:
return xrange(0, self.currentNumChild) return xrange(0, self.currentNumChild)
@@ -1369,9 +1375,8 @@ class DumperBase:
return False return False
def putFormattedPointer(self, value): def putFormattedPointer(self, value):
self.preping('formattedPointer') #with self.timer('formattedPointer'):
self.putFormattedPointerX(value) self.putFormattedPointerX(value)
self.ping('formattedPointer')
def putDerefedPointer(self, value): def putDerefedPointer(self, value):
derefValue = value.dereference() derefValue = value.dereference()
@@ -1735,15 +1740,13 @@ class DumperBase:
metaObjectPtr = 0 metaObjectPtr = 0
if not metaObjectPtr: if not metaObjectPtr:
# measured: 3 ms (example had one level of inheritance) # measured: 3 ms (example had one level of inheritance)
self.preping('metaObjectType-' + self.currentIName) #with self.timer('metaObjectType-' + self.currentIName):
metaObjectPtr = extractStaticMetaObjectPtrFromType(typeobj) metaObjectPtr = extractStaticMetaObjectPtrFromType(typeobj)
self.ping('metaObjectType-' + self.currentIName)
if not metaObjectPtr: if not metaObjectPtr:
# measured: 200 ms (example had one level of inheritance) # measured: 200 ms (example had one level of inheritance)
self.preping('metaObjectCall-' + self.currentIName) #with self.timer('metaObjectCall-' + self.currentIName):
metaObjectPtr = extractMetaObjectPtrFromAddress() metaObjectPtr = extractMetaObjectPtrFromAddress()
self.ping('metaObjectCall-' + self.currentIName)
#if metaObjectPtr: #if metaObjectPtr:
# self.bump('foundMetaObject') # self.bump('foundMetaObject')
@@ -2392,7 +2395,7 @@ class DumperBase:
def handleLocals(self, variables): def handleLocals(self, variables):
#warn('VARIABLES: %s' % variables) #warn('VARIABLES: %s' % variables)
self.preping('locals') #with self.timer('locals'):
shadowed = {} shadowed = {}
for value in variables: for value in variables:
if value.name == 'argv': if value.name == 'argv':
@@ -2412,20 +2415,17 @@ class DumperBase:
# A 'normal' local variable or parameter. # A 'normal' local variable or parameter.
iname = value.iname if hasattr(value, 'iname') else 'local.' + name iname = value.iname if hasattr(value, 'iname') else 'local.' + name
with TopLevelItem(self, iname): with TopLevelItem(self, iname):
self.preping('all-' + iname) #with self.timer('all-' + iname):
self.putField('iname', iname) self.putField('iname', iname)
self.putField('name', name) self.putField('name', name)
self.putItem(value) self.putItem(value)
self.ping('all-' + iname)
self.ping('locals')
def handleWatches(self, args): def handleWatches(self, args):
self.preping('watches') #with self.timer('watches'):
for watcher in args.get('watchers', []): for watcher in args.get('watchers', []):
iname = watcher['iname'] iname = watcher['iname']
exp = self.hexdecode(watcher['exp']) exp = self.hexdecode(watcher['exp'])
self.handleWatch(exp, exp, iname) self.handleWatch(exp, exp, iname)
self.ping('watches')
def handleWatch(self, origexp, exp, iname): def handleWatch(self, origexp, exp, iname):
exp = str(exp).strip() exp = str(exp).strip()
@@ -2734,9 +2734,8 @@ class DumperBase:
self.putSubItem(i, val) self.putSubItem(i, val)
def putItem(self, value): def putItem(self, value):
self.preping('putItem') #with self.timer('putItem'):
self.putItemX(value) self.putItemX(value)
self.ping('putItem')
def putItemX(self, value): def putItemX(self, value):
#warn('PUT ITEM: %s' % value.stringify()) #warn('PUT ITEM: %s' % value.stringify())
@@ -2868,9 +2867,8 @@ class DumperBase:
self.putEmptyValue() self.putEmptyValue()
#warn('STRUCT GUTS: %s ADDRESS: 0x%x ' % (value.name, value.address())) #warn('STRUCT GUTS: %s ADDRESS: 0x%x ' % (value.name, value.address()))
if self.showQObjectNames: if self.showQObjectNames:
self.preping(self.currentIName) #with self.timer(self.currentIName):
self.putQObjectNameValue(value) self.putQObjectNameValue(value)
self.ping(self.currentIName)
if self.isExpanded(): if self.isExpanded():
self.putField('sortable', 1) self.putField('sortable', 1)
with Children(self, 1, childType=None): with Children(self, 1, childType=None):
@@ -3351,7 +3349,7 @@ class DumperBase:
error('CANNOT CONVERT TO BYTES: %s' % self) error('CANNOT CONVERT TO BYTES: %s' % self)
def extractInteger(self, bitsize, unsigned): def extractInteger(self, bitsize, unsigned):
self.dumper.preping('extractInt') #with self.dumper.timer('extractInt'):
self.check() self.check()
if bitsize > 32: if bitsize > 32:
size = 8 size = 8
@@ -3369,23 +3367,21 @@ class DumperBase:
res = struct.unpack_from(self.dumper.packCode + code, rawBytes, 0)[0] res = struct.unpack_from(self.dumper.packCode + code, rawBytes, 0)[0]
#warn('Extract: Code: %s Bytes: %s Bitsize: %s Size: %s' #warn('Extract: Code: %s Bytes: %s Bitsize: %s Size: %s'
# % (self.dumper.packCode + code, self.dumper.hexencode(rawBytes), bitsize, size)) # % (self.dumper.packCode + code, self.dumper.hexencode(rawBytes), bitsize, size))
self.dumper.ping('extractInt')
return res return res
def extractSomething(self, code, bitsize): def extractSomething(self, code, bitsize):
self.dumper.preping('extractSomething') #with self.dumper.timer('extractSomething'):
self.check() self.check()
size = (bitsize + 7) >> 3 size = (bitsize + 7) >> 3
rawBytes = self.data(size) rawBytes = self.data(size)
res = struct.unpack_from(self.dumper.packCode + code, rawBytes, 0)[0] res = struct.unpack_from(self.dumper.packCode + code, rawBytes, 0)[0]
self.dumper.ping('extractSomething')
return res return res
def to(self, pattern): def to(self, pattern):
return self.split(pattern)[0] return self.split(pattern)[0]
def split(self, pattern): def split(self, pattern):
self.dumper.preping('split') #with self.dumper.timer('split'):
#warn('EXTRACT STRUCT FROM: %s' % self.type) #warn('EXTRACT STRUCT FROM: %s' % self.type)
(pp, size, fields) = self.dumper.describeStruct(pattern) (pp, size, fields) = self.dumper.describeStruct(pattern)
#warn('SIZE: %s ' % size) #warn('SIZE: %s ' % size)
@@ -3405,7 +3401,6 @@ class DumperBase:
return thing return thing
if len(fields) != len(result): if len(fields) != len(result):
error('STRUCT ERROR: %s %s' (fields, result)) error('STRUCT ERROR: %s %s' (fields, result))
self.dumper.ping('split')
return tuple(map(structFixer, fields, result)) return tuple(map(structFixer, fields, result))
def checkPointer(self, p, align = 1): def checkPointer(self, p, align = 1):
@@ -3548,9 +3543,8 @@ class DumperBase:
# FIXME: That buys some performance at the cost of a fail # FIXME: That buys some performance at the cost of a fail
# of Gdb13393 dumper test. # of Gdb13393 dumper test.
#return self #return self
self.dumper.preping('dynamicType %s 0x%s' % (self.name, address)) #with self.dumper.timer('dynamicType %s 0x%s' % (self.name, address)):
dynTypeName = self.dynamicTypeName(address) dynTypeName = self.dynamicTypeName(address)
self.dumper.ping('dynamicType %s 0x%s' % (self.name, address))
if dynTypeName is not None: if dynTypeName is not None:
return self.dumper.createType(dynTypeName) return self.dumper.createType(dynTypeName)
return self return self

View File

@@ -243,6 +243,10 @@ class Dumper(DumperBase):
nativeTargetValue = None nativeTargetValue = None
targetType = self.fromNativeType(nativeType.target().unqualified()) targetType = self.fromNativeType(nativeType.target().unqualified())
val = self.createPointerValue(toInteger(nativeValue), targetType) val = self.createPointerValue(toInteger(nativeValue), targetType)
# The nativeValue is needed in case of multiple inheritance, see
# QTCREATORBUG-17823. Using it triggers nativeValueDereferencePointer()
# later which
# is surprisingly expensive.
val.nativeValue = nativeValue val.nativeValue = nativeValue
#warn('CREATED PTR 1: %s' % val) #warn('CREATED PTR 1: %s' % val)
if not nativeValue.address is None: if not nativeValue.address is None:
@@ -447,7 +451,6 @@ class Dumper(DumperBase):
return typeId return typeId
def nativeStructAlignment(self, nativeType): def nativeStructAlignment(self, nativeType):
self.preping('align ' + str(nativeType))
#warn('NATIVE ALIGN FOR %s' % nativeType.name) #warn('NATIVE ALIGN FOR %s' % nativeType.name)
def handleItem(nativeFieldType, align): def handleItem(nativeFieldType, align):
a = self.fromNativeType(nativeFieldType).alignment() a = self.fromNativeType(nativeFieldType).alignment()
@@ -455,7 +458,6 @@ class Dumper(DumperBase):
align = 1 align = 1
for f in nativeType.fields(): for f in nativeType.fields():
align = handleItem(f.type, align) align = handleItem(f.type, align)
self.ping('align ' + str(nativeType))
return align return align
@@ -668,9 +670,7 @@ class Dumper(DumperBase):
self.resetStats() self.resetStats()
self.prepare(args) self.prepare(args)
self.preping('endian')
self.isBigEndian = gdb.execute('show endian', to_string = True).find('big endian') > 0 self.isBigEndian = gdb.execute('show endian', to_string = True).find('big endian') > 0
self.ping('endian')
self.packCode = '>' if self.isBigEndian else '<' self.packCode = '>' if self.isBigEndian else '<'
(ok, res) = self.tryFetchInterpreterVariables(args) (ok, res) = self.tryFetchInterpreterVariables(args)
@@ -827,9 +827,7 @@ class Dumper(DumperBase):
#warn('READ: %s FROM 0x%x' % (size, address)) #warn('READ: %s FROM 0x%x' % (size, address))
if address == 0 or size == 0: if address == 0 or size == 0:
return bytes() return bytes()
self.preping('readMem')
res = self.selectedInferior().read_memory(address, size) res = self.selectedInferior().read_memory(address, size)
self.ping('readMem')
return res return res
def findStaticMetaObject(self, type): def findStaticMetaObject(self, type):
@@ -1137,6 +1135,7 @@ class Dumper(DumperBase):
self.reportResult('selected="0x%x",expr="(%s*)0x%x"' % (p, n, p), args) self.reportResult('selected="0x%x",expr="(%s*)0x%x"' % (p, n, p), args)
def nativeValueDereferencePointer(self, value): def nativeValueDereferencePointer(self, value):
# This is actually pretty expensive, up to 100ms.
deref = value.nativeValue.dereference() deref = value.nativeValue.dereference()
return self.fromNativeValue(deref.cast(deref.dynamic_type)) return self.fromNativeValue(deref.cast(deref.dynamic_type))

View File

@@ -31,6 +31,7 @@ HEADERS += $$PWD/drop3dlibraryitemcommand.h
HEADERS += $$PWD/update3dviewstatecommand.h HEADERS += $$PWD/update3dviewstatecommand.h
HEADERS += $$PWD/enable3dviewcommand.h HEADERS += $$PWD/enable3dviewcommand.h
HEADERS += $$PWD/view3dclosedcommand.h HEADERS += $$PWD/view3dclosedcommand.h
HEADERS += $$PWD/puppettocreatorcommand.h
SOURCES += $$PWD/synchronizecommand.cpp SOURCES += $$PWD/synchronizecommand.cpp
SOURCES += $$PWD/debugoutputcommand.cpp SOURCES += $$PWD/debugoutputcommand.cpp
@@ -63,3 +64,4 @@ SOURCES += $$PWD/drop3dlibraryitemcommand.cpp
SOURCES += $$PWD/update3dviewstatecommand.cpp SOURCES += $$PWD/update3dviewstatecommand.cpp
SOURCES += $$PWD/enable3dviewcommand.cpp SOURCES += $$PWD/enable3dviewcommand.cpp
SOURCES += $$PWD/view3dclosedcommand.cpp SOURCES += $$PWD/view3dclosedcommand.cpp
SOURCES += $$PWD/puppettocreatorcommand.cpp

View File

@@ -0,0 +1,55 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "puppettocreatorcommand.h"
namespace QmlDesigner {
// A generic command that can hold a variant data from puppet to creator
PuppetToCreatorCommand::PuppetToCreatorCommand(Type type, const QVariant &data)
: m_type(type)
, m_data(data)
{
}
QDataStream &operator<<(QDataStream &out, const PuppetToCreatorCommand &command)
{
out << qint32(command.type());
out << command.data();
return out;
}
QDataStream &operator>>(QDataStream &in, PuppetToCreatorCommand &command)
{
qint32 type;
in >> type;
command.m_type = PuppetToCreatorCommand::Type(type);
in >> command.m_data;
return in;
}
} // namespace QmlDesigner

View File

@@ -0,0 +1,57 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <qmetatype.h>
#include <QDataStream>
#include <QVariant>
namespace QmlDesigner {
class PuppetToCreatorCommand
{
public:
enum Type { Key_Pressed, None };
PuppetToCreatorCommand(Type type, const QVariant &data);
PuppetToCreatorCommand() = default;
Type type() const { return m_type; }
QVariant data() const { return m_data; }
private:
Type m_type = None;
QVariant m_data;
friend QDataStream &operator>>(QDataStream &in, PuppetToCreatorCommand &command);
};
QDataStream &operator<<(QDataStream &out, const PuppetToCreatorCommand &command);
QDataStream &operator>>(QDataStream &in, PuppetToCreatorCommand &command);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::PuppetToCreatorCommand)

View File

@@ -72,6 +72,7 @@
#include "changeselectioncommand.h" #include "changeselectioncommand.h"
#include "drop3dlibraryitemcommand.h" #include "drop3dlibraryitemcommand.h"
#include "view3dclosedcommand.h" #include "view3dclosedcommand.h"
#include "puppettocreatorcommand.h"
namespace QmlDesigner { namespace QmlDesigner {
@@ -262,6 +263,11 @@ void NodeInstanceClientProxy::library3DItemDropped(const Drop3DLibraryItemComman
writeCommand(QVariant::fromValue(command)); writeCommand(QVariant::fromValue(command));
} }
void NodeInstanceClientProxy::handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command)
{
writeCommand(QVariant::fromValue(command));
}
void NodeInstanceClientProxy::view3DClosed(const View3DClosedCommand &command) void NodeInstanceClientProxy::view3DClosed(const View3DClosedCommand &command)
{ {
writeCommand(QVariant::fromValue(command)); writeCommand(QVariant::fromValue(command));

View File

@@ -60,6 +60,7 @@ class ChangeNodeSourceCommand;
class EndPuppetCommand; class EndPuppetCommand;
class ChangeSelectionCommand; class ChangeSelectionCommand;
class Drop3DLibraryItemCommand; class Drop3DLibraryItemCommand;
class PuppetToCreatorCommand;
class View3DClosedCommand; class View3DClosedCommand;
class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterface class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterface
@@ -81,6 +82,7 @@ public:
void puppetAlive(const PuppetAliveCommand &command); void puppetAlive(const PuppetAliveCommand &command);
void selectionChanged(const ChangeSelectionCommand &command) override; void selectionChanged(const ChangeSelectionCommand &command) override;
void library3DItemDropped(const Drop3DLibraryItemCommand &command) override; void library3DItemDropped(const Drop3DLibraryItemCommand &command) override;
void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) override;
void view3DClosed(const View3DClosedCommand &command) override; void view3DClosed(const View3DClosedCommand &command) override;
void flush() override; void flush() override;

View File

@@ -43,6 +43,7 @@ class PuppetAliveCommand;
class ChangeSelectionCommand; class ChangeSelectionCommand;
class Drop3DLibraryItemCommand; class Drop3DLibraryItemCommand;
class View3DClosedCommand; class View3DClosedCommand;
class PuppetToCreatorCommand;
class NodeInstanceClientInterface class NodeInstanceClientInterface
{ {
@@ -59,6 +60,7 @@ public:
virtual void selectionChanged(const ChangeSelectionCommand &command) = 0; virtual void selectionChanged(const ChangeSelectionCommand &command) = 0;
virtual void library3DItemDropped(const Drop3DLibraryItemCommand &command) = 0; virtual void library3DItemDropped(const Drop3DLibraryItemCommand &command) = 0;
virtual void view3DClosed(const View3DClosedCommand &command) = 0; virtual void view3DClosed(const View3DClosedCommand &command) = 0;
virtual void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) = 0;
virtual void flush() {} virtual void flush() {}
virtual void synchronizeWithClientProcess() {} virtual void synchronizeWithClientProcess() {}

View File

@@ -64,6 +64,7 @@
#include "debugoutputcommand.h" #include "debugoutputcommand.h"
#include "puppetalivecommand.h" #include "puppetalivecommand.h"
#include "view3dclosedcommand.h" #include "view3dclosedcommand.h"
#include "puppettocreatorcommand.h"
#include <enumeration.h> #include <enumeration.h>
@@ -209,6 +210,12 @@ void NodeInstanceServerInterface::registerCommands()
qRegisterMetaType<View3DClosedCommand>("View3DClosedCommand"); qRegisterMetaType<View3DClosedCommand>("View3DClosedCommand");
qRegisterMetaTypeStreamOperators<View3DClosedCommand>("View3DClosedCommand"); qRegisterMetaTypeStreamOperators<View3DClosedCommand>("View3DClosedCommand");
qRegisterMetaType<PuppetToCreatorCommand>("PuppetToCreatorCommand");
qRegisterMetaTypeStreamOperators<PuppetToCreatorCommand>("PuppetToCreatorCommand");
qRegisterMetaType<QPair<int, int>>("QPairIntInt");
qRegisterMetaTypeStreamOperators<QPair<int, int>>("QPairIntInt");
} }
} }

View File

@@ -61,6 +61,7 @@
#include "removesharedmemorycommand.h" #include "removesharedmemorycommand.h"
#include "objectnodeinstance.h" #include "objectnodeinstance.h"
#include "drop3dlibraryitemcommand.h" #include "drop3dlibraryitemcommand.h"
#include "puppettocreatorcommand.h"
#include "view3dclosedcommand.h" #include "view3dclosedcommand.h"
#include "dummycontextobject.h" #include "dummycontextobject.h"
@@ -102,6 +103,13 @@ bool Qt5InformationNodeInstanceServer::eventFilter(QObject *, QEvent *event)
nodeInstanceClient()->view3DClosed(View3DClosedCommand()); nodeInstanceClient()->view3DClosed(View3DClosedCommand());
} break; } break;
case QEvent::KeyPress: {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
QPair<int, int> data = {keyEvent->key(), keyEvent->modifiers()};
nodeInstanceClient()->handlePuppetToCreatorCommand({PuppetToCreatorCommand::Key_Pressed,
QVariant::fromValue(data)});
} break;
default: default:
break; break;
} }

View File

@@ -36,20 +36,28 @@ QtObject {
property bool isInModel: backendValue.isInModel; property bool isInModel: backendValue.isInModel;
property bool isInSubState: backendValue.isInSubState; property bool isInSubState: backendValue.isInSubState;
property bool highlight: textColor === __changedTextColor property bool highlight: textColor === __changedTextColor
property bool errorState: false
property color __defaultTextColor: StudioTheme.Values.themeTextColor readonly property color __defaultTextColor: StudioTheme.Values.themeTextColor
readonly property color __changedTextColor: StudioTheme.Values.themeInteraction readonly property color __changedTextColor: StudioTheme.Values.themeInteraction
readonly property color __errorTextColor: StudioTheme.Values.themeErrorColor
onBackendValueChanged: evaluate() onBackendValueChanged: evaluate()
onValueFromBackendChanged: evaluate() onValueFromBackendChanged: evaluate()
onBaseStateFlagChanged: evaluate() onBaseStateFlagChanged: evaluate()
onIsInModelChanged: evaluate() onIsInModelChanged: evaluate()
onIsInSubStateChanged: evaluate() onIsInSubStateChanged: evaluate()
onErrorStateChanged: evaluate()
function evaluate() { function evaluate() {
if (innerObject.backendValue === undefined) if (innerObject.backendValue === undefined)
return return
if (innerObject.errorState) {
innerObject.textColor = __errorTextColor
return
}
if (innerObject.baseStateFlag) { if (innerObject.baseStateFlag) {
if (innerObject.backendValue.isInModel) if (innerObject.backendValue.isInModel)
innerObject.textColor = __changedTextColor innerObject.textColor = __changedTextColor

View File

@@ -33,7 +33,7 @@ StudioControls.ComboBox {
property variant backendValue property variant backendValue
labelColor: edit ? StudioTheme.Values.themeTextColor : colorLogic.textColor labelColor: edit && !colorLogic.errorState ? StudioTheme.Values.themeTextColor : colorLogic.textColor
property string scope: "Qt" property string scope: "Qt"
property bool useInteger: false property bool useInteger: false
@@ -48,6 +48,8 @@ StudioControls.ComboBox {
property bool showExtendedFunctionButton: true property bool showExtendedFunctionButton: true
property alias colorLogic: colorLogic
ExtendedFunctionLogic { ExtendedFunctionLogic {
id: extFuncLogic id: extFuncLogic
backendValue: comboBox.backendValue backendValue: comboBox.backendValue

View File

@@ -25,42 +25,43 @@
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import HelperWidgets 2.0 import HelperWidgets 2.0
import QtQuickDesignerTheme 1.0 import QtQuickDesignerTheme 1.0
import StudioControls 1.0 as StudioControls
import StudioTheme 1.0 as StudioTheme
Dialog { Dialog {
id: dialogWindow id: dialogWindow
width: 1200 width: 1200
height: 650 height: 650
title: "Gradient Picker" title: qsTr("Gradient Picker")
signal saved; signal saved
property alias gradientData: gradientPickerData; property alias gradientData: gradientPickerData
QtObject { QtObject {
id: gradientPickerData id: gradientPickerData
property var stops; property var stops
property var colors; property var colors
property int stopsCount; property int stopsCount
property int presetID; property int presetID
property int presetType; //default(0) or custom(1) property int presetType // default(0) or custom(1)
property Item selectedItem; property Item selectedItem
} }
function addGradient(stopsPositions, stopsColors, stopsCount) { function addGradient(stopsPositions, stopsColors, stopsCount) {
customPresetListModel.addGradient(stopsPositions, stopsColors, stopsCount); customPresetListModel.addGradient(stopsPositions, stopsColors, stopsCount)
} }
function updatePresets() { function updatePresets() {
customPresetListModel.readPresets(); customPresetListModel.readPresets()
} }
GradientPresetDefaultListModel { id: defaultPresetListModel; } GradientPresetDefaultListModel { id: defaultPresetListModel }
GradientPresetCustomListModel { id: customPresetListModel; } GradientPresetCustomListModel { id: customPresetListModel }
standardButtons: Dialog.NoButton standardButtons: Dialog.NoButton
@@ -68,27 +69,30 @@ Dialog {
anchors.fill: parent anchors.fill: parent
anchors.margins: -12 anchors.margins: -12
anchors.bottomMargin: -70 anchors.bottomMargin: -70
color: "#363636" color: StudioTheme.Values.themeColumnBackground
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
anchors.margins: 13 anchors.margins: 13
anchors.bottomMargin: 71 anchors.bottomMargin: 71
TabView { TabView {
id: presetTabView id: presetTabView
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Tab { Tab {
title: qsTr("System Presets") title: qsTr("System Presets")
anchors.fill:parent anchors.fill: parent
GradientPresetTabContent { GradientPresetTabContent {
id: defaultTabContent id: defaultTabContent
viewModel: defaultPresetListModel viewModel: defaultPresetListModel
editableName: false editableName: false
} }
}
} //tab default
Tab { Tab {
title: qsTr("User Presets") title: qsTr("User Presets")
anchors.fill: parent anchors.fill: parent
@@ -97,11 +101,12 @@ Dialog {
id: customTabContent id: customTabContent
viewModel: customPresetListModel viewModel: customPresetListModel
editableName: true editableName: true
onPresetNameChanged: customPresetListModel.changePresetName(id, name); onPresetNameChanged: customPresetListModel.changePresetName(id, name)
property int deleteId;
property int deleteId
onDeleteButtonClicked: { onDeleteButtonClicked: {
deleteId = id; deleteId = id
deleteDialog.open() deleteDialog.open()
} }
@@ -112,11 +117,12 @@ Dialog {
standardButtons: Dialog.No | Dialog.Yes standardButtons: Dialog.No | Dialog.Yes
title: qsTr("Delete preset?") title: qsTr("Delete preset?")
text: qsTr("Are you sure you want to delete this preset?") text: qsTr("Are you sure you want to delete this preset?")
onAccepted: customPresetListModel.deletePreset(customTabContent.deleteId); onAccepted: customPresetListModel.deletePreset(customTabContent.deleteId)
} }
} }
} //tab custom }
} //tabview }
RowLayout { RowLayout {
Layout.alignment: Qt.AlignBottom | Qt.AlignRight Layout.alignment: Qt.AlignBottom | Qt.AlignRight
Layout.topMargin: 5 Layout.topMargin: 5
@@ -124,7 +130,7 @@ Dialog {
Button { id: buttonClose; text: qsTr("Close"); onClicked: { dialogWindow.reject(); } } Button { id: buttonClose; text: qsTr("Close"); onClicked: { dialogWindow.reject(); } }
Button { id: buttonSave; text: qsTr("Save"); onClicked: { dialogWindow.saved(); } } Button { id: buttonSave; text: qsTr("Save"); onClicked: { dialogWindow.saved(); } }
Button { id: buttonApply; text: qsTr("Apply"); onClicked: { dialogWindow.apply(); } } Button { id: buttonApply; text: qsTr("Apply"); onClicked: { dialogWindow.apply(); } }
} //RowLayout }
} //ColumnLayout }
} //rectangle }
} //dialog }

View File

@@ -25,31 +25,28 @@
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import QtQuick.Controls 2.5
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import HelperWidgets 2.0 import HelperWidgets 2.0
import QtQuickDesignerTheme 1.0 import QtQuickDesignerTheme 1.0
import QtQuick.Controls.Private 1.0 as PrivateControls import StudioControls 1.0 as StudioControls
import StudioTheme 1.0 as StudioTheme
Rectangle { Rectangle {
id: tabBackground id: tabBackground
width: parent.width width: parent.width
height: parent.height height: parent.height
color: "#242424" color: StudioTheme.Values.themeControlBackground
anchors.fill: parent anchors.fill: parent
property alias viewModel : gradientTable.model; property alias viewModel: gradientTable.model
property bool editableName : false; property bool editableName: false
signal presetNameChanged(int id, string name) signal presetNameChanged(int id, string name)
signal deleteButtonClicked(int id) signal deleteButtonClicked(int id)
property real delegateWidth: 154; property real delegateWidth: 154
property real delegateHeight: 178; property real delegateHeight: 178
property real gridCellWidth: 160; property real gridCellWidth: 160
ScrollView { ScrollView {
Layout.fillWidth: true Layout.fillWidth: true
@@ -74,7 +71,7 @@ Rectangle {
Rectangle { Rectangle {
id: backgroundCard id: backgroundCard
color: "#404040" color: StudioTheme.Values.themeControlOutline
clip: true clip: true
property real flexibleWidth: (gradientTable.width - gradientTable.cellWidth * gradientTable.gridColumns) / gradientTable.gridColumns property real flexibleWidth: (gradientTable.width - gradientTable.cellWidth * gradientTable.gridColumns) / gradientTable.gridColumns
@@ -84,82 +81,78 @@ Rectangle {
height: tabBackground.delegateHeight height: tabBackground.delegateHeight
radius: 16 radius: 16
function selectPreset(index) {
gradientTable.currentIndex = index
gradientData.stops = stopsPosList
gradientData.colors = stopsColorList
gradientData.stopsCount = stopListSize
gradientData.presetID = presetID
gradientData.presetType = presetTabView.currentIndex
if (gradientData.selectedItem != null)
gradientData.selectedItem.isSelected = false
backgroundCard.isSelected = true
gradientData.selectedItem = backgroundCard
}
MouseArea { MouseArea {
id: rectMouseArea id: rectMouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onClicked: { onClicked: {
gradientTable.currentIndex = index; presetNameBox.edit = false
gradientData.stops = stopsPosList; nameInput.focus = false
gradientData.colors = stopsColorList; backgroundCard.selectPreset(index)
gradientData.stopsCount = stopListSize;
gradientData.presetID = presetID;
gradientData.presetType = presetTabView.currentIndex
if (gradientData.selectedItem != null)
gradientData.selectedItem.isSelected = false
backgroundCard.isSelected = true
gradientData.selectedItem = backgroundCard
} }
onEntered: {
if (backgroundCard.state != "CLICKED") {
backgroundCard.state = "HOVER";
}
}
onExited: {
if (backgroundCard.state != "CLICKED") {
backgroundCard.state = "USUAL";
}
}
} //mouseArea
onIsSelectedChanged: {
if (isSelected)
backgroundCard.state = "CLICKED"
else
backgroundCard.state = "USUAL"
} }
states: [ states: [
State { State {
name: "HOVER" name: "default"
when: !(rectMouseArea.containsMouse || removeButton.hovered ||
(nameMouseArea.containsMouse && !tabBackground.editableName)) &&
!backgroundCard.isSelected
PropertyChanges { PropertyChanges {
target: backgroundCard target: backgroundCard
color: "#606060" color: StudioTheme.Values.themeControlOutline
border.width: 1
border.color: "#029de0"
}
},
State {
name: "CLICKED"
PropertyChanges {
target: backgroundCard
color:"#029de0"
border.width: 1
border.color: "#606060"
}
},
State {
name: "USUAL"
PropertyChanges
{
target: backgroundCard
color: "#404040"
border.width: 0 border.width: 0
} }
},
State {
name: "hovered"
when: (rectMouseArea.containsMouse || removeButton.hovered ||
(nameMouseArea.containsMouse && !tabBackground.editableName)) &&
!backgroundCard.isSelected
PropertyChanges {
target: backgroundCard
color: StudioTheme.Values.themeControlBackgroundPressed
border.width: 1
border.color: StudioTheme.Values.themeInteraction
}
},
State {
name: "selected"
when: backgroundCard.isSelected
PropertyChanges {
target: backgroundCard
color:StudioTheme.Values.themeInteraction
border.width: 1
border.color: StudioTheme.Values.themeControlBackgroundPressed
}
} }
] //states ]
ColumnLayout { ColumnLayout {
spacing: 2 spacing: 2
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {
width: 150; height: 150
id: gradientRect id: gradientRect
width: 150
height: 150
radius: 16 radius: 16
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter //was top Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.topMargin: 2 Layout.topMargin: 2
gradient: Gradient { gradient: Gradient {
@@ -174,36 +167,26 @@ Rectangle {
Component.onCompleted: { Component.onCompleted: {
var stopsAmount = stopListSize; var stopsAmount = stopListSize;
var newStops = []; var newStops = [];
for (var i = 0; i < stopsAmount; i++ ) { for (var i = 0; i < stopsAmount; i++) {
newStops.push( stopComponent.createObject(showGr, { "position": stopsPosList[i], "color": stopsColorList[i] }) ); newStops.push( stopComponent.createObject(showGr, { "position": stopsPosList[i], "color": stopsColorList[i] }) );
} }
showGr.stops = newStops; showGr.stops = newStops;
} }
Rectangle { AbstractButton {
id: removeItemRect id: removeButton
visible: editableName && (rectMouseArea.containsMouse || removeButton.hovered)
backgroundRadius: StudioTheme.Values.smallRectWidth
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 5 anchors.rightMargin: 5
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 5 anchors.topMargin: 5
height: 16 width: Math.round(StudioTheme.Values.smallRectWidth)
width: 16 height: Math.round(StudioTheme.Values.smallRectWidth)
visible: editableName && rectMouseArea.containsMouse buttonIcon: StudioTheme.Constants.closeCross
color: "#804682b4" onClicked: tabBackground.deleteButtonClicked(index)
}
MouseArea { }
anchors.fill: parent;
onClicked: tabBackground.deleteButtonClicked(index);
}
Image {
source: "image://icons/close"
fillMode: Image.PreserveAspectFit
anchors.fill: parent;
Layout.alignment: Qt.AlignCenter
} //image remove
} //rectangle remove
} //rectangle gradient
Item { Item {
id: presetNameBox id: presetNameBox
@@ -212,19 +195,7 @@ Rectangle {
Layout.preferredHeight: backgroundCard.height - gradientRect.height - 4 Layout.preferredHeight: backgroundCard.height - gradientRect.height - 4
Layout.bottomMargin: 4 Layout.bottomMargin: 4
property bool readOnly : true; property bool edit: false
onReadOnlyChanged: {
if (!readOnly) {
nameInput.visible = true;
nameInput.forceActiveFocus();
//have to select text like this, otherwise there is an issue with long names
nameInput.cursorPosition = 0;
nameInput.cursorPosition = nameInput.length;
nameInput.selectAll();
}
} //onReadOnlyChanged
Rectangle { Rectangle {
id: nameBackgroundColor id: nameBackgroundColor
@@ -233,131 +204,118 @@ Rectangle {
radius: 16 radius: 16
visible: true visible: true
anchors.fill: parent anchors.fill: parent
} //rectangle }
MouseArea { ToolTipArea {
id: nameMouseArea id: nameMouseArea
visible: tabBackground.editableName
hoverEnabled: true
anchors.fill: parent anchors.fill: parent
tooltip: nameText.text
propagateComposedEvents: true
onClicked: presetNameBox.state = "Clicked"; onClicked: {
if (!tabBackground.editableName) {
onEntered: { backgroundCard.selectPreset(index)
if (presetNameBox.state != "Clicked") return
{
presetNameBox.state = "Hover";
} }
presetNameBox.edit = true
nameInput.forceActiveFocus()
// have to select text like this, otherwise there is an issue with long names
nameInput.cursorPosition = 0
nameInput.cursorPosition = nameInput.length
nameInput.selectAll()
} }
}
onExited: {
if (presetNameBox.state != "Clicked")
{
presetNameBox.state = "Normal";
}
PrivateControls.Tooltip.hideText()
}
Timer {
interval: 1000
running: nameMouseArea.containsMouse && presetNameBox.readOnly
onTriggered: PrivateControls.Tooltip.showText(nameMouseArea, Qt.point(nameMouseArea.mouseX, nameMouseArea.mouseY), presetName)
}
onCanceled: Tooltip.hideText()
} //mouseArea
Text { Text {
id: nameText id: nameText
visible: presetNameBox.readOnly
text: presetName text: presetName
anchors.fill: parent anchors.fill: parent
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
color: "#ffffff" color: StudioTheme.Values.themeTextColor
elide: Text.ElideMiddle elide: Text.ElideMiddle
maximumLineCount: 1 maximumLineCount: 1
} //text }
TextInput { TextInput {
id: nameInput id: nameInput
visible: !presetNameBox.readOnly enabled: tabBackground.editableName
visible: false
text: presetName text: presetName
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 5 anchors.leftMargin: 5
anchors.rightMargin: 5 anchors.rightMargin: 5
horizontalAlignment: TextInput.AlignHCenter horizontalAlignment: TextInput.AlignHCenter
verticalAlignment: TextInput.AlignVCenter verticalAlignment: TextInput.AlignVCenter
color: "#ffffff" color: StudioTheme.Values.themeTextColor
selectionColor: "#029de0" selectionColor: StudioTheme.Values.themeInteraction
selectByMouse: true
activeFocusOnPress: true activeFocusOnPress: true
wrapMode: TextInput.NoWrap wrapMode: TextInput.NoWrap
clip: true clip: true
onEditingFinished: { onEditingFinished: {
nameText.text = text nameText.text = text
tabBackground.presetNameChanged(index, text); tabBackground.presetNameChanged(index, text)
presetNameBox.state = "Normal"; presetNameBox.edit = false
} }
Keys.onPressed: { Keys.onPressed: {
if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) { if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) {
event.accepted = true; event.accepted = true
editingFinished(); nameInput.editingFinished()
focus = false; nameInput.focus = false
} //if }
} //Keys.onPressed
} //textInput if (event.key === Qt.Key_Escape) {
event.accepted = true
nameInput.text = nameText.text
nameInput.focus = false
}
}
}
states: [ states: [
State { State {
name: "Normal" name: "default"
when: tabBackground.editableName && !nameMouseArea.containsMouse && !presetNameBox.edit
PropertyChanges { PropertyChanges {
target: nameBackgroundColor target: nameBackgroundColor
color: "transparent" color: "transparent"
border.width: 0 border.width: 0
} }
PropertyChanges { PropertyChanges { target: nameText; visible: true }
target: presetNameBox PropertyChanges { target: nameInput; visible: false }
readOnly: true
}
}, },
State { State {
name: "Hover" name: "hovered"
when: tabBackground.editableName && nameMouseArea.containsMouse && !presetNameBox.edit
PropertyChanges { PropertyChanges {
target: nameBackgroundColor target: nameBackgroundColor
color: "#606060" color: StudioTheme.Values.themeControlBackgroundPressed
border.width: 0 border.width: 0
} }
PropertyChanges { PropertyChanges { target: nameText; visible: true }
target: presetNameBox PropertyChanges { target: nameInput; visible: false }
readOnly: true
}
}, },
State { State {
name: "Clicked" name: "edit"
when: tabBackground.editableName && presetNameBox.edit
PropertyChanges { PropertyChanges {
target: nameBackgroundColor target: nameBackgroundColor
color: "#606060" color: StudioTheme.Values.themeControlBackgroundPressed
border.color: "#029de0" border.color: StudioTheme.Values.themeInteraction
border.width: 1 border.width: 1
} }
PropertyChanges { PropertyChanges { target: nameText; visible: false }
target: presetNameBox PropertyChanges { target: nameInput; visible: true }
readOnly: false
}
PropertyChanges {
target: nameInput
visible: true
}
} }
] //states ]
} //gradient name Item }
} //columnLayout }
} //rectangle background }
} //component delegate }
} //gridview }
} //scrollView }
} //rectangle }

View File

@@ -24,16 +24,18 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.1 as Controls import HelperWidgets 2.0
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import QtQuick.Controls.Private 1.0
MouseArea { MouseArea {
id: mouseArea id: mouseArea
onExited: Tooltip.hideText() Tooltip {
onCanceled: Tooltip.hideText() id: myTooltip
}
onExited: myTooltip.hideText()
onCanceled: myTooltip.hideText()
onClicked: forceActiveFocus() onClicked: forceActiveFocus()
hoverEnabled: true hoverEnabled: true
@@ -43,6 +45,6 @@ MouseArea {
Timer { Timer {
interval: 1000 interval: 1000
running: mouseArea.containsMouse && tooltip.length running: mouseArea.containsMouse && tooltip.length
onTriggered: Tooltip.showText(mouseArea, Qt.point(mouseArea.mouseX, mouseArea.mouseY), tooltip) onTriggered: myTooltip.showText(mouseArea, Qt.point(mouseArea.mouseX, mouseArea.mouseY), tooltip)
} }
} }

View File

@@ -108,6 +108,8 @@ QtObject {
property string themeSliderInactiveTrackFocus: "#606060" property string themeSliderInactiveTrackFocus: "#606060"
property string themeSliderHandleFocus: values.themeInteraction property string themeSliderHandleFocus: values.themeInteraction
property string themeErrorColor: "#df3a3a"
// NEW NEW NEW NEW NEW // NEW NEW NEW NEW NEW
property string themeControlBackgroundDisabled: "#363636" property string themeControlBackgroundDisabled: "#363636"
property string themeControlOutlineDisabled: "#404040" property string themeControlOutlineDisabled: "#404040"

View File

@@ -161,8 +161,6 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent)
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged); this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
m_ui->categoryTab->setCurrentIndex(0); m_ui->categoryTab->setCurrentIndex(0);
m_ui->tabSettingsWidget->setFlat(true);
} }
CppCodeStylePreferencesWidget::~CppCodeStylePreferencesWidget() CppCodeStylePreferencesWidget::~CppCodeStylePreferencesWidget()

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>463</width> <width>463</width>
<height>314</height> <height>317</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -69,19 +69,7 @@
<property name="title"> <property name="title">
<string>Indent</string> <string>Indent</string>
</property> </property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QCheckBox" name="indentAccessSpecifiers"> <widget class="QCheckBox" name="indentAccessSpecifiers">
<property name="text"> <property name="text">
@@ -155,19 +143,7 @@
<property name="title"> <property name="title">
<string>Indent Braces</string> <string>Indent Braces</string>
</property> </property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QCheckBox" name="indentClassBraces"> <widget class="QCheckBox" name="indentClassBraces">
<property name="text"> <property name="text">
@@ -238,19 +214,7 @@
<property name="title"> <property name="title">
<string>Indent within &quot;switch&quot;</string> <string>Indent within &quot;switch&quot;</string>
</property> </property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QCheckBox" name="indentSwitchLabels"> <widget class="QCheckBox" name="indentSwitchLabels">
<property name="text"> <property name="text">
@@ -317,19 +281,7 @@
<property name="title"> <property name="title">
<string>Align</string> <string>Align</string>
</property> </property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QCheckBox" name="alignAssignments"> <widget class="QCheckBox" name="alignAssignments">
<property name="toolTip"> <property name="toolTip">
@@ -414,9 +366,6 @@ if they would align to the next line</string>
<property name="title"> <property name="title">
<string>Bind '*' and '&amp;&amp;' in types/declarations to</string> <string>Bind '*' and '&amp;&amp;' in types/declarations to</string>
</property> </property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_6">
<item> <item>
<widget class="QCheckBox" name="bindStarToIdentifier"> <widget class="QCheckBox" name="bindStarToIdentifier">

View File

@@ -1617,6 +1617,8 @@ void FakeVimPluginPrivate::editorOpened(IEditor *editor)
tabSettings.m_tabSize = theFakeVimSetting(ConfigTabStop)->value().toInt(); tabSettings.m_tabSize = theFakeVimSetting(ConfigTabStop)->value().toInt();
tabSettings.m_tabPolicy = theFakeVimSetting(ConfigExpandTab)->value().toBool() tabSettings.m_tabPolicy = theFakeVimSetting(ConfigExpandTab)->value().toBool()
? TabSettings::SpacesOnlyTabPolicy : TabSettings::TabsOnlyTabPolicy; ? TabSettings::SpacesOnlyTabPolicy : TabSettings::TabsOnlyTabPolicy;
tabSettings.m_continuationAlignBehavior =
tew->textDocument()->tabSettings().m_continuationAlignBehavior;
QTextDocument *doc = tew->document(); QTextDocument *doc = tew->document();
QTextBlock startBlock = doc->findBlockByNumber(beginBlock); QTextBlock startBlock = doc->findBlockByNumber(beginBlock);

View File

@@ -143,6 +143,7 @@ extend_qtc_plugin(QmlDesigner
update3dviewstatecommand.cpp update3dviewstatecommand.h update3dviewstatecommand.cpp update3dviewstatecommand.h
enable3dviewcommand.cpp enable3dviewcommand.h enable3dviewcommand.cpp enable3dviewcommand.h
view3dclosedcommand.cpp view3dclosedcommand.h view3dclosedcommand.cpp view3dclosedcommand.h
puppettocreatorcommand.cpp puppettocreatorcommand.h
) )
extend_qtc_plugin(QmlDesigner extend_qtc_plugin(QmlDesigner
@@ -320,6 +321,7 @@ extend_qtc_plugin(QmlDesigner
simplecolorpalette.cpp simplecolorpalette.h simplecolorpalette.cpp simplecolorpalette.h
simplecolorpalettemodel.cpp simplecolorpalettemodel.h simplecolorpalettemodel.cpp simplecolorpalettemodel.h
simplecolorpalettesingleton.cpp simplecolorpalettesingleton.h simplecolorpalettesingleton.cpp simplecolorpalettesingleton.h
tooltip.cpp tooltip.h
qmlanchorbindingproxy.cpp qmlanchorbindingproxy.h qmlanchorbindingproxy.cpp qmlanchorbindingproxy.h
qmlmodelnodeproxy.cpp qmlmodelnodeproxy.h qmlmodelnodeproxy.cpp qmlmodelnodeproxy.h
quick2propertyeditorview.cpp quick2propertyeditorview.h quick2propertyeditorview.cpp quick2propertyeditorview.h

View File

@@ -20,7 +20,8 @@ SOURCES += propertyeditorview.cpp \
simplecolorpalettemodel.cpp \ simplecolorpalettemodel.cpp \
simplecolorpalettesingleton.cpp \ simplecolorpalettesingleton.cpp \
itemfiltermodel.cpp \ itemfiltermodel.cpp \
aligndistribute.cpp aligndistribute.cpp \
tooltip.cpp
HEADERS += propertyeditorview.h \ HEADERS += propertyeditorview.h \
qmlanchorbindingproxy.h \ qmlanchorbindingproxy.h \
@@ -42,6 +43,7 @@ HEADERS += propertyeditorview.h \
simplecolorpalettemodel.h \ simplecolorpalettemodel.h \
simplecolorpalettesingleton.h \ simplecolorpalettesingleton.h \
itemfiltermodel.h \ itemfiltermodel.h \
aligndistribute.h aligndistribute.h \
tooltip.h
QT += qml quick QT += qml quick gui-private

View File

@@ -37,6 +37,7 @@
#include "qmlanchorbindingproxy.h" #include "qmlanchorbindingproxy.h"
#include "theme.h" #include "theme.h"
#include "aligndistribute.h" #include "aligndistribute.h"
#include "tooltip.h"
namespace QmlDesigner { namespace QmlDesigner {
@@ -63,6 +64,7 @@ void Quick2PropertyEditorView::registerQmlTypes()
BindingEditor::registerDeclarativeType(); BindingEditor::registerDeclarativeType();
ActionEditor::registerDeclarativeType(); ActionEditor::registerDeclarativeType();
AlignDistribute::registerDeclarativeType(); AlignDistribute::registerDeclarativeType();
Tooltip::registerDeclarativeType();
} }
} }

View File

@@ -0,0 +1,74 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Controls module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "tooltip.h"
#include <qquickwindow.h>
#include <qquickitem.h>
#include <QtQuick/QQuickRenderControl>
#include <QtWidgets/qtwidgetsglobal.h>
#include <qtooltip.h>
Tooltip::Tooltip(QObject *parent)
: QObject(parent)
{}
void Tooltip::showText(QQuickItem *item, const QPointF &pos, const QString &str)
{
if (!item || !item->window())
return;
if (QCoreApplication::instance()->inherits("QApplication")) {
QPoint quickWidgetOffsetInTlw;
QWindow *renderWindow = QQuickRenderControl::renderWindowFor(item->window(), &quickWidgetOffsetInTlw);
QWindow *window = renderWindow ? renderWindow : item->window();
const QPoint offsetInQuickWidget = item->mapToScene(pos).toPoint();
const QPoint mappedPos = window->mapToGlobal(offsetInQuickWidget + quickWidgetOffsetInTlw);
QToolTip::showText(mappedPos, str);
}
}
void Tooltip::hideText()
{
QToolTip::hideText();
}
void Tooltip::registerDeclarativeType()
{
qmlRegisterType<Tooltip>("HelperWidgets", 2, 0, "Tooltip");
}

View File

@@ -0,0 +1,67 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Controls module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef TOOLTIP_H
#define TOOLTIP_H
#include <QtQml>
#include <QtCore/qobject.h>
QT_BEGIN_NAMESPACE
class QPointF;
class QQuickItem;
QT_END_NAMESPACE
class Tooltip : public QObject
{
Q_OBJECT
public:
explicit Tooltip(QObject *parent = nullptr);
Q_INVOKABLE void showText(QQuickItem *item, const QPointF &pos, const QString &text);
Q_INVOKABLE void hideText();
static void registerDeclarativeType();
};
QML_DECLARE_TYPE(Tooltip)
#endif // TOOLTIP_H

View File

@@ -138,6 +138,8 @@ public:
void mainWindowActiveChanged(bool active, bool hasPopup); void mainWindowActiveChanged(bool active, bool hasPopup);
void enable3DView(bool enable); void enable3DView(bool enable);
void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) override;
protected: protected:
void timerEvent(QTimerEvent *event) override; void timerEvent(QTimerEvent *event) override;
@@ -189,12 +191,13 @@ private: // functions
void restartProcess(); void restartProcess();
void delayedRestartProcess(); void delayedRestartProcess();
private:
void handleCrash(); void handleCrash();
void startPuppetTransaction(); void startPuppetTransaction();
void endPuppetTransaction(); void endPuppetTransaction();
private: //variables // puppet to creator command handlers
void handlePuppetKeyPress(int key, Qt::KeyboardModifiers modifiers);
NodeInstance m_rootNodeInstance; NodeInstance m_rootNodeInstance;
NodeInstance m_activeStateInstance; NodeInstance m_activeStateInstance;

View File

@@ -45,6 +45,7 @@
#include <changenodesourcecommand.h> #include <changenodesourcecommand.h>
#include <changeselectioncommand.h> #include <changeselectioncommand.h>
#include <drop3dlibraryitemcommand.h> #include <drop3dlibraryitemcommand.h>
#include <puppettocreatorcommand.h>
#include <view3dclosedcommand.h> #include <view3dclosedcommand.h>
#include <informationchangedcommand.h> #include <informationchangedcommand.h>
@@ -285,6 +286,7 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr
static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand"); static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand");
static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand"); static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand");
static const int drop3DLibraryItemCommandType = QMetaType::type("Drop3DLibraryItemCommand"); static const int drop3DLibraryItemCommandType = QMetaType::type("Drop3DLibraryItemCommand");
static const int puppetToCreatorCommand = QMetaType::type("PuppetToCreatorCommand");
static const int view3DClosedCommand = QMetaType::type("View3DClosedCommand"); static const int view3DClosedCommand = QMetaType::type("View3DClosedCommand");
if (m_destructing) if (m_destructing)
@@ -313,6 +315,8 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr
nodeInstanceClient()->selectionChanged(command.value<ChangeSelectionCommand>()); nodeInstanceClient()->selectionChanged(command.value<ChangeSelectionCommand>());
} else if (command.userType() == drop3DLibraryItemCommandType) { } else if (command.userType() == drop3DLibraryItemCommandType) {
nodeInstanceClient()->library3DItemDropped(command.value<Drop3DLibraryItemCommand>()); nodeInstanceClient()->library3DItemDropped(command.value<Drop3DLibraryItemCommand>());
} else if (command.userType() == puppetToCreatorCommand) {
nodeInstanceClient()->handlePuppetToCreatorCommand(command.value<PuppetToCreatorCommand>());
} else if (command.userType() == view3DClosedCommand) { } else if (command.userType() == view3DClosedCommand) {
nodeInstanceClient()->view3DClosed(command.value<View3DClosedCommand>()); nodeInstanceClient()->view3DClosed(command.value<View3DClosedCommand>());
} else if (command.userType() == puppetAliveCommandType) { } else if (command.userType() == puppetAliveCommandType) {

View File

@@ -30,7 +30,6 @@
#include <metainfo.h> #include <metainfo.h>
#include <nodehints.h> #include <nodehints.h>
#include <rewriterview.h> #include <rewriterview.h>
#include "abstractproperty.h" #include "abstractproperty.h"
#include "variantproperty.h" #include "variantproperty.h"
#include "bindingproperty.h" #include "bindingproperty.h"
@@ -42,7 +41,7 @@
#include "qmltimeline.h" #include "qmltimeline.h"
#include "qmltimelinekeyframegroup.h" #include "qmltimelinekeyframegroup.h"
#include "qmlvisualnode.h" #include "qmlvisualnode.h"
#include "qmldesignerconstants.h"
#include "createscenecommand.h" #include "createscenecommand.h"
#include "createinstancescommand.h" #include "createinstancescommand.h"
#include "clearscenecommand.h" #include "clearscenecommand.h"
@@ -71,6 +70,14 @@
#include "removesharedmemorycommand.h" #include "removesharedmemorycommand.h"
#include "debugoutputcommand.h" #include "debugoutputcommand.h"
#include "nodeinstanceserverproxy.h" #include "nodeinstanceserverproxy.h"
#include "puppettocreatorcommand.h"
#ifndef QMLDESIGNER_TEST
#include <qmldesignerplugin.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/documentmanager.h>
#endif
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -1446,6 +1453,45 @@ void NodeInstanceView::library3DItemDropped(const Drop3DLibraryItemCommand &comm
QmlVisualNode::createQmlVisualNode(this, itemLibraryEntry, {}); QmlVisualNode::createQmlVisualNode(this, itemLibraryEntry, {});
} }
void NodeInstanceView::handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command)
{
if (command.type() == PuppetToCreatorCommand::Key_Pressed) {
QPair<int, int> data = qvariant_cast<QPair<int, int>>(command.data());
int key = data.first;
Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers(data.second);
handlePuppetKeyPress(key, modifiers);
}
}
// puppet to creator command handlers
void NodeInstanceView::handlePuppetKeyPress(int key, Qt::KeyboardModifiers modifiers)
{
// TODO: optimal way to handle key events is to just pass them on. This is done
// using the code below but it is so far not working, if someone could get it to work then
// it should be utilized and the rest of the method deleted
// QCoreApplication::postEvent([receiver], new QKeyEvent(QEvent::KeyPress, key, modifiers));
#ifndef QMLDESIGNER_TEST
// handle common keyboard actions coming from puppet
if (Core::ActionManager::command(Core::Constants::UNDO)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
QmlDesignerPlugin::instance()->currentDesignDocument()->undo();
else if (Core::ActionManager::command(Core::Constants::REDO)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
QmlDesignerPlugin::instance()->currentDesignDocument()->redo();
else if (Core::ActionManager::command(Core::Constants::SAVE)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
Core::EditorManager::saveDocument();
else if (Core::ActionManager::command(Core::Constants::SAVEAS)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
Core::EditorManager::saveDocumentAs();
else if (Core::ActionManager::command(Core::Constants::SAVEALL)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
Core::DocumentManager::saveAllModifiedDocuments();
else if (Core::ActionManager::command(QmlDesigner::Constants::C_DELETE)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
QmlDesignerPlugin::instance()->currentDesignDocument()->deleteSelected();
#else
Q_UNUSED(key);
Q_UNUSED(modifiers);
#endif
}
void NodeInstanceView::view3DClosed(const View3DClosedCommand &command) void NodeInstanceView::view3DClosed(const View3DClosedCommand &command)
{ {
Q_UNUSED(command) Q_UNUSED(command)

View File

@@ -12,7 +12,7 @@ Project {
Depends { Depends {
name: "Qt"; name: "Qt";
submodules: [ submodules: [
"core-private", "quickwidgets" "core-private", "gui-private", "quickwidgets"
] ]
} }
Depends { name: "Core" } Depends { name: "Core" }
@@ -177,6 +177,8 @@ Project {
"commands/enable3dviewcommand.h", "commands/enable3dviewcommand.h",
"commands/view3dclosedcommand.cpp", "commands/view3dclosedcommand.cpp",
"commands/view3dclosedcommand.h", "commands/view3dclosedcommand.h",
"commands/puppettocreatorcommand.cpp",
"commands/puppettocreatorcommand.h",
"container/addimportcontainer.cpp", "container/addimportcontainer.cpp",
"container/addimportcontainer.h", "container/addimportcontainer.h",
"container/idcontainer.cpp", "container/idcontainer.cpp",
@@ -618,6 +620,8 @@ Project {
"propertyeditor/simplecolorpalettemodel.h", "propertyeditor/simplecolorpalettemodel.h",
"propertyeditor/simplecolorpalettesingleton.cpp", "propertyeditor/simplecolorpalettesingleton.cpp",
"propertyeditor/simplecolorpalettesingleton.h", "propertyeditor/simplecolorpalettesingleton.h",
"propertyeditor/tooltip.cpp",
"propertyeditor/tooltip.h",
"resources/resources.qrc", "resources/resources.qrc",
"stateseditor/stateseditorimageprovider.cpp", "stateseditor/stateseditorimageprovider.cpp",
"stateseditor/stateseditorimageprovider.h", "stateseditor/stateseditorimageprovider.h",

View File

@@ -301,8 +301,10 @@ static bool isClosingParenthesis(QChar c)
void Highlighter::highlightBlock(const QString &text) void Highlighter::highlightBlock(const QString &text)
{ {
if (!definition().isValid()) if (!definition().isValid()) {
formatSpaces(text);
return; return;
}
QTextBlock block = currentBlock(); QTextBlock block = currentBlock();
KSyntaxHighlighting::State state; KSyntaxHighlighting::State state;
TextDocumentLayout::setBraceDepth(block, TextDocumentLayout::braceDepth(block.previous())); TextDocumentLayout::setBraceDepth(block, TextDocumentLayout::braceDepth(block.previous()));

View File

@@ -89,11 +89,6 @@ void SimpleCodeStylePreferencesWidget::slotTabSettingsChanged(const TextEditor::
current->setTabSettings(settings); current->setTabSettings(settings);
} }
void SimpleCodeStylePreferencesWidget::setFlat(bool on)
{
m_tabSettingsWidget->setFlat(on);
}
TabSettingsWidget *SimpleCodeStylePreferencesWidget::tabSettingsWidget() const TabSettingsWidget *SimpleCodeStylePreferencesWidget::tabSettingsWidget() const
{ {
return m_tabSettingsWidget; return m_tabSettingsWidget;

View File

@@ -46,7 +46,6 @@ public:
void setPreferences(ICodeStylePreferences *tabPreferences); void setPreferences(ICodeStylePreferences *tabPreferences);
void setFlat(bool on);
TabSettingsWidget *tabSettingsWidget() const; TabSettingsWidget *tabSettingsWidget() const;
private: private:

View File

@@ -32,7 +32,7 @@
namespace TextEditor { namespace TextEditor {
TabSettingsWidget::TabSettingsWidget(QWidget *parent) : TabSettingsWidget::TabSettingsWidget(QWidget *parent) :
QWidget(parent), QGroupBox(parent),
ui(new Internal::Ui::TabSettingsWidget) ui(new Internal::Ui::TabSettingsWidget)
{ {
ui->setupUi(this); ui->setupUi(this);
@@ -91,13 +91,6 @@ void TabSettingsWidget::codingStyleLinkActivated(const QString &linkString)
emit codingStyleLinkClicked(QtQuickLink); emit codingStyleLinkClicked(QtQuickLink);
} }
void TabSettingsWidget::setFlat(bool on)
{
ui->tabsAndIndentationGroupBox->setFlat(on);
const int margin = on ? 0 : -1;
ui->tabsAndIndentationGroupBox->layout()->setContentsMargins(margin, -1, margin, margin);
}
void TabSettingsWidget::setCodingStyleWarningVisible(bool visible) void TabSettingsWidget::setCodingStyleWarningVisible(bool visible)
{ {
ui->codingStyleWarning->setVisible(visible); ui->codingStyleWarning->setVisible(visible);

View File

@@ -27,7 +27,7 @@
#include "texteditor_global.h" #include "texteditor_global.h"
#include <QWidget> #include <QGroupBox>
namespace TextEditor { namespace TextEditor {
@@ -35,7 +35,7 @@ namespace Internal { namespace Ui { class TabSettingsWidget; } }
class TabSettings; class TabSettings;
class TEXTEDITOR_EXPORT TabSettingsWidget : public QWidget class TEXTEDITOR_EXPORT TabSettingsWidget : public QGroupBox
{ {
Q_OBJECT Q_OBJECT
@@ -50,7 +50,6 @@ public:
TabSettings tabSettings() const; TabSettings tabSettings() const;
void setFlat(bool on);
void setCodingStyleWarningVisible(bool visible); void setCodingStyleWarningVisible(bool visible);
void setTabSettings(const TextEditor::TabSettings& s); void setTabSettings(const TextEditor::TabSettings& s);

View File

@@ -1,160 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>TextEditor::Internal::TabSettingsWidget</class> <class>TextEditor::Internal::TabSettingsWidget</class>
<widget class="QWidget" name="TextEditor::Internal::TabSettingsWidget"> <widget class="QGroupBox" name="TextEditor::Internal::TabSettingsWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>335</width> <width>254</width>
<height>224</height> <height>189</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string/> <string notr="true"/>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <property name="title">
<property name="margin"> <string>Tabs And Indentation</string>
<number>0</number> </property>
</property> <layout class="QGridLayout" name="gridLayout">
<item> <item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="tabsAndIndentationGroupBox"> <widget class="QLabel" name="codingStyleWarning">
<property name="title"> <property name="toolTip">
<string>Tabs And Indentation</string> <string>The text editor indentation setting is used for non-code files only. See the C++ and Qt Quick coding style settings to configure indentation for code files.</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <property name="text">
<item row="2" column="0"> <string>&lt;i&gt;Code indentation is configured in &lt;a href=&quot;C++&quot;&gt;C++&lt;/a&gt; and &lt;a href=&quot;QtQuick&quot;&gt;Qt Quick&lt;/a&gt; settings.&lt;/i&gt;</string>
<spacer name="horizontalSpacer"> </property>
<property name="orientation"> <property name="wordWrap">
<enum>Qt::Horizontal</enum> <bool>true</bool>
</property> </property>
<property name="sizeType"> </widget>
<enum>QSizePolicy::Fixed</enum> </item>
</property> <item row="1" column="0" colspan="2">
<property name="sizeHint" stdset="0"> <widget class="QLabel" name="tabPolicyLabel">
<size> <property name="text">
<width>30</width> <string>Tab policy:</string>
<height>20</height> </property>
</size> </widget>
</property> </item>
</spacer> <item row="2" column="0">
</item> <spacer name="horizontalSpacer">
<item row="2" column="1"> <property name="orientation">
<widget class="QComboBox" name="tabPolicy"> <enum>Qt::Horizontal</enum>
<property name="sizePolicy"> </property>
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <property name="sizeType">
<horstretch>0</horstretch> <enum>QSizePolicy::Fixed</enum>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="sizeHint" stdset="0">
</property> <size>
<item> <width>30</width>
<property name="text"> <height>20</height>
<string>Spaces Only</string> </size>
</property> </property>
</item> </spacer>
<item> </item>
<property name="text"> <item row="2" column="1">
<string>Tabs Only</string> <widget class="QComboBox" name="tabPolicy">
</property> <property name="sizePolicy">
</item> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<item> <horstretch>0</horstretch>
<property name="text"> <verstretch>0</verstretch>
<string>Mixed</string> </sizepolicy>
</property> </property>
</item> <item>
</widget> <property name="text">
</item> <string>Spaces Only</string>
<item row="3" column="0" colspan="2"> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> </item>
<item> <item>
<widget class="QLabel" name="tabSizeLabel"> <property name="text">
<property name="sizePolicy"> <string>Tabs Only</string>
<sizepolicy hsizetype="Maximum" vsizetype="Preferred"> </property>
<horstretch>0</horstretch> </item>
<verstretch>0</verstretch> <item>
</sizepolicy> <property name="text">
</property> <string>Mixed</string>
<property name="text"> </property>
<string>Ta&amp;b size:</string> </item>
</property> </widget>
<property name="buddy"> </item>
<cstring>tabSize</cstring> <item row="3" column="0" colspan="2">
</property> <layout class="QHBoxLayout" name="horizontalLayout">
</widget> <item>
</item> <widget class="QLabel" name="tabSizeLabel">
<item> <property name="sizePolicy">
<widget class="QSpinBox" name="tabSize"> <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<property name="sizePolicy"> <horstretch>0</horstretch>
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <verstretch>0</verstretch>
<horstretch>0</horstretch> </sizepolicy>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="text">
</property> <string>Ta&amp;b size:</string>
<property name="minimum"> </property>
<number>1</number> <property name="buddy">
</property> <cstring>tabSize</cstring>
<property name="maximum"> </property>
<number>20</number> </widget>
</property> </item>
</widget> <item>
</item> <widget class="QSpinBox" name="tabSize">
<item> <property name="sizePolicy">
<widget class="QLabel" name="indentSizeLabel"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<property name="sizePolicy"> <horstretch>0</horstretch>
<sizepolicy hsizetype="Maximum" vsizetype="Preferred"> <verstretch>0</verstretch>
<horstretch>0</horstretch> </sizepolicy>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="minimum">
</property> <number>1</number>
<property name="text"> </property>
<string>&amp;Indent size:</string> <property name="maximum">
</property> <number>20</number>
<property name="buddy"> </property>
<cstring>indentSize</cstring> </widget>
</property> </item>
</widget> <item>
</item> <widget class="QLabel" name="indentSizeLabel">
<item> <property name="sizePolicy">
<widget class="QSpinBox" name="indentSize"> <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<property name="sizePolicy"> <horstretch>0</horstretch>
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <verstretch>0</verstretch>
<horstretch>0</horstretch> </sizepolicy>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="text">
</property> <string>&amp;Indent size:</string>
<property name="minimum"> </property>
<number>1</number> <property name="buddy">
</property> <cstring>indentSize</cstring>
<property name="maximum"> </property>
<number>20</number> </widget>
</property> </item>
</widget> <item>
</item> <widget class="QSpinBox" name="indentSize">
<item> <property name="sizePolicy">
<spacer name="horizontalSpacer_2"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<property name="orientation"> <horstretch>0</horstretch>
<enum>Qt::Horizontal</enum> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="minimum">
<width>40</width> <number>1</number>
<height>20</height> </property>
</size> <property name="maximum">
</property> <number>20</number>
</spacer> </property>
</item> </widget>
</layout> </item>
</item> <item>
<item row="5" column="1"> <spacer name="horizontalSpacer_2">
<widget class="QComboBox" name="continuationAlignBehavior"> <property name="orientation">
<property name="sizePolicy"> <enum>Qt::Horizontal</enum>
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> </property>
<horstretch>0</horstretch> <property name="sizeHint" stdset="0">
<verstretch>0</verstretch> <size>
</sizepolicy> <width>40</width>
</property> <height>20</height>
<property name="toolTip"> </size>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt; </property>
</spacer>
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="continuationAlignBehaviorLabel">
<property name="text">
<string>Align continuation lines:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="continuationAlignBehavior">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
Influences the indentation of continuation lines. Influences the indentation of continuation lines.
&lt;ul&gt; &lt;ul&gt;
@@ -179,52 +200,22 @@ Influences the indentation of continuation lines.
&lt;/pre&gt; &lt;/pre&gt;
&lt;/li&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<item> <item>
<property name="text"> <property name="text">
<string>Not At All</string> <string>Not At All</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>With Spaces</string> <string>With Spaces</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>With Regular Indent</string> <string>With Regular Indent</string>
</property> </property>
</item> </item>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="tabPolicyLabel">
<property name="text">
<string>Tab policy:</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="continuationAlignBehaviorLabel">
<property name="text">
<string>Align continuation lines:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="codingStyleWarning">
<property name="toolTip">
<string>The text editor indentation setting is used for non-code files only. See the C++ and Qt Quick coding style settings to configure indentation for code files.</string>
</property>
<property name="text">
<string>&lt;i&gt;Code indentation is configured in &lt;a href=&quot;C++&quot;&gt;C++&lt;/a&gt; and &lt;a href=&quot;QtQuick&quot;&gt;Qt Quick&lt;/a&gt; settings.&lt;/i&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@@ -49,6 +49,7 @@ extend_qtc_executable(qml2puppet
update3dviewstatecommand.cpp update3dviewstatecommand.h update3dviewstatecommand.cpp update3dviewstatecommand.h
enable3dviewcommand.cpp enable3dviewcommand.h enable3dviewcommand.cpp enable3dviewcommand.h
view3dclosedcommand.cpp view3dclosedcommand.h view3dclosedcommand.cpp view3dclosedcommand.h
puppettocreatorcommand.cpp puppettocreatorcommand.h
valueschangedcommand.cpp valueschangedcommand.cpp
) )

View File

@@ -103,6 +103,8 @@ QtcTool {
"commands/enable3dviewcommand.h", "commands/enable3dviewcommand.h",
"commands/view3dclosedcommand.cpp", "commands/view3dclosedcommand.cpp",
"commands/view3dclosedcommand.h", "commands/view3dclosedcommand.h",
"commands/puppettocreatorcommand.cpp",
"commands/puppettocreatorcommand.h",
"container/addimportcontainer.cpp", "container/addimportcontainer.cpp",
"container/addimportcontainer.h", "container/addimportcontainer.h",
"container/idcontainer.cpp", "container/idcontainer.cpp",