Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Pretty printers for Qt 5.0.0

    General and Desktop
    1
    1
    676
    Loading More Posts
    • 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
      GrahamL last edited by

      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 Reply Quote 0
      • First post
        Last post