Exemple #1
0
 def getEdges(self, shape):
     x, y = shape.points[0].x(), shape.points[0].y()
     w, h = self.globalBounds.width(), self.globalBounds.height()
     x1 = QtCore.QPoint(0, y)
     x2 = QtCore.QPoint(w, y)
     y1 = QtCore.QPoint(x, 0)
     y2 = QtCore.QPoint(x, h)
     return [QtCore.QLine(x1, x2), QtCore.QLine(y1, y2)]
Exemple #2
0
 def calculateRackExitEdge(self):
     center = (self.points[0] + self.points[1]) / 2.0
     p1 = QtCore.QPoint(center.x(), center.y())
     p2 = QtCore.QPoint(center.x(), center.y())
     if self.orient == 0:
         p2.setY(self.points[1].y())
     elif self.orient == 1:
         p2.setX(self.points[1].x())
     elif self.orient == 2:
         p2.setY(self.points[0].y())
     elif self.orient == 3:
         p2.setX(self.points[0].x())
     self.lines = [QtCore.QLine(p1, p2)]
Exemple #3
0
     "QDoubleSpinBox": QtWidgets.QDoubleSpinBox(value=10.0),
     "QLineEdit": QtWidgets.QLineEdit("coucou"),
     "QPlainTextEdit": QtWidgets.QPlainTextEdit("coucou"),
     "QSpinBox": QtWidgets.QSpinBox(value=20),
     "QPushButton": QtWidgets.QPushButton(),
 },
 "PyQt_pickable": {
     "QByteArray": QtCore.QByteArray(bytes(range(256))),
     "QColor": QtGui.QColor(10, 20, 30, 40),
     ## "QChar": # n'a plus l'air d'exister dans PyQt5
     "QDate": QtCore.QDate(2020, 10, 31),
     "QDateTime": QtCore.QDateTime(2020, 10, 31, 20, 30),
     "QKeySequence": QtGui.QKeySequence(),
     ## "QLatin1Char": # n'a plus l'air d'exister dans PyQt5
     ## "QLatin1String"# n'a plus l'air d'exister dans PyQt5
     "QLine": QtCore.QLine(QtCore.QPoint(0, 1), QtCore.QPoint(2, 3)),
     "QLineF": QtCore.QLineF(QtCore.QPoint(0.0, 1.1), QtCore.QPoint(2.2, 3.3)),
     "QPen": QtGui.QPen(),
     "QBrush": QtGui.QBrush(),
     "QPoint": QtCore.QPoint(0, 1),
     "QPointF": QtCore.QPointF(0.0, 1.1),
     "QPolygon": QtGui.QPolygon([QtCore.QPoint(0, 1), QtCore.QPoint(2, 3)]),
     "QPolygonF": QtGui.QPolygonF([QtCore.QPoint(0.0, 1.1), QtCore.QPoint(2.2, 3.3)]),
     "QRect": QtCore.QRect(QtCore.QPoint(0, 1), QtCore.QPoint(2, 3)),
     "QRectF": QtCore.QRectF(QtCore.QPoint(0.0, 1.1), QtCore.QPoint(2.2, 3.3)),
     "QSize": QtCore.QSize(10, 20),
     "QSizeF": QtCore.QSizeF(10.5, 20.5),
     ## "QMatrix": # Support for the deprecated QMatrix class has been removed
     ## "QString": # n'a plus l'air d'exister dans PyQt5
     "QTime": QtCore.QTime(20, 30),
     "QTransform": QtGui.QTransform(),  # pas reducable dans documentation ?