当前位置: 首页>>代码示例>>Python>>正文


Python QDateEdit.setMinimumDate方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QDateEdit.setMinimumDate方法的典型用法代码示例。如果您正苦于以下问题:Python QDateEdit.setMinimumDate方法的具体用法?Python QDateEdit.setMinimumDate怎么用?Python QDateEdit.setMinimumDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui.QDateEdit的用法示例。


在下文中一共展示了QDateEdit.setMinimumDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_dateedit

# 需要导入模块: from PyQt4.QtGui import QDateEdit [as 别名]
# 或者: from PyQt4.QtGui.QDateEdit import setMinimumDate [as 别名]
 def create_dateedit(self, text, option, tip=None):
     label = QLabel(text)
     dateedit = QDateEdit()
     dateedit.setDisplayFormat('dd MMM yyyy')
     dateedit.setMaximumDate(QDate(2010,12,31))
     dateedit.setMinimumDate(QDate(2002,01,01))
     if tip is not None: dateedit.setToolTip(tip)
     self.dateedits[dateedit] = option
     layout = QHBoxLayout()
     for subwidget in (label, dateedit):
         layout.addWidget(subwidget)
     layout.addStretch(1)
     layout.setContentsMargins(0, 0, 0, 0)
     widget = QWidget(self)
     widget.setLayout(layout)
     return widget
开发者ID:sarahdi,项目名称:openfisca,代码行数:18,代码来源:Config.py

示例2: DlgCredito

# 需要导入模块: from PyQt4.QtGui import QDateEdit [as 别名]
# 或者: from PyQt4.QtGui.QDateEdit import setMinimumDate [as 别名]
class DlgCredito( QDialog ):
    def __init__( self, parent = None ):
        super( DlgCredito, self ).__init__( parent )

        self.dtFechaTope = QDateEdit( QDate.currentDate().addDays( 1 ) )
        self.dtFechaTope.setMinimumDate( QDate.currentDate().addDays( 1 ) )
        """
        @ivar: Este widget tiene la fecha tope en la que puede 
            pagarse el credito
        @type: QDateEdit
        """
        self.sbTaxRate = QDoubleSpinBox()
        """
        @ivar: Este widget contiene la tasa de multa que se
            le aplicara a este credito
        @typ: QDoubleSpinBox
        """

        self.setupUi()

    def setupUi( self ):
        vertical_layout = QVBoxLayout( self )

        form_layout = QFormLayout()

        self.dtFechaTope.setCalendarPopup( True )
        self.sbTaxRate.setSuffix( '%' )

        form_layout.addRow( u"<b>Fecha Tope</b>", self.dtFechaTope )
        form_layout.addRow( u"<b>Tasa de multa</b>", self.sbTaxRate )

        buttonbox = QDialogButtonBox( QDialogButtonBox.Ok |
                                      QDialogButtonBox.Cancel )

        vertical_layout.addLayout( form_layout )
        vertical_layout.addWidget( buttonbox )

        buttonbox.accepted.connect( self.accept )
        buttonbox.rejected.connect( self.reject )
开发者ID:armonge,项目名称:EsquipulasPy,代码行数:41,代码来源:factura.py

示例3: QtDateSelector

# 需要导入模块: from PyQt4.QtGui import QDateEdit [as 别名]
# 或者: from PyQt4.QtGui.QDateEdit import setMinimumDate [as 别名]
class QtDateSelector(QtBoundedDate, ProxyDateSelector):
    """ A Qt implementation of an Enaml ProxyDateSelector.

    """

    #: A reference to the widget created by the proxy.
    widget = Typed(QDateEdit)

    # --------------------------------------------------------------------------
    # Initialization API
    # --------------------------------------------------------------------------
    def create_widget(self):
        """ Create the QDateEdit widget.

        """
        self.widget = QDateEdit(self.parent_widget())

    def init_widget(self):
        """ Initialize the widget.

        """
        super(QtDateSelector, self).init_widget()
        d = self.declaration
        self.set_date_format(d.date_format)
        self.set_calendar_popup(d.calendar_popup)
        self.widget.dateChanged.connect(self.on_date_changed)

    # --------------------------------------------------------------------------
    # Abstract API Implementation
    # --------------------------------------------------------------------------
    def get_date(self):
        """ Return the current date in the control.

        Returns
        -------
        result : date
            The current control date as a date object.

        """
        return self.widget.date().toPyDate()

    def set_minimum(self, date):
        """ Set the widget's minimum date.

        Parameters
        ----------
        date : date
            The date object to use for setting the minimum date.

        """
        self.widget.setMinimumDate(date)

    def set_maximum(self, date):
        """ Set the widget's maximum date.

        Parameters
        ----------
        date : date
            The date object to use for setting the maximum date.

        """
        self.widget.setMaximumDate(date)

    def set_date(self, date):
        """ Set the widget's current date.

        Parameters
        ----------
        date : date
            The date object to use for setting the date.

        """
        self._guard |= CHANGED_GUARD
        try:
            self.widget.setDate(date)
        finally:
            self._guard &= ~CHANGED_GUARD

    def set_date_format(self, format):
        """ Set the widget's date format.

        Parameters
        ----------
        format : str
            A Python time formatting string.

        """
        # XXX make sure Python's and Qt's format strings are the
        # same, or convert between the two.
        self.widget.setDisplayFormat(format)

    def set_calendar_popup(self, popup):
        """ Set whether a calendar popup is available on the widget.

        Parameters
        ----------
        popup : bool
            Whether the calendar popup is enabled.

        """
#.........这里部分代码省略.........
开发者ID:ContinuumIO,项目名称:enaml,代码行数:103,代码来源:qt_date_selector.py


注:本文中的PyQt4.QtGui.QDateEdit.setMinimumDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。