Exemplo n.º 1
0
 def serializejson_QWidget(self):
     parent = self.parent()
     if parent is not None:
         init = {"parent": parent}
     else:
         init = tuple()
     remove = ["parent", "cursor"]
     if self.layout() is None:
         remove.append("layout")
     return (
         type_str(self),
         init,
         getstate(
             self,
             split_dict_slots=False,
             keep=None,
             add=None,
             remove=remove,
             filter_=True,
             properties=True,
             getters=True,
             sort_keys=True,
             remove_default_values=False,
         ),
     )
Exemplo n.º 2
0
 def serializejson_positionnal_parent(self):
     return (
         type_str(self),
         (self.parent(), ),
         getstate(
             self,
             split_dict_slots=False,
             keep=None,
             add=None,
             remove=["parent"],
             filter_=True,
             properties=True,
             getters=True,
             sort_keys=True,
             remove_default_values=False,
         ),
     )
Exemplo n.º 3
0
 def serializejson_QCursor(self):
     return (
         type_str(self),
         tuple(),
         getstate(
             self,
             split_dict_slots=False,
             keep=None,
             add=None,
             remove=None,
             filter_=True,
             properties=True,
             getters=True,
             sort_keys=True,
             remove_default_values=False,
         ),
     )
Exemplo n.º 4
0
 def serializejson_QFont(self):
     return (
         type_str(self),
         tuple(),
         getstate(
             self,
             split_dict_slots=False,
             keep=None,
             add=None,
             remove=None,
             filter_=True,
             properties=True,
             getters=True,
             extra_getters={"letterSpacingType": "letterSpacingType"},
             sort_keys=True,
             remove_default_values=False,
         ),
     )
Exemplo n.º 5
0
 def serializejson_QLayout(self):
     widgets = []
     for i in range(self.count()):
         widgets.append(self.itemAt(i).widget())
     state = getstate(
         self,
         split_dict_slots=False,
         keep=None,
         add=None,
         remove=["parent"],
         filter_=True,
         properties=True,
         getters=True,
         sort_keys=True,
         remove_default_values=False,
     )
     state["widgets"] = widgets
     return type_str(self), (self.parent(), ), state
Exemplo n.º 6
0
 def serializejson_QCheckBox(self):
     return (
         type_str(self),
         {
             "parent": self.parent()
         },
         getstate(
             self,
             split_dict_slots=False,
             keep=None,
             add=None,
             remove=["parent", "cursor", "windowFlags"],
             filter_=True,
             properties=True,
             getters=True,
             sort_keys=True,
             remove_default_values=False,
         ),
     )  # ["checked"])
Exemplo n.º 7
0
 def serializejson_QCoreApplication(self):
     remove = ["parent", "eventDispatcher"]
     if self.overrideCursor() is None:
         remove.append("overrideCursor")
     return (
         type_str(self),
         (sys.argv, ),
         getstate(
             self,
             split_dict_slots=False,
             keep=None,
             add=None,
             remove=remove,
             filter_=True,
             properties=True,
             getters=True,
             sort_keys=True,
             remove_default_values=False,
         ),
     )
Exemplo n.º 8
0
 def serializejson_QPen(self):
     # ne sauvegarde pas le brush si n'apporte rien de plus que la couleure
     brush = self.brush()
     if brush.style() == 1 and not brush.texture().size().width(
     ) and brush.transform() == QtGui.QTransform():
         remove = "brush"
     else:
         remove = None
     state = getstate(
         self,
         split_dict_slots=False,
         keep=None,
         add=None,
         remove=remove,
         filter_=True,
         properties=True,
         getters=True,
         sort_keys=True,
         remove_default_values=False,
     )
     return type_str(self), tuple(), state
Exemplo n.º 9
0
 def serializejson_QOBject(self):
     parent = self.parent()
     if parent is not None:
         init = {"parent": parent}
     else:
         init = tuple()
     return (
         type_str(self),
         init,
         getstate(
             self,
             split_dict_slots=False,
             keep=None,
             add=None,
             remove=["parent"],
             filter_=True,
             properties=True,
             getters=True,
             sort_keys=True,
             remove_default_values=False,
         ),
     )