def set_editable(self): if self.edit_widget is None: self.edit_widget = MultiObjectEditWidget(self.treeitem.tree) self.edit_widget.set_value(self.data_value) screen_size = get_screen_size() self.edit_widget.move((screen_size.width() - self.edit_widget.width()) / 2, (screen_size.height() - self.edit_widget.height()) / 2) self.edit_widget.show()
def set_editable(self): if self.thumbnailEdit is None: self.thumbnailEdit = ImageUploadEdit(parent=self) self.thumbnailEdit.applyClicked.connect(self.upload_thumbnail) self.thumbnailEdit.show() screen_size = get_screen_size() self.thumbnailEdit.move( (screen_size.width() - self.thumbnailEdit.width()) / 2, (screen_size.height() - self.thumbnailEdit.height()) / 2) # print self.data_value if self.data_value is not None: self.thumbnailEdit.set_image(self.data_value.host_path) else: pass
def set_editable(self): if self.timeDeltaWidget is None: self.timeDeltaWidget = TimedeltaWidget(self.treeitem.tree) self.timeDeltaWidget.editFinish.connect(self.edit_finished) globalPos = QCursor().pos() - self.mapFromGlobal(QCursor().pos()) screen_height = get_screen_size().height() if globalPos.y() + self.height() + self.timeDeltaWidget.height( ) < screen_height: self.timeDeltaWidget.move(globalPos.x(), globalPos.y() + self.height()) else: self.timeDeltaWidget.move( globalPos.x(), screen_height - self.timeDeltaWidget.height()) self.timeDeltaWidget.setVisible(True) if self.data_value is not None: self.timeDeltaWidget.set_time(self.data_value)
def set_editable(self): if self.calendarClock is None: self.calendarClock = CalendarClock(self.treeitem.tree) self.calendarClock.chooseTime.connect(self.edit_finished) globalPos = QCursor().pos() - self.mapFromGlobal(QCursor().pos()) # print globalPos screen_height = get_screen_size().height() if globalPos.y() + self.height() + self.calendarClock.height( ) < screen_height: self.calendarClock.move(globalPos.x(), globalPos.y() + self.height()) else: self.calendarClock.move( globalPos.x(), screen_height - self.calendarClock.height()) self.calendarClock.setVisible(True) if self.data_value is not None: self.calendarClock.set_time(self.data_value)
def set_editable(self): if self.colorEdit is None: self.colorEdit = ColorWheelWindow() self.colorEdit.applyColor.connect(self.edit_finished) globalPos = QCursor().pos() - self.mapFromGlobal(QCursor().pos()) screen_height = get_screen_size().height() if globalPos.y() + self.height() + self.colorEdit.height( ) < screen_height: self.colorEdit.move(globalPos.x(), globalPos.y() + self.height()) else: self.colorEdit.move(globalPos.x(), screen_height - self.colorEdit.height()) self.colorEdit.setVisible(True) # print self.data_value if self.data_value is not None: self.colorEdit.set_color(self.data_value) else: self.colorEdit.set_color(QColor(255, 255, 255, 255))
def set_editable(self): if self.calendar is None: self.calendar = Calendar(self.treeitem.tree) self.calendar.clicked.connect(self.edit_finished) globalPos = QCursor().pos() - self.mapFromGlobal(QCursor().pos()) screen_height = get_screen_size().height() if globalPos.y() + self.height() + self.calendar.height( ) < screen_height: self.calendar.move(globalPos.x(), globalPos.y() + self.height()) else: self.calendar.move(globalPos.x(), screen_height - self.calendar.height()) self.calendar.setVisible(True) if self.data_value is not None: self.calendar.clicked.disconnect(self.edit_finished) self.calendar.setSelectedDate( QDate(self.data_value.year, self.data_value.month, self.data_value.day)) self.calendar.clicked.connect(self.edit_finished)