コード例 #1
0
    def __init__(self, parent=None):
        super(XOverlayWizardPage, self).__init__(parent)

        self.setFrameShape(QtGui.QFrame.Box)

        # define custom properties
        self._commitPage = False
        self._finalPage = False
        self._retryEnabled = False
        self._nextId = None

        # create the title information
        font = self.font()
        font.setBold(True)
        base_size = font.pointSize()
        font.setPointSize(base_size + 4)

        # set the palette coloring
        pal = self.palette()
        pal.setColor(pal.WindowText, QtGui.QColor('white'))
        self.setPalette(pal)

        # create the title labels
        self._titleLabel = QtGui.QLabel('', self)
        self._titleLabel.setFont(font)
        self._titleLabel.setPalette(pal)
        font.setPointSize(base_size + 2)
        self._subTitleLabel = QtGui.QLabel('', self)
        self._subTitleLabel.setPalette(pal)

        self.adjustMargins()
コード例 #2
0
ファイル: xtimeedit.py プロジェクト: tafify/projexui
    def __init__(self, parent=None):
        super(XTimeEdit, self).__init__(parent)

        # define custom properties
        self._editable = False
        self._showSeconds = False
        self._showMinutes = True
        self._showHours = True
        self._militaryTime = False

        # define the ui
        self._hourCombo = QtGui.QComboBox(self)
        self._hourSeparator = QtGui.QLabel(':', self)
        self._minuteCombo = QtGui.QComboBox(self)
        self._minuteSeparator = QtGui.QLabel(':', self)
        self._secondCombo = QtGui.QComboBox(self)
        self._timeOfDayCombo = QtGui.QComboBox(self)

        self._secondCombo.hide()
        self._minuteSeparator.hide()

        # define default UI settings
        self._hourCombo.addItems(['{0}'.format(i + 1) for i in xrange(12)])
        self._minuteCombo.addItems(
            ['{0:02d}'.format(i) for i in xrange(0, 60, 5)])
        self._secondCombo.addItems(
            ['{0:02d}'.format(i) for i in xrange(0, 60, 5)])
        self._timeOfDayCombo.addItems(['am', 'pm'])

        # setup combo properties
        for combo in (self._hourCombo, self._minuteCombo, self._secondCombo,
                      self._timeOfDayCombo):
            combo.setInsertPolicy(combo.NoInsert)
            combo.setSizePolicy(QtGui.QSizePolicy.Expanding,
                                QtGui.QSizePolicy.Expanding)

        # layout the widgets
        h_layout = QtGui.QHBoxLayout()
        h_layout.setContentsMargins(0, 0, 0, 0)
        h_layout.setSpacing(0)
        h_layout.addWidget(self._hourCombo)
        h_layout.addWidget(self._hourSeparator)
        h_layout.addWidget(self._minuteCombo)
        h_layout.addWidget(self._minuteSeparator)
        h_layout.addWidget(self._secondCombo)
        h_layout.addWidget(self._timeOfDayCombo)

        self.setLayout(h_layout)

        # assign the default time
        self.setTime(QtCore.QDateTime.currentDateTime().time())
コード例 #3
0
ファイル: xloaderitem.py プロジェクト: zengjunfeng/projexui
 def startLoading(self):
     """
     Updates this item to mark the item as loading.  This will create
     a QLabel with the loading ajax spinner to indicate that progress
     is occurring.
     """
     if self._loading:
         return False
     
     tree = self.treeWidget()
     if not tree:
         return
     
     self._loading = True
     self.setText(0, '')
     
     # create the label for this item
     lbl = QtGui.QLabel(self.treeWidget())
     lbl.setMovie(XLoaderWidget.getMovie())
     lbl.setAlignment(QtCore.Qt.AlignCenter)
     tree.setItemWidget(self, 0, lbl)
     
     try:
         tree.loadStarted.emit(self)
     except AttributeError:
         pass
     
     return True
コード例 #4
0
 def setHtml(self, column, html):
     """
     Creates a label with the given HTML for this item and column.  This
     method requires the item to be a part of the tree.
     
     :param      column | <int>
                 html   | <unicode>
     
     :return     <bool> | success
     """
     tree = self.treeWidget()
     if not tree:
         return False
     
     lbl = tree.itemWidget(self, column)
     if not html and lbl:
         lbl.deleteLater()
         return True
     
     elif not lbl:
         lbl = QtGui.QLabel(tree)
         lbl.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction)
         lbl.setOpenExternalLinks(True)
         tree.setItemWidget(self, column, lbl)
     
     lbl.setText(html)
     return True