def on_visualButton_clicked(self, checked): """ Private slot to select the position visually. @param checked state of the button (boolean) """ if checked: from UI.NotificationWidget import NotificationWidget self.__notification = NotificationWidget(parent=self, setPosition=True) self.__notification.setPixmap( UI.PixmapCache.getPixmap("notification48.png")) self.__notification.setHeading(self.tr("Visual Selection")) self.__notification.setText( self.tr("Drag the notification window to" " the desired place and release the button.")) self.__notification.move( QPoint(self.xSpinBox.value(), self.ySpinBox.value())) self.__notification.show() else: # retrieve the position point = self.__notification.frameGeometry().topLeft() self.xSpinBox.setValue(point.x()) self.ySpinBox.setValue(point.y()) self.__notification.close() self.__notification = None