Esempio n. 1
0
 def init_date(self):
     """will initialize the master date using today's date"""
     now = datetime.datetime.now()
     day = now.day
     month = now.month
     year = now.year
     today = QtCore.QDate(year, month, day)
     self.master_date_value = today
     self.ui.master_date.setDate(today)
Esempio n. 2
0
    def makeWidget(self):
        opts = self.param.opts
        w = QtWidgets.QDateEdit(QtCore.QDate(QtCore.QDate.currentDate()))
        w.setCalendarPopup(True)
        if 'format' not in opts:
            opts['format'] = 'dd/MM/yyyy'
        w.setDisplayFormat(opts['format'])

        w.sigChanged = w.dateChanged
        w.value = w.date
        w.setValue = w.setDate
        return w
Esempio n. 3
0
 def _interpretValue(self, v):
     return QtCore.QDate(v)
Esempio n. 4
0
authorized_classes = [sip._unpickle_type]
objects = {
    "QtWidgets": {
        "QWidget": QtWidgets.QWidget(),
        "QCheckBox": QtWidgets.QCheckBox(checked=True),
        "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),