def __init__(self, parent): super(XLogRecordView, self).__init__(parent) # define custom properties self._logger = XLogRecordWidget(self) layout = QtGui.QHBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self._logger) self.setLayout(layout)
def __init__(self, parent): super(XScriptView, self).__init__(parent) # define custom properties self._edit = XCodeEdit(self) self._edit.setLanguage('Python') layout = QtGui.QHBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self._edit) self.setLayout(layout)
def __init__(self, parent): super(XConsoleView, self).__init__(parent) # define custom properties self._console = XConsoleEdit(self) layout = QtGui.QHBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self._console) self.setLayout(layout) self.initialized.connect(self.setupConsole)
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())