Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Pretty printers for Qt 5.0.0

Pretty printers for Qt 5.0.0

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 845 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by
    #1

    Hi
    I developed a set of pretty printers for qt 4.8.3 that worked pretty well.
    When I come to use them with Qt 5.0.0 they are not working

    For example the printer for QVector looks like this
    @
    class QVectorPrinter:
    "Print a QVector"

    class _iterator:
        def __init__(self, nodetype, d, p):
            self.nodetype = nodetype
            self.d = d
            self.p = p
            self.count = 0
    
        def __iter__(self):
            return self
    
        def next(self):
            if self.count >= self.p['size']:
                raise StopIteration
            count = self.count
    
            self.count = self.count + 1
            return ('[%d]' % count, self.p['array'][count])
    
    def __init__(self, val, container):
        self.val = val
        self.container = container
        self.itype = self.val.type.template_argument(0)
    
    def children(self):
        return self._iterator(self.itype, self.val['d'], self.val['p'])
    
    def to_string(self):
        if self.val['d']['size'] == 0:
            empty = "empty "
        else:
            empty = ""
    
        return "%s%s<%s>" % ( empty, self.container, self.itype )
    

    @

    When I try to print the value of a vector it reports that there is no member called 'p'

    When I look at the source for QVector it has obviously changed from 4.8.3 but I cannot see how to print the values

    Can anyone give me some pointers on this?

    Thanks

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved