Debugger: Adapt QDate{,Time} dumper and test to Qt6

Essentially removing the parts that are gone in Qt6

Task-number: QTCREATORBUG-24098
Change-Id: I49f7ed8ea8e568803850bd4a0118b690248013af
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2020-11-25 09:34:40 +01:00
parent 1f75893eba
commit 35c2d51ec9
2 changed files with 26 additions and 18 deletions

View File

@@ -270,23 +270,24 @@ def qdump__QStandardItem(d, value):
def qdump__QDate(d, value):
jd = value.pointer()
if jd:
d.putValue(jd, 'juliandate')
d.putExpandable()
if d.isExpanded():
with Children(d):
if d.canCallLocale():
d.putCallItem('toString', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'TextDate'))
d.putCallItem('(ISO)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'ISODate'))
if not jd:
d.putValue('(invalid)')
return
d.putValue(jd, 'juliandate')
d.putExpandable()
if d.isExpanded():
with Children(d):
if d.canCallLocale():
d.putCallItem('toString', '@QString', value, 'toString',
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)')
d.putFields(value)
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',
@@ -419,10 +420,11 @@ def qdump__QDateTime(d, value):
d.enumExpression('DateFormat', 'ISODate'))
d.putCallItem('toUTC', '@QDateTime', value, 'toTimeSpec',
d.enumExpression('TimeSpec', 'UTC'))
d.putCallItem('(SystemLocale)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'SystemLocaleDate'))
d.putCallItem('(Locale)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'LocaleDate'))
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.putCallItem('toLocalTime', '@QDateTime', value, 'toTimeSpec',
d.enumExpression('TimeSpec', 'LocalTime'))
d.putFields(value)

View File

@@ -2276,14 +2276,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 +2295,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",