Merge remote-tracking branch 'origin/4.14'
Change-Id: I8543d87779c0da6a876caa046f6852737c9ae680
BIN
doc/qtdesignstudio/images/icons/blend-mode-16px.png
Normal file
|
After Width: | Height: | Size: 299 B |
BIN
doc/qtdesignstudio/images/icons/brightness-contrast-16px.png
Normal file
|
After Width: | Height: | Size: 226 B |
BIN
doc/qtdesignstudio/images/icons/colourize-16px.png
Normal file
|
After Width: | Height: | Size: 388 B |
BIN
doc/qtdesignstudio/images/icons/desaturation-16px.png
Normal file
|
After Width: | Height: | Size: 162 B |
BIN
doc/qtdesignstudio/images/icons/directional-blur-16px.png
Normal file
|
After Width: | Height: | Size: 277 B |
BIN
doc/qtdesignstudio/images/icons/drop-shadow-16px.png
Normal file
|
After Width: | Height: | Size: 119 B |
BIN
doc/qtdesignstudio/images/icons/fast-blur-16px.png
Normal file
|
After Width: | Height: | Size: 258 B |
BIN
doc/qtdesignstudio/images/icons/glow-16px.png
Normal file
|
After Width: | Height: | Size: 376 B |
BIN
doc/qtdesignstudio/images/icons/hue-saturation-16px.png
Normal file
|
After Width: | Height: | Size: 371 B |
BIN
doc/qtdesignstudio/images/icons/mask-blur-16px.png
Normal file
|
After Width: | Height: | Size: 300 B |
BIN
doc/qtdesignstudio/images/icons/opacity-mask-16px.png
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
doc/qtdesignstudio/images/icons/radial-blur-16px.png
Normal file
|
After Width: | Height: | Size: 337 B |
BIN
doc/qtdesignstudio/images/icons/zoom-blur-16px.png
Normal file
|
After Width: | Height: | Size: 325 B |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 46 KiB |
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Design Studio documentation.
|
||||
@@ -30,20 +30,19 @@
|
||||
|
||||
\QDS provides a set of Qt Quick Studio effects that inherit the types in the
|
||||
\l {Qt Graphical Effects} module. To apply a visual effect to a component,
|
||||
you must place the component inside the effect. First drag-and-drop an
|
||||
effect from \uicontrol Library > \uicontrol Effects to the the
|
||||
\uicontrol {Form Editor} or the \uicontrol Navigator, and then drag-and-drop
|
||||
the component to the effect. For some effects, you need two source
|
||||
components.
|
||||
drag-and-drop it from \uicontrol Library > \uicontrol Effects to the
|
||||
component in \uicontrol Navigator.
|
||||
|
||||
The following table summarizes the available effects and contains links to
|
||||
the documentation of the inherited QML type.
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Icon
|
||||
\li Qt Quick Studio Effect
|
||||
\li Description
|
||||
\row
|
||||
\li \inlineimage icons/blend-mode-16px.png
|
||||
\li \l [QML] {Blend}
|
||||
\li Merges two source components by using a blend mode.
|
||||
|
||||
@@ -54,34 +53,44 @@
|
||||
For a list of possible values and examples of their use, see
|
||||
\l{Blend::mode}{Blend.mode}.
|
||||
\row
|
||||
\li \inlineimage icons/fast-blur-16px.png
|
||||
\li \l {FastBlur}{Blur}
|
||||
\li Applies a fast blur effect to one or more source components.
|
||||
\row
|
||||
\li \inlineimage icons/brightness-contrast-16px.png
|
||||
\li \l {BrightnessContrast}{Brightness Contrast}
|
||||
\li Adjusts brightness and contrast.
|
||||
\row
|
||||
\li \inlineimage icons/colourize-16px.png
|
||||
\li \l {ColorOverlay}{Color Overlay}
|
||||
\li Alters the colors of the source component by applying an overlay
|
||||
color.
|
||||
\row
|
||||
\li \inlineimage icons/colourize-16px.png
|
||||
\li \l Colorize
|
||||
\li Sets the color in the HSL color space.
|
||||
\row
|
||||
\li \inlineimage icons/directional-blur-16px.png
|
||||
\li \l {DirectionalBlur}{Directional Blur}
|
||||
\li Applies blur effect to the specified direction.
|
||||
\row
|
||||
\li \inlineimage icons/drop-shadow-16px.png
|
||||
\li \l {DropShadow}{Drop Shadow}
|
||||
\li Generates a soft shadow behind the source component.
|
||||
\row
|
||||
\li \inlineimage icons/glow-16px.png
|
||||
\li \l [QML] {Glow}
|
||||
\li Generates a halo-like glow around the source component.
|
||||
\row
|
||||
\li \inlineimage icons/hue-saturation-16px.png
|
||||
\li \l {HueSaturation}{Hue Saturation}
|
||||
\li Alters the source component colors in the HSL color space.
|
||||
\row
|
||||
\li \inlineimage icons/opacity-mask-16px.png
|
||||
\li \l {OpacityMask}{Mask}
|
||||
\li Masks the source component with another component.
|
||||
\row
|
||||
\li \inlineimage icons/mask-blur-16px.png
|
||||
\li \l {MaskedBlur}{Masked Blur}
|
||||
\li Applies a blur effect with a varying intesity.
|
||||
The \l GradientStop type is used to specify the color used at a
|
||||
@@ -89,13 +98,16 @@
|
||||
The default positions for the stops are 0.20, 0.50, 0.80, and 1.00.
|
||||
The default color is black.
|
||||
\row
|
||||
\li \inlineimage icons/radial-blur-16px.png
|
||||
\li \l {RadialBlur}{Radial Blur}
|
||||
\li Applies directional blur in a circular direction around the
|
||||
component's center point.
|
||||
\row
|
||||
\li \inlineimage icons/desaturation-16px.png
|
||||
\li \l {Desaturate}{Saturation}
|
||||
\li Reduces the saturation of the colors.
|
||||
\row
|
||||
\li \inlineimage icons/zoom-blur-16px.png
|
||||
\li \l {ZoomBlur}{Zoom Blur}
|
||||
\li Applies directional blur effect towards source component's center
|
||||
point.
|
||||
|
||||
@@ -41,14 +41,15 @@
|
||||
scene, specify properties for them, and view them in a tree structure,
|
||||
as well as to create connections and browse projects and files.
|
||||
|
||||
\image studio-editing-3d-scenes.png "3D assets in Design mode"
|
||||
\image studio-editing-3d-scenes.png "Views for editing 3D assets in Design mode"
|
||||
|
||||
To open the following views, select \uicontrol View > \uicontrol Views:
|
||||
|
||||
\list
|
||||
\li \uicontrol {3D Editor} (1) is the working area where you create the
|
||||
scene, position the model, light and camera, as well as move and
|
||||
scale items. For more information, see \l {Working in 3D Editor}.
|
||||
scene, position the model, light and camera, as well as move, rotate
|
||||
and scale items. For more information, see
|
||||
\l {Working in 3D Editor}.
|
||||
\li \uicontrol {Form Editor} (2) is where you see the scene projected by
|
||||
the camera.
|
||||
\li \uicontrol {Library} (3) displays the building blocks that you
|
||||
@@ -60,14 +61,19 @@
|
||||
file as a tree structure. For more information, see
|
||||
\l {Managing Item Hierarchy}.
|
||||
\li \uicontrol {Properties} (5) organizes the properties of the
|
||||
selected item. You can change the properties also in the
|
||||
\uicontrol {Text Editor}. For more information, see
|
||||
selected item. You can change the properties also in \uicontrol
|
||||
{Text Editor}. For more information, see
|
||||
\l {Specifying Item Properties}.
|
||||
\li \uicontrol Connections (6) enables you to create connections
|
||||
between objects, signals, and object properties. For more
|
||||
information, see \l{Adding Connections}.
|
||||
\li \uicontrol Timeline (7) provides a timeline and keyframe based
|
||||
\li \uicontrol States displays the different states of the item. QML
|
||||
states typically describe user interface configurations, such as the
|
||||
UI controls, their properties and behavior and the available
|
||||
actions. For more information, see \l {Adding States}.
|
||||
\li \uicontrol Timeline provides a timeline and keyframe based
|
||||
editor that enables you to animate the properties of components.
|
||||
For more information, see \l {Creating Animations}.
|
||||
\endlist
|
||||
|
||||
For more information on other views, see
|
||||
|
||||
@@ -298,7 +298,7 @@ def qdump__CPlusPlus__Token(d, value):
|
||||
|
||||
|
||||
def qdump__CPlusPlus__Internal__PPToken(d, value):
|
||||
data, size, alloc = d.byteArrayData(value["m_src"])
|
||||
data, size, alloc = d.qArrayData(value["m_src"])
|
||||
length = value["f"]["utf16chars"].integer()
|
||||
offset = value["utf16charOffset"].integer()
|
||||
#DumperBase.warn("size: %s, alloc: %s, offset: %s, length: %s, data: %s"
|
||||
|
||||
@@ -570,17 +570,17 @@ class DumperBase():
|
||||
self.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
|
||||
return data, size, alloc
|
||||
|
||||
def byteArrayDataHelper(self, bytearray_data_ptr):
|
||||
# bytearray_data_ptr is what is e.g. stored in a QByteArray's d_ptr.
|
||||
def qArrayDataHelper(self, array_data_ptr):
|
||||
# array_data_ptr is what is e.g. stored in a QByteArray's d_ptr.
|
||||
if self.qtVersion() >= 0x050000:
|
||||
# QTypedArray:
|
||||
# - QtPrivate::RefCount ref
|
||||
# - int size
|
||||
# - uint alloc : 31, capacityReserved : 1
|
||||
# - qptrdiff offset
|
||||
(ref, size, alloc, offset) = self.split('IIpp', bytearray_data_ptr)
|
||||
(ref, size, alloc, offset) = self.split('IIpp', array_data_ptr)
|
||||
alloc = alloc & 0x7ffffff
|
||||
data = bytearray_data_ptr + offset
|
||||
data = array_data_ptr + offset
|
||||
if self.ptrSize() == 4:
|
||||
data = data & 0xffffffff
|
||||
else:
|
||||
@@ -592,35 +592,37 @@ class DumperBase():
|
||||
# - [padding]
|
||||
# - char *data;
|
||||
if self.ptrSize() == 4:
|
||||
(ref, alloc, size, data) = self.split('IIIp', bytearray_data_ptr)
|
||||
(ref, alloc, size, data) = self.split('IIIp', array_data_ptr)
|
||||
else:
|
||||
(ref, alloc, size, pad, data) = self.split('IIIIp', bytearray_data_ptr)
|
||||
(ref, alloc, size, pad, data) = self.split('IIIIp', array_data_ptr)
|
||||
else:
|
||||
# Data:
|
||||
# - QShared count;
|
||||
# - QChar *unicode
|
||||
# - char *ascii
|
||||
# - uint len: 30
|
||||
(dummy, dummy, dummy, size) = self.split('IIIp', bytearray_data_ptr)
|
||||
size = self.extractInt(bytearray_data_ptr + 3 * self.ptrSize()) & 0x3ffffff
|
||||
(dummy, dummy, dummy, size) = self.split('IIIp', array_data_ptr)
|
||||
size = self.extractInt(array_data_ptr + 3 * self.ptrSize()) & 0x3ffffff
|
||||
alloc = size # pretend.
|
||||
data = self.extractPointer(bytearray_data_ptr + self.ptrSize())
|
||||
data = self.extractPointer(array_data_ptr + self.ptrSize())
|
||||
return data, size, alloc
|
||||
|
||||
# addr is the begin of a QByteArrayData structure
|
||||
def encodeStringHelper(self, addr, limit):
|
||||
def encodeStringHelper(self, value, limit):
|
||||
addr = self.extractPointer(value)
|
||||
# Should not happen, but we get it with LLDB as result
|
||||
# of inferior calls
|
||||
if addr == 0:
|
||||
return 0, ''
|
||||
data, size, alloc = self.byteArrayDataHelper(addr)
|
||||
data, size, alloc = self.qArrayDataHelper(addr)
|
||||
if alloc != 0:
|
||||
self.check(0 <= size and size <= alloc and alloc <= 100 * 1000 * 1000)
|
||||
elided, shown = self.computeLimit(size, limit)
|
||||
return elided, self.readMemory(data, 2 * shown)
|
||||
|
||||
def encodeByteArrayHelper(self, addr, limit):
|
||||
data, size, alloc = self.byteArrayDataHelper(addr)
|
||||
def encodeByteArrayHelper(self, value, limit):
|
||||
addr = self.extractPointer(value)
|
||||
data, size, alloc = self.qArrayDataHelper(addr)
|
||||
if alloc != 0:
|
||||
self.check(0 <= size and size <= alloc and alloc <= 100 * 1000 * 1000)
|
||||
elided, shown = self.computeLimit(size, limit)
|
||||
@@ -670,15 +672,14 @@ class DumperBase():
|
||||
return self.hexencode(bytes(self.readRawMemory(addr, size)))
|
||||
|
||||
def encodeByteArray(self, value, limit=0):
|
||||
elided, data = self.encodeByteArrayHelper(self.extractPointer(value), limit)
|
||||
elided, data = self.encodeByteArrayHelper(value, limit)
|
||||
return data
|
||||
|
||||
def byteArrayData(self, value):
|
||||
return self.byteArrayDataHelper(self.extractPointer(value))
|
||||
def qArrayData(self, value):
|
||||
return self.qArrayDataHelper(self.extractPointer(value))
|
||||
|
||||
def putByteArrayValue(self, value):
|
||||
elided, data = self.encodeByteArrayHelper(
|
||||
self.extractPointer(value), self.displayStringLimit)
|
||||
elided, data = self.encodeByteArrayHelper(value, self.displayStringLimit)
|
||||
self.putValue(data, 'latin1', elided=elided)
|
||||
|
||||
def encodeString(self, value, limit=0):
|
||||
@@ -690,7 +691,7 @@ class DumperBase():
|
||||
data = self.readMemory(ptr, shown)
|
||||
return data
|
||||
else:
|
||||
elided, data = self.encodeStringHelper(self.extractPointer(value), limit)
|
||||
elided, data = self.encodeStringHelper(value, limit)
|
||||
return data
|
||||
|
||||
def encodedUtf16ToUtf8(self, s):
|
||||
@@ -708,7 +709,7 @@ class DumperBase():
|
||||
alloc = size
|
||||
return data, size, alloc
|
||||
else:
|
||||
return self.byteArrayDataHelper(self.extractPointer(value))
|
||||
return self.qArrayData(value)
|
||||
|
||||
def extractTemplateArgument(self, typename, position):
|
||||
level = 0
|
||||
@@ -750,8 +751,7 @@ class DumperBase():
|
||||
data = self.readMemory(ptr, shown)
|
||||
self.putValue(data, 'utf16', elided=elided)
|
||||
else:
|
||||
addr = self.extractPointer(value)
|
||||
elided, data = self.encodeStringHelper(addr, self.displayStringLimit)
|
||||
elided, data = self.encodeStringHelper(value, self.displayStringLimit)
|
||||
self.putValue(data, 'utf16', elided=elided)
|
||||
|
||||
def putPtrItem(self, name, value):
|
||||
@@ -1479,7 +1479,7 @@ class DumperBase():
|
||||
# - QString objectName
|
||||
objectName = self.extractPointer(extra + 5 * ptrSize)
|
||||
|
||||
data, size, alloc = self.byteArrayDataHelper(objectName)
|
||||
data, size, alloc = self.qArrayDataHelper(objectName)
|
||||
|
||||
# Object names are short, and GDB can crash on to big chunks.
|
||||
# Since this here is a convenience feature only, limit it.
|
||||
@@ -1769,7 +1769,7 @@ class DumperBase():
|
||||
if revision >= 7: # Qt 5.
|
||||
byteArrayDataSize = 24 if ptrSize == 8 else 16
|
||||
literal = stringdata + toInteger(index) * byteArrayDataSize
|
||||
ldata, lsize, lalloc = self.byteArrayDataHelper(literal)
|
||||
ldata, lsize, lalloc = self.qArrayDataHelper(literal)
|
||||
try:
|
||||
s = struct.unpack_from('%ds' % lsize, self.readRawMemory(ldata, lsize))[0]
|
||||
return s if sys.version_info[0] == 2 else s.decode('utf8')
|
||||
@@ -3816,40 +3816,8 @@ class DumperBase():
|
||||
#typish.check()
|
||||
return typish
|
||||
if isinstance(typish, str):
|
||||
def knownSize(tn):
|
||||
if tn[0] == 'Q':
|
||||
if tn in ('QByteArray', 'QString', 'QList', 'QStringList',
|
||||
'QStringDataPtr'):
|
||||
return self.ptrSize()
|
||||
if tn == 'QStandardItemData':
|
||||
return 8 + 2 * self.ptrSize()
|
||||
if tn in ('QImage', 'QObject'):
|
||||
return 2 * self.ptrSize()
|
||||
if tn == 'QVariant':
|
||||
return 8 + self.ptrSize()
|
||||
if typish in ('QPointF', 'QDateTime', 'QRect'):
|
||||
return 16
|
||||
if typish == 'QPoint':
|
||||
return 8
|
||||
if typish == 'Qt::ItemDataRole':
|
||||
return 4
|
||||
if typish == 'QChar':
|
||||
return 2
|
||||
if typish in ('quint32', 'qint32'):
|
||||
return 4
|
||||
return None
|
||||
|
||||
ns = self.qtNamespace()
|
||||
typish = typish.replace('@', ns)
|
||||
if typish.startswith(ns):
|
||||
if size is None:
|
||||
size = knownSize(typish[len(ns):])
|
||||
else:
|
||||
if size is None:
|
||||
size = knownSize(typish)
|
||||
if size is not None:
|
||||
typish = ns + typish
|
||||
|
||||
tdata = self.typeData.get(typish, None)
|
||||
if tdata is not None:
|
||||
return self.Type(self, typish)
|
||||
|
||||
@@ -62,7 +62,7 @@ def qdump__QByteArray(d, value):
|
||||
else: # fromRawData
|
||||
alloc = size
|
||||
else:
|
||||
data, size, alloc = d.byteArrayData(value)
|
||||
data, size, alloc = d.qArrayData(value)
|
||||
|
||||
d.check(alloc == 0 or (0 <= size and size <= alloc and alloc <= 100000000))
|
||||
if size > 0:
|
||||
@@ -72,7 +72,7 @@ def qdump__QByteArray(d, value):
|
||||
elided, shown = d.computeLimit(size, d.displayStringLimit)
|
||||
p = d.readMemory(data, shown)
|
||||
else:
|
||||
elided, p = d.encodeByteArrayHelper(d.extractPointer(value), d.displayStringLimit)
|
||||
elided, p = d.encodeByteArrayHelper(value, d.displayStringLimit)
|
||||
|
||||
displayFormat = d.currentItemFormat()
|
||||
if displayFormat == DisplayFormat.Automatic or displayFormat == DisplayFormat.Latin1String:
|
||||
@@ -89,22 +89,22 @@ def qdump__QByteArray(d, value):
|
||||
d.putArrayData(data, size, d.charType())
|
||||
|
||||
|
||||
def qdump__QArrayData(d, value):
|
||||
data, size, alloc = d.byteArrayDataHelper(value.address())
|
||||
d.check(alloc == 0 or (0 <= size and size <= alloc and alloc <= 100000000))
|
||||
d.putValue(d.readMemory(data, size), 'latin1')
|
||||
d.putPlainChildren(value)
|
||||
#def qdump__QArrayData(d, value):
|
||||
# data, size, alloc = d.qArrayDataHelper(value.address())
|
||||
# d.check(alloc == 0 or (0 <= size and size <= alloc and alloc <= 100000000))
|
||||
# d.putValue(d.readMemory(data, size), 'latin1')
|
||||
# d.putPlainChildren(value)
|
||||
|
||||
|
||||
def qdump__QByteArrayData(d, value):
|
||||
qdump__QArrayData(d, value)
|
||||
#def qdump__QByteArrayData(d, value):
|
||||
# qdump__QArrayData(d, value)
|
||||
|
||||
|
||||
def qdump__QBitArray(d, value):
|
||||
if d.qtVersion() >= 0x60000:
|
||||
_, data, basize = value.split('ppi')
|
||||
else:
|
||||
data, basize, _ = d.byteArrayDataHelper(d.extractPointer(value['d']))
|
||||
data, basize, _ = d.qArrayData(value['d'])
|
||||
unused = d.extractByte(data) if data else 0
|
||||
size = basize * 8 - unused
|
||||
d.putItemCount(size)
|
||||
@@ -270,7 +270,9 @@ def qdump__QStandardItem(d, value):
|
||||
|
||||
def qdump__QDate(d, value):
|
||||
jd = value.pointer()
|
||||
if jd:
|
||||
if not jd:
|
||||
d.putValue('(invalid)')
|
||||
return
|
||||
d.putValue(jd, 'juliandate')
|
||||
d.putExpandable()
|
||||
if d.isExpanded():
|
||||
@@ -280,13 +282,12 @@ def qdump__QDate(d, value):
|
||||
d.enumExpression('DateFormat', 'TextDate'))
|
||||
d.putCallItem('(ISO)', '@QString', value, 'toString',
|
||||
d.enumExpression('DateFormat', 'ISODate'))
|
||||
if d.qtVersion() < 0x060000:
|
||||
d.putCallItem('(SystemLocale)', '@QString', value, 'toString',
|
||||
d.enumExpression('DateFormat', 'SystemLocaleDate'))
|
||||
d.putCallItem('(Locale)', '@QString', value, 'toString',
|
||||
d.enumExpression('DateFormat', 'LocaleDate'))
|
||||
d.putFields(value)
|
||||
else:
|
||||
d.putValue('(invalid)')
|
||||
|
||||
|
||||
def qdump__QTime(d, value):
|
||||
@@ -301,7 +302,7 @@ def qdump__QTime(d, value):
|
||||
d.enumExpression('DateFormat', 'TextDate'))
|
||||
d.putCallItem('(ISO)', '@QString', value, 'toString',
|
||||
d.enumExpression('DateFormat', 'ISODate'))
|
||||
if d.canCallLocale():
|
||||
if d.canCallLocale() and d.qtVersion() < 0x060000:
|
||||
d.putCallItem('(SystemLocale)', '@QString', value, 'toString',
|
||||
d.enumExpression('DateFormat', 'SystemLocaleDate'))
|
||||
d.putCallItem('(Locale)', '@QString', value, 'toString',
|
||||
@@ -380,7 +381,7 @@ def qdump__QDateTime(d, value):
|
||||
tz = ''
|
||||
else:
|
||||
idBase = tzp + 2 * d.ptrSize() # [QSharedData] + [vptr]
|
||||
elided, tz = d.encodeByteArrayHelper(d.extractPointer(idBase), limit=100)
|
||||
elided, tz = d.encodeByteArray(idBase, limit=100)
|
||||
d.putValue('%s/%s/%s/%s/%s/%s' % (msecs, spec, offset, tz, status, 0),
|
||||
'datetimeinternal')
|
||||
else:
|
||||
@@ -419,6 +420,7 @@ def qdump__QDateTime(d, value):
|
||||
d.enumExpression('DateFormat', 'ISODate'))
|
||||
d.putCallItem('toUTC', '@QDateTime', value, 'toTimeSpec',
|
||||
d.enumExpression('TimeSpec', 'UTC'))
|
||||
if d.qtVersion() < 0x060000:
|
||||
d.putCallItem('(SystemLocale)', '@QString', value, 'toString',
|
||||
d.enumExpression('DateFormat', 'SystemLocaleDate'))
|
||||
d.putCallItem('(Locale)', '@QString', value, 'toString',
|
||||
@@ -468,10 +470,12 @@ def qdump__QDir(d, value):
|
||||
# + 2 byte padding
|
||||
fileSystemEntrySize = 2 * d.ptrSize() + 8
|
||||
|
||||
if d.qtVersion() < 0x050200:
|
||||
case = 0
|
||||
if d.qtVersion() >= 0x060000:
|
||||
case = 2
|
||||
elif d.qtVersion() >= 0x050300:
|
||||
case = 1
|
||||
elif d.qtVersion() < 0x050200:
|
||||
case = 0
|
||||
else:
|
||||
# Try to distinguish bool vs QStringList at the first item
|
||||
# after the (padded) refcount. If it looks like a bool assume
|
||||
@@ -479,17 +483,28 @@ def qdump__QDir(d, value):
|
||||
firstValue = d.extractInt(privAddress + d.ptrSize())
|
||||
case = 1 if firstValue == 0 or firstValue == 1 else 0
|
||||
|
||||
if case == 1:
|
||||
if case == 2:
|
||||
if bit32:
|
||||
filesOffset = 4
|
||||
fileInfosOffset = 16
|
||||
dirEntryOffset = 40
|
||||
absoluteDirEntryOffset = 72
|
||||
else:
|
||||
filesOffset = 8
|
||||
fileInfosOffset = 32
|
||||
dirEntryOffset = 96
|
||||
absoluteDirEntryOffset = 152
|
||||
elif case == 1:
|
||||
if bit32:
|
||||
filesOffset = 4
|
||||
fileInfosOffset = 8
|
||||
dirEntryOffset = 0x20
|
||||
absoluteDirEntryOffset = 0x30
|
||||
dirEntryOffset = 32
|
||||
absoluteDirEntryOffset = 48
|
||||
else:
|
||||
filesOffset = 0x08
|
||||
fileInfosOffset = 0x10
|
||||
dirEntryOffset = 0x30
|
||||
absoluteDirEntryOffset = 0x48
|
||||
filesOffset = 8
|
||||
fileInfosOffset = 16
|
||||
dirEntryOffset = 48
|
||||
absoluteDirEntryOffset = 72
|
||||
else:
|
||||
# Assume this is before 9fc0965.
|
||||
qt3support = d.isQt3Support()
|
||||
@@ -1037,7 +1052,7 @@ def qdump__QVariantList(d, value):
|
||||
|
||||
def qdumpHelper_QList(d, value, innerType):
|
||||
if d.qtVersion() >= 0x60000:
|
||||
dd, data, size = value.split('ppi')
|
||||
dd, data, size = d.split('ppi', value)
|
||||
d.putItemCount(size)
|
||||
d.putPlotData(data, size, innerType)
|
||||
return
|
||||
@@ -1662,8 +1677,8 @@ def qdump__QStaticStringData(d, value):
|
||||
def qdump__QTypedArrayData(d, value):
|
||||
if value.type[0].name == 'unsigned short':
|
||||
qdump__QStringData(d, value)
|
||||
else:
|
||||
qdump__QArrayData(d, value)
|
||||
# else:
|
||||
# qdump__QArrayData(d, value)
|
||||
|
||||
|
||||
def qdump__QStringData(d, value):
|
||||
@@ -2187,10 +2202,11 @@ def qdump__QXmlAttributes__Attribute(d, value):
|
||||
|
||||
|
||||
def qdump__QXmlAttributes(d, value):
|
||||
(vptr, atts) = value.split('pP')
|
||||
innerType = d.createType(d.qtNamespace() + 'QXmlAttributes::Attribute', 4 * d.ptrSize())
|
||||
val = d.createListItem(atts, innerType)
|
||||
qdumpHelper_QList(d, val, innerType)
|
||||
vptr, atts = value.split('p{QList<QXmlAttributes::Attribute>}')
|
||||
_, att_size, _ = d.describeStruct('{QString}' * 4)
|
||||
innerType = d.createType(d.qtNamespace() + 'QXmlAttributes::Attribute',
|
||||
att_size)
|
||||
qdumpHelper_QList(d, atts, innerType)
|
||||
|
||||
|
||||
def qdump__QXmlStreamStringRef(d, value):
|
||||
@@ -3052,7 +3068,8 @@ def qdump__QJsonValue(d, value):
|
||||
return
|
||||
if t == 3:
|
||||
d.putType('QJsonValue (String)')
|
||||
elided, base = d.encodeStringHelper(data, d.displayStringLimit)
|
||||
string = value.split('{QString}')[0]
|
||||
elided, base = d.encodeString(string, d.displayStringLimit)
|
||||
d.putValue(base, 'utf16', elided=elided)
|
||||
return
|
||||
if t == 4:
|
||||
@@ -3158,7 +3175,7 @@ def qdumpHelper_QCbor_string(d, container_ptr, element_index, is_bytes):
|
||||
element_at_n_addr = elements_data_ptr + element_index * 16 # sizeof(QtCbor::Element) == 15
|
||||
element_value, _, element_flags = d.split('qII', element_at_n_addr)
|
||||
enc = 'latin1' if is_bytes or (element_flags & 8) else 'utf16'
|
||||
bytedata, _, _ = d.byteArrayDataHelper(data_d_ptr)
|
||||
bytedata, _, _ = d.qArrayDataHelper(data_d_ptr)
|
||||
bytedata += element_value
|
||||
if d.qtVersion() >= 0x060000:
|
||||
bytedata_len = d.extractInt64(bytedata)
|
||||
@@ -3193,7 +3210,7 @@ def qdumpHelper_QCbor_array(d, container_ptr, is_cbor):
|
||||
elements_data_ptr, elements_size, _ = d.vectorDataHelper(elements_d_ptr)
|
||||
d.putItemCount(elements_size)
|
||||
if d.isExpanded():
|
||||
bytedata, _, _ = d.byteArrayDataHelper(data_d_ptr)
|
||||
bytedata, _, _ = d.qArrayDataHelper(data_d_ptr)
|
||||
with Children(d, maxNumChild=1000):
|
||||
for i in range(elements_size):
|
||||
d.putSubItem(i, qdumpHelper_QCborArray_valueAt(d, container_ptr, elements_data_ptr, i, bytedata, is_cbor))
|
||||
@@ -3215,7 +3232,7 @@ def qdumpHelper_QCbor_map(d, container_ptr, is_cbor):
|
||||
elements_size = int(elements_size / 2)
|
||||
d.putItemCount(elements_size)
|
||||
if d.isExpanded():
|
||||
bytedata, _, _ = d.byteArrayDataHelper(data_d_ptr)
|
||||
bytedata, _, _ = d.qArrayDataHelper(data_d_ptr)
|
||||
with Children(d, maxNumChild=1000):
|
||||
for i in range(elements_size):
|
||||
key = qdumpHelper_QCborArray_valueAt(d, container_ptr, elements_data_ptr, 2 * i, bytedata, is_cbor)
|
||||
|
||||
@@ -105,15 +105,21 @@ Diagnostics DocumentClangToolRunner::diagnosticsAtLine(int lineNumber) const
|
||||
return diagnostics;
|
||||
}
|
||||
|
||||
void DocumentClangToolRunner::scheduleRun()
|
||||
static void removeClangToolRefactorMarkers(TextEditor::TextEditorWidget *editor)
|
||||
{
|
||||
for (DiagnosticMark *mark : m_marks)
|
||||
mark->disable();
|
||||
for (TextEditor::TextEditorWidget *editor : m_editorsWithMarkers) {
|
||||
if (!editor)
|
||||
return;
|
||||
editor->setRefactorMarkers(
|
||||
TextEditor::RefactorMarker::filterOutType(editor->refactorMarkers(),
|
||||
Constants::CLANG_TOOL_FIXIT_AVAILABLE_MARKER_ID));
|
||||
}
|
||||
|
||||
void DocumentClangToolRunner::scheduleRun()
|
||||
{
|
||||
for (DiagnosticMark *mark : m_marks)
|
||||
mark->disable();
|
||||
for (TextEditor::TextEditorWidget *editor : m_editorsWithMarkers)
|
||||
removeClangToolRefactorMarkers(editor);
|
||||
m_runTimer.start();
|
||||
}
|
||||
|
||||
@@ -144,22 +150,17 @@ static FileInfo getFileInfo(const Utils::FilePath &file, ProjectExplorer::Projec
|
||||
QTC_ASSERT(projectFile.kind != CppTools::ProjectFile::Unsupported, continue);
|
||||
if (projectFile.path == CppTools::CppModelManager::configurationFileName())
|
||||
continue;
|
||||
if (file.toString() != projectFile.path)
|
||||
const auto projectFilePath = Utils::FilePath::fromString(projectFile.path);
|
||||
if (file != projectFilePath)
|
||||
continue;
|
||||
if (!projectFile.active)
|
||||
continue;
|
||||
if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Unknown) {
|
||||
// found the best candidate, early return
|
||||
return FileInfo(Utils::FilePath::fromString(projectFile.path),
|
||||
projectFile.kind,
|
||||
projectPart);
|
||||
}
|
||||
if (candidate.projectPart.isNull()) {
|
||||
// found at least something but keep looking for better candidates
|
||||
candidate = FileInfo(Utils::FilePath::fromString(projectFile.path),
|
||||
projectFile.kind,
|
||||
projectPart);
|
||||
}
|
||||
if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Unknown)
|
||||
return FileInfo(projectFilePath, projectFile.kind, projectPart);
|
||||
// found something but keep looking for better candidates
|
||||
if (candidate.projectPart.isNull())
|
||||
candidate = FileInfo(projectFilePath, projectFile.kind, projectPart);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,6 +326,7 @@ void DocumentClangToolRunner::onSuccess()
|
||||
for (auto editor : TextEditor::BaseTextEditor::textEditorsForDocument(doc)) {
|
||||
if (TextEditor::TextEditorWidget *widget = editor->editorWidget()) {
|
||||
widget->setRefactorMarkers(markers + widget->refactorMarkers());
|
||||
if (!m_editorsWithMarkers.contains(widget))
|
||||
m_editorsWithMarkers << widget;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ private:
|
||||
QList<DiagnosticMark *> m_marks;
|
||||
FileInfo m_fileInfo;
|
||||
QMetaObject::Connection m_projectSettingsUpdate;
|
||||
QSet<TextEditor::TextEditorWidget *> m_editorsWithMarkers;
|
||||
QList<QPointer<TextEditor::TextEditorWidget>> m_editorsWithMarkers;
|
||||
SuppressedDiagnosticsList m_suppressed;
|
||||
Utils::FilePath m_lastProjectDirectory;
|
||||
};
|
||||
|
||||
@@ -111,7 +111,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Utils::Id id)
|
||||
if (oldDir.isEmpty())
|
||||
return newDir;
|
||||
|
||||
if (QDir(oldDir).exists("CMakeCache.txt")) {
|
||||
if (QDir(oldDir).exists("CMakeCache.txt") && !QDir(newDir).exists("CMakeCache.txt")) {
|
||||
if (QMessageBox::information(nullptr,
|
||||
tr("Changing Build Directory"),
|
||||
tr("Change the build directory and start with a "
|
||||
|
||||
@@ -796,13 +796,22 @@ void CMakeBuildSystem::wireUpConnections()
|
||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()),
|
||||
CMakeBuildSystem::REPARSE_FORCE_CMAKE_RUN);
|
||||
});
|
||||
connect(cmakeBuildConfiguration(), &CMakeBuildConfiguration::buildDirectoryChanged, this, [this]() {
|
||||
connect(cmakeBuildConfiguration(),
|
||||
&CMakeBuildConfiguration::buildDirectoryChanged,
|
||||
this,
|
||||
[this]() {
|
||||
// The build directory of our BC has changed:
|
||||
// Run with initial arguments!
|
||||
// Does the directory contain a CMakeCache ? Existing build, just parse
|
||||
// No CMakeCache? Run with initial arguments!
|
||||
qCDebug(cmakeBuildSystemLog) << "Requesting parse due to build directory change";
|
||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()),
|
||||
CMakeBuildSystem::REPARSE_FORCE_INITIAL_CONFIGURATION
|
||||
| CMakeBuildSystem::REPARSE_FORCE_CMAKE_RUN);
|
||||
const BuildDirParameters parameters(cmakeBuildConfiguration());
|
||||
const bool hasCMakeCache = QFile::exists(
|
||||
(parameters.buildDirectory / "CMakeCache.txt").toString());
|
||||
const auto options = ReparseParameters(
|
||||
hasCMakeCache
|
||||
? REPARSE_DEFAULT
|
||||
: (REPARSE_FORCE_INITIAL_CONFIGURATION | REPARSE_FORCE_CMAKE_RUN));
|
||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()), options);
|
||||
});
|
||||
|
||||
connect(project(), &Project::projectFileIsDirty, this, [this]() {
|
||||
@@ -811,7 +820,7 @@ void CMakeBuildSystem::wireUpConnections()
|
||||
if (cmake && cmake->isAutoRun()) {
|
||||
qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file";
|
||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()),
|
||||
CMakeBuildSystem::REPARSE_DEFAULT);
|
||||
CMakeBuildSystem::REPARSE_FORCE_CMAKE_RUN);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -431,7 +431,7 @@ static void drawPrimitiveTweakedForDarkTheme(QStyle::PrimitiveElement element,
|
||||
break;
|
||||
}
|
||||
case QStyle::PE_FrameLineEdit: {
|
||||
const bool isComboBox = widget->inherits("QComboBox");
|
||||
const bool isComboBox = widget && widget->inherits("QComboBox");
|
||||
const QRectF frameRectF =
|
||||
QRectF(option->rect).adjusted(0.5, 0.5, isComboBox ? -8.5 : -0.5, -0.5);
|
||||
painter->setPen(framePen);
|
||||
@@ -447,7 +447,8 @@ static void drawPrimitiveTweakedForDarkTheme(QStyle::PrimitiveElement element,
|
||||
// Shrinking the topMargin if Not checkable AND title is empty
|
||||
topMargin = groupBoxTopMargin;
|
||||
} else {
|
||||
topMargin = qMax(widget->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight),
|
||||
const int exclusiveIndicatorHeight = widget ? widget->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight) : 0;
|
||||
topMargin = qMax(exclusiveIndicatorHeight,
|
||||
option->fontMetrics.height()) + groupBoxTopMargin;
|
||||
}
|
||||
// Snippet from QFusionStyle::drawPrimitive - END
|
||||
@@ -505,15 +506,16 @@ static void drawPrimitiveTweakedForDarkTheme(QStyle::PrimitiveElement element,
|
||||
break;
|
||||
}
|
||||
case QStyle::PE_IndicatorTabClose: {
|
||||
QWindow *window = widget->window()->windowHandle();
|
||||
QWindow *window = widget ? widget->window()->windowHandle() : nullptr;
|
||||
QRect iconRect = QRect(0, 0, 16, 16);
|
||||
iconRect.moveCenter(option->rect.center());
|
||||
const QIcon::Mode mode = !isEnabled ? QIcon::Disabled : QIcon::Normal;
|
||||
const static QIcon closeIcon = Utils::Icons::CLOSE_FOREGROUND.icon();
|
||||
if (option->state & QStyle::State_MouseOver)
|
||||
if (option->state & QStyle::State_MouseOver && widget)
|
||||
widget->style()->drawPrimitive(QStyle::PE_PanelButtonCommand, option, painter, widget);
|
||||
const int devicePixelRatio = widget ? widget->devicePixelRatio() : 1;
|
||||
const QPixmap iconPx =
|
||||
closeIcon.pixmap(window, iconRect.size() * widget->devicePixelRatio(), mode);
|
||||
closeIcon.pixmap(window, iconRect.size() * devicePixelRatio, mode);
|
||||
painter->drawPixmap(iconRect, iconPx);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -96,12 +96,8 @@ void ItemLibraryView::modelAttached(Model *model)
|
||||
auto target = QmlDesignerPlugin::instance()->currentDesignDocument()->currentTarget();
|
||||
m_imageCacheData->cache.clean();
|
||||
|
||||
if (target) {
|
||||
auto clonedTarget = std::make_unique<ProjectExplorer::Target>(
|
||||
target->project(), target->kit()->clone(), ProjectExplorer::Target::_constructor_tag{});
|
||||
|
||||
m_imageCacheData->collector.setTarget(std::move(clonedTarget));
|
||||
}
|
||||
if (target)
|
||||
m_imageCacheData->collector.setTarget(target);
|
||||
|
||||
m_widget->clearSearchFilter();
|
||||
m_widget->setModel(model);
|
||||
|
||||
@@ -99,7 +99,7 @@ void ImageCacheCollector::start(Utils::SmallStringView name,
|
||||
|
||||
m_connectionManager.setCallback(std::move(captureCallback));
|
||||
|
||||
nodeInstanceView.setTarget(m_target.get());
|
||||
nodeInstanceView.setTarget(m_target.data());
|
||||
nodeInstanceView.setCrashCallback(abortCallback);
|
||||
model->setNodeInstanceView(&nodeInstanceView);
|
||||
|
||||
@@ -115,9 +115,9 @@ void ImageCacheCollector::start(Utils::SmallStringView name,
|
||||
abortCallback();
|
||||
}
|
||||
|
||||
void ImageCacheCollector::setTarget(std::unique_ptr<ProjectExplorer::Target> target)
|
||||
void ImageCacheCollector::setTarget(ProjectExplorer::Target *target)
|
||||
{
|
||||
m_target = std::move(target);
|
||||
m_target = target;
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "imagecachecollectorinterface.h"
|
||||
|
||||
#include <memory>
|
||||
#include <QPointer>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QTextDocument;
|
||||
@@ -57,11 +57,11 @@ public:
|
||||
CaptureCallback captureCallback,
|
||||
AbortCallback abortCallback) override;
|
||||
|
||||
void setTarget(std::unique_ptr<ProjectExplorer::Target> target);
|
||||
void setTarget(ProjectExplorer::Target *target);
|
||||
|
||||
private:
|
||||
ImageCacheConnectionManager &m_connectionManager;
|
||||
std::unique_ptr<ProjectExplorer::Target> m_target;
|
||||
QPointer<ProjectExplorer::Target> m_target;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -169,7 +169,7 @@ isEmpty(LLVM_VERSION) {
|
||||
LLVM_VERSION =
|
||||
} else {
|
||||
# CLANG-UPGRADE-CHECK: Remove suppression if this warning is resolved.
|
||||
gcc {
|
||||
gcc:!clang: {
|
||||
# GCC6 shows full version (6.4.0), while GCC7 and up show only major version (8)
|
||||
GCC_VERSION = $$system("$$QMAKE_CXX -dumpversion")
|
||||
GCC_MAJOR_VERSION = $$section(GCC_VERSION, ., 0, 0)
|
||||
|
||||
@@ -1050,7 +1050,8 @@ public:
|
||||
{
|
||||
this->operator+(CoreProfile());
|
||||
profileExtra +=
|
||||
" QT += xml\n";
|
||||
"greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat\n"
|
||||
"else: QT += xml\n";
|
||||
|
||||
cmakelistsExtra +=
|
||||
"find_package(Qt5 COMPONENTS Core Xml REQUIRED)\n"
|
||||
@@ -2276,14 +2277,18 @@ void tst_Dumpers::dumper_data()
|
||||
+ Check("d1.(ISO)", "\"1980-01-01\"", "@QString") % NeedsInferiorCall
|
||||
+ Check("d1.toString", "\"Tue Jan 1 1980\"", "@QString") % NeedsInferiorCall
|
||||
+ CheckType("d1.(Locale)", "@QString") % NeedsInferiorCall
|
||||
% QtVersion(0, 0x5ffff) // Gone in Qt6
|
||||
+ CheckType("d1.(SystemLocale)", "@QString") % NeedsInferiorCall
|
||||
% QtVersion(0, 0x5ffff) // Gone in Qt6
|
||||
|
||||
+ Check("t0", "(invalid)", "@QTime")
|
||||
+ Check("t1", "13:15:32", "@QTime")
|
||||
+ Check("t1.(ISO)", "\"13:15:32\"", "@QString") % NeedsInferiorCall
|
||||
+ Check("t1.toString", "\"13:15:32\"", "@QString") % NeedsInferiorCall
|
||||
+ CheckType("t1.(Locale)", "@QString") % NeedsInferiorCall
|
||||
% QtVersion(0, 0x5ffff) // Gone in Qt6
|
||||
+ CheckType("t1.(SystemLocale)", "@QString") % NeedsInferiorCall
|
||||
% QtVersion(0, 0x5ffff) // Gone in Qt6
|
||||
|
||||
+ Check("dt0", "(invalid)", "@QDateTime")
|
||||
+ Check("dt1", Value4("Tue Jan 1 13:15:32 1980"), "@QDateTime")
|
||||
@@ -2291,7 +2296,9 @@ void tst_Dumpers::dumper_data()
|
||||
+ Check("dt1.(ISO)",
|
||||
"\"1980-01-01T13:15:32Z\"", "@QString") % NeedsInferiorCall
|
||||
+ CheckType("dt1.(Locale)", "@QString") % NeedsInferiorCall
|
||||
% QtVersion(0, 0x5ffff) // Gone in Qt6
|
||||
+ CheckType("dt1.(SystemLocale)", "@QString") % NeedsInferiorCall
|
||||
% QtVersion(0, 0x5ffff) // Gone in Qt6
|
||||
+ Check("dt1.toString",
|
||||
Value4("\"Tue Jan 1 13:15:32 1980\""), "@QString") % NeedsInferiorCall
|
||||
+ Check("dt1.toString",
|
||||
|
||||