DebugClients/Python/DebugClientBase.py

changeset 5
fa319c01b604
parent 0
de9c2efb9d02
child 7
c679fb30c8f3
equal deleted inserted replaced
4:ed9829a5fe55 5:fa319c01b604
1431 variable entry is a tuple of three elements, the variable name, 1431 variable entry is a tuple of three elements, the variable name,
1432 its type and value. 1432 its type and value.
1433 """ 1433 """
1434 qttype = vtype.split('.')[-1] 1434 qttype = vtype.split('.')[-1]
1435 varlist = [] 1435 varlist = []
1436 if qttype == 'QString': 1436 if qttype == 'QChar':
1437 varlist.append(("", "QString", "%s" % unicode(value)))
1438 elif qttype == 'QStringList':
1439 for s in value:
1440 varlist.append(("", "QString", "%s" % unicode(s)))
1441 elif qttype == 'QChar':
1442 varlist.append(("", "QChar", "%s" % unichr(value.unicode()))) 1437 varlist.append(("", "QChar", "%s" % unichr(value.unicode())))
1443 varlist.append(("", "int", "%d" % value.unicode())) 1438 varlist.append(("", "int", "%d" % value.unicode()))
1444 elif qttype == 'QPoint': 1439 elif qttype == 'QPoint':
1445 varlist.append(("x", "int", "%d" % value.x())) 1440 varlist.append(("x", "int", "%d" % value.x()))
1446 varlist.append(("y", "int", "%d" % value.y())) 1441 varlist.append(("y", "int", "%d" % value.y()))
1462 varlist.append(("height", "int", "%d" % value.height())) 1457 varlist.append(("height", "int", "%d" % value.height()))
1463 elif qttype == 'QSizeF': 1458 elif qttype == 'QSizeF':
1464 varlist.append(("width", "float", "%g" % value.width())) 1459 varlist.append(("width", "float", "%g" % value.width()))
1465 varlist.append(("height", "float", "%g" % value.height())) 1460 varlist.append(("height", "float", "%g" % value.height()))
1466 elif qttype == 'QColor': 1461 elif qttype == 'QColor':
1467 varlist.append(("name", "QString", "%s" % value.name())) 1462 varlist.append(("name", "str", "%s" % value.name()))
1468 r, g, b, a = value.getRgb() 1463 r, g, b, a = value.getRgb()
1469 varlist.append(("rgb", "int", "%d, %d, %d, %d" % (r, g, b, a))) 1464 varlist.append(("rgb", "int", "%d, %d, %d, %d" % (r, g, b, a)))
1470 h, s, v, a = value.getHsv() 1465 h, s, v, a = value.getHsv()
1471 varlist.append(("hsv", "int", "%d, %d, %d, %d" % (h, s, v, a))) 1466 varlist.append(("hsv", "int", "%d, %d, %d, %d" % (h, s, v, a)))
1472 c, m, y, k, a = value.getCmyk() 1467 c, m, y, k, a = value.getCmyk()
1476 elif qttype == 'QTime': 1471 elif qttype == 'QTime':
1477 varlist.append(("", "QTime", "%s" % unicode(value.toString()))) 1472 varlist.append(("", "QTime", "%s" % unicode(value.toString())))
1478 elif qttype == 'QDateTime': 1473 elif qttype == 'QDateTime':
1479 varlist.append(("", "QDateTime", "%s" % unicode(value.toString()))) 1474 varlist.append(("", "QDateTime", "%s" % unicode(value.toString())))
1480 elif qttype == 'QDir': 1475 elif qttype == 'QDir':
1481 varlist.append(("path", "QString", "%s" % unicode(value.path()))) 1476 varlist.append(("path", "str", "%s" % unicode(value.path())))
1482 varlist.append(("absolutePath", "QString", "%s" % \ 1477 varlist.append(("absolutePath", "str", "%s" % \
1483 unicode(value.absolutePath()))) 1478 unicode(value.absolutePath())))
1484 varlist.append(("canonicalPath", "QString", "%s" % \ 1479 varlist.append(("canonicalPath", "str", "%s" % \
1485 unicode(value.canonicalPath()))) 1480 unicode(value.canonicalPath())))
1486 elif qttype == 'QFile': 1481 elif qttype == 'QFile':
1487 varlist.append(("fileName", "QString", "%s" % unicode(value.fileName()))) 1482 varlist.append(("fileName", "str", "%s" % unicode(value.fileName())))
1488 elif qttype == 'QFont': 1483 elif qttype == 'QFont':
1489 varlist.append(("family", "QString", "%s" % unicode(value.family()))) 1484 varlist.append(("family", "str", "%s" % unicode(value.family())))
1490 varlist.append(("pointSize", "int", "%d" % value.pointSize())) 1485 varlist.append(("pointSize", "int", "%d" % value.pointSize()))
1491 varlist.append(("weight", "int", "%d" % value.weight())) 1486 varlist.append(("weight", "int", "%d" % value.weight()))
1492 varlist.append(("bold", "bool", "%s" % value.bold())) 1487 varlist.append(("bold", "bool", "%s" % value.bold()))
1493 varlist.append(("italic", "bool", "%s" % value.italic())) 1488 varlist.append(("italic", "bool", "%s" % value.italic()))
1494 elif qttype == 'QUrl': 1489 elif qttype == 'QUrl':
1495 varlist.append(("url", "QString", "%s" % unicode(value.toString()))) 1490 varlist.append(("url", "str", "%s" % unicode(value.toString())))
1496 varlist.append(("scheme", "QString", "%s" % unicode(value.scheme()))) 1491 varlist.append(("scheme", "str", "%s" % unicode(value.scheme())))
1497 varlist.append(("user", "QString", "%s" % unicode(value.userName()))) 1492 varlist.append(("user", "str", "%s" % unicode(value.userName())))
1498 varlist.append(("password", "QString", "%s" % unicode(value.password()))) 1493 varlist.append(("password", "str", "%s" % unicode(value.password())))
1499 varlist.append(("host", "QString", "%s" % unicode(value.host()))) 1494 varlist.append(("host", "str", "%s" % unicode(value.host())))
1500 varlist.append(("port", "int", "%d" % value.port())) 1495 varlist.append(("port", "int", "%d" % value.port()))
1501 varlist.append(("path", "QString", "%s" % unicode(value.path()))) 1496 varlist.append(("path", "str", "%s" % unicode(value.path())))
1502 elif qttype == 'QModelIndex': 1497 elif qttype == 'QModelIndex':
1503 varlist.append(("valid", "bool", "%s" % value.isValid())) 1498 varlist.append(("valid", "bool", "%s" % value.isValid()))
1504 if value.isValid(): 1499 if value.isValid():
1505 varlist.append(("row", "int", "%s" % value.row())) 1500 varlist.append(("row", "int", "%s" % value.row()))
1506 varlist.append(("column", "int", "%s" % value.column())) 1501 varlist.append(("column", "int", "%s" % value.column()))
1507 varlist.append(("internalId", "int", "%s" % value.internalId())) 1502 varlist.append(("internalId", "int", "%s" % value.internalId()))
1508 varlist.append(("internalPointer", "void *", "%s" % \ 1503 varlist.append(("internalPointer", "void *", "%s" % \
1509 value.internalPointer())) 1504 value.internalPointer()))
1510 elif qttype == 'QRegExp': 1505 elif qttype == 'QRegExp':
1511 varlist.append(("pattern", "QString", "%s" % unicode(value.pattern()))) 1506 varlist.append(("pattern", "str", "%s" % unicode(value.pattern())))
1512 1507
1513 # GUI stuff 1508 # GUI stuff
1514 elif qttype == 'QAction': 1509 elif qttype == 'QAction':
1515 varlist.append(("name", "QString", "%s" % unicode(value.objectName()))) 1510 varlist.append(("name", "str", "%s" % unicode(value.objectName())))
1516 varlist.append(("text", "QString", "%s" % unicode(value.text()))) 1511 varlist.append(("text", "str", "%s" % unicode(value.text())))
1517 varlist.append(("icon text", "QString", "%s" % unicode(value.iconText()))) 1512 varlist.append(("icon text", "str", "%s" % unicode(value.iconText())))
1518 varlist.append(("tooltip", "QString", "%s" % unicode(value.toolTip()))) 1513 varlist.append(("tooltip", "str", "%s" % unicode(value.toolTip())))
1519 varlist.append(("whatsthis", "QString", "%s" % unicode(value.whatsThis()))) 1514 varlist.append(("whatsthis", "str", "%s" % unicode(value.whatsThis())))
1520 varlist.append(("shortcut", "QString", "%s" % \ 1515 varlist.append(("shortcut", "str", "%s" % \
1521 unicode(value.shortcut().toString()))) 1516 unicode(value.shortcut().toString())))
1522 elif qttype == 'QKeySequence': 1517 elif qttype == 'QKeySequence':
1523 varlist.append(("value", "", "%s" % unicode(value.toString()))) 1518 varlist.append(("value", "", "%s" % unicode(value.toString())))
1524 1519
1525 # XML stuff 1520 # XML stuff
1526 elif qttype == 'QDomAttr': 1521 elif qttype == 'QDomAttr':
1527 varlist.append(("name", "QString", "%s" % unicode(value.name()))) 1522 varlist.append(("name", "str", "%s" % unicode(value.name())))
1528 varlist.append(("value", "QString", "%s" % unicode(value.value()))) 1523 varlist.append(("value", "str", "%s" % unicode(value.value())))
1529 elif qttype == 'QDomCharacterData': 1524 elif qttype == 'QDomCharacterData':
1530 varlist.append(("data", "QString", "%s" % unicode(value.data()))) 1525 varlist.append(("data", "str", "%s" % unicode(value.data())))
1531 elif qttype == 'QDomComment': 1526 elif qttype == 'QDomComment':
1532 varlist.append(("data", "QString", "%s" % unicode(value.data()))) 1527 varlist.append(("data", "str", "%s" % unicode(value.data())))
1533 elif qttype == "QDomDocument": 1528 elif qttype == "QDomDocument":
1534 varlist.append(("text", "QString", "%s" % unicode(value.toString()))) 1529 varlist.append(("text", "str", "%s" % unicode(value.toString())))
1535 elif qttype == 'QDomElement': 1530 elif qttype == 'QDomElement':
1536 varlist.append(("tagName", "QString", "%s" % unicode(value.tagName()))) 1531 varlist.append(("tagName", "str", "%s" % unicode(value.tagName())))
1537 varlist.append(("text", "QString", "%s" % unicode(value.text()))) 1532 varlist.append(("text", "str", "%s" % unicode(value.text())))
1538 elif qttype == 'QDomText': 1533 elif qttype == 'QDomText':
1539 varlist.append(("data", "QString", "%s" % unicode(value.data()))) 1534 varlist.append(("data", "str", "%s" % unicode(value.data())))
1540 1535
1541 # Networking stuff 1536 # Networking stuff
1542 elif qttype == 'QHostAddress': 1537 elif qttype == 'QHostAddress':
1543 varlist.append(("address", "QHostAddress", "%s" % unicode(value.toString()))) 1538 varlist.append(("address", "QHostAddress", "%s" % unicode(value.toString())))
1544 1539

eric ide

mercurial