示例#1
0
    def CreateWidgets(self):
        self.nameLabel = QLabel("姓名:")
        self.birthdayLabel = QLabel("出生年月:")
        self.birthdayEditLabel = MyLabel("1900-01-01")
        self.birthdayEditLabel.setFrameStyle(QFrame.Panel|QFrame.Sunken)
        self.addressLabel = QLabel("地址:")
        self.deathdayLabel = QLabel("去世年月:")
        self.deathdayEditLabel = MyLabel("- - - ")
        self.deathdayEditLabel.setFrameStyle(QFrame.Panel|QFrame.Sunken)

        self.nameEdit = QLineEdit()
        self.addressEdit = QLineEdit()
        self.buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel,
            Qt.Horizontal, self)

        self.confirmButton = QPushButton("确定")
        self.cancelButton = QPushButton("取消")

        self.birthCalendar = QCalendarWidget()
        self.birthCalendar.setWindowTitle("出生年月")
        self.birthCalendar.setWindowIcon(QIcon("./icon/calendar1.png"))
        self.birthCalendar.hide()
        self.deathCalendar = QCalendarWidget()
        self.deathCalendar.setWindowTitle("去世年月")
        self.deathCalendar.setWindowIcon(QIcon("./icon/calendar2.png"))
        self.deathCalendar.hide()

        self.deadCheckBox = QCheckBox("去世")  # 默认未去世
        self.marryCheckBox = QCheckBox("结婚")
        self.marryCheckBox.toggle()  # 默认结婚
示例#2
0
 def addDialogRow(self, bl, title, val):
     bh = self.getDialogRow()
     bh.add_widget(MyLabel(text="%s:" % title))
     ti = TextInput(text=str(val), height=cm(1))
     bh.add_widget(ti)
     bl.add_widget(bh)
     return bl, ti
示例#3
0
 def addFriend(self, name, signature, pic_path):
     item_widget = QListWidgetItem()
     item_widget.setSizeHint(QSize(90, 65))
     self.list.addItem(item_widget)
     label = MyLabel(name, signature, pic_path)
     self.friendList[name] = label
     self.list.setItemWidget(item_widget, label)
示例#4
0
 def createUI(self):
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.nowTimeText = time.strftime(
         u'%H:%M:%S'.encode('utf-8')).decode('utf-8')
     self.ui.labelStartTime.setText(self.nowTimeText)
     self.ui.labelEndTime.setText('')
     self.ui.lineEditTimeCount.setFocus()
     self.msgLabel = MyLabel(u'<h1>时间到!</h1><img src=":/img/38.gif"/>')
     self.msgLabel.hide()
     self.msgLabel.setBuddy(self)
     self.ui.btnComplete.setDisabled(True)
     self.ui.btnDiscard.setDisabled(True)
示例#5
0
    def spawn_heide_console_window(self):
        self.active_window = Window.CONSOLE

        self.output_window = Toplevel()
        self.output_window.title("HEIDE Console")
        self.output_window.minsize(height=425, width=650)
        self.output_window.maxsize(height=425, width=650)

        self.output_window.protocol("WM_DELETE_WINDOW", self.close_console)

        # console window spawn location
        w = self.output_window.winfo_screenwidth()
        h = self.output_window.winfo_screenheight()
        output_wind_size = \
            tuple(int(_) for _ in
                  self.output_window.geometry().split('+')[0].split('x'))
        x = w / 2 - output_wind_size[0] / 2
        y = h / 2 - output_wind_size[1] / 2
        self.output_window.geometry("%dx%d+%d+%d" % (output_wind_size +
                                                     (x, y)))

        self.output_window.grab_set()

        text_frame = Frame(self.output_window, padx=20)
        text_frame.grid(row=0, column=0)

        Label(text_frame, text="Output").pack(anchor=W)

        self.output_text = ScrolledText(text_frame, height=23, width=85)
        self.output_text.pack()

        load_bar_frame = Frame(self.output_window, padx=20)
        load_bar_frame.grid(row=1, column=0)

        self.load_bar_label = MyLabel(load_bar_frame,
                                      "../imgs/loading_bar.gif")
        self.load_bar_label.pack()

        button_frame = Frame(self.output_window, padx=20)
        button_frame.grid(row=2, column=0)

        Button(button_frame, text="Close",
               command=self.close_console).grid(row=0, column=0)
        Button(button_frame,
               text="Save",
               command=self.heide.heide_save_console_output).grid(row=0,
                                                                  column=1)

        self.output_text.configure(state="disabled")

        self.output_window.update()
示例#6
0
    def addSettingsDialogPart(self, bl, inWConf=None):

        presetVals = []
        for s in self.defSettings:
            presetVals.append(s['name'])
        presetDef = presetVals[0]

        #bl = BoxLayout(orientation="vertical")
        bh = self.getDialogRow()
        bh.add_widget(MyLabel(text="Preset:"))
        self.spPreset = Spinner(text=presetDef,
                                values=presetVals,
                                height=cm(1))
        bh.add_widget(self.spPreset)
        bl.add_widget(bh)
        self.spPreset.bind(text=self.on_presetChange)

        if inWConf:
            self.spPreset.text = inWConf['atr']['name']

        bl, self.ti_title = self.addDialogRow(
            bl, "Title", "" if inWConf == None else inWConf['atr']['title'])
        bl, self.ti_min = self.addDialogRow(
            bl, "Min value",
            -175 if inWConf == None else str(inWConf['atr']['min']))
        bl, self.ti_max = self.addDialogRow(
            bl, "Max value",
            175 if inWConf == None else str(inWConf['atr']['max']))
        bl, self.ti_tick = self.addDialogRow(
            bl, "Tick", 25 if inWConf == None else str(inWConf['atr']['tick']))
        bl, self.ti_subtick = self.addDialogRow(
            bl, "Sub ticks",
            6 if inWConf == None else str(inWConf['atr']['subtick']))
        bl, self.ti_start_angle = self.addDialogRow(
            bl, "Start angle",
            -170 if inWConf == None else str(inWConf['atr']['start_angle']))
        bl, self.ti_end_angle = self.addDialogRow(
            bl, "End angle",
            170 if inWConf == None else str(inWConf['atr']['end_angle']))
        bl, self.ti_value_font_size = self.addDialogRow(
            bl, "Value size",
            23 if inWConf == None else str(inWConf['atr']['value_font_size']))
        bl, self.ti_label_font_size = self.addDialogRow(
            bl, "Labels size",
            50 if inWConf == None else str(inWConf['atr']['label_font_size']))

        return bl
示例#7
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(1081, 599)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/funcell.png")),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        Form.setWindowIcon(icon)
        Form.setStyleSheet(
            _fromUtf8(
                "QToolButton[objectName=\"closetoolButton\"] {\n"
                "border:0px;\n"
                "}\n"
                "QToolButton[objectName=\"closetoolButton\"]:hover {\n"
                "image:url(:/images/close_hover.png);\n"
                "}\n"
                "QToolButton[objectName=\"closetoolButton\"]:pressed {\n"
                "image:url(:/images/close_pressed.png);\n"
                "}\n"
                "\n"
                "QToolButton[objectName=\"closetoolButton_2\"] {\n"
                "border:0px;\n"
                "}\n"
                "QToolButton[objectName=\"closetoolButton_2\"]:hover {\n"
                "image:url(:/images/min_hover.png);\n"
                "}\n"
                "QToolButton[objectName=\"closetoolButton_2\"]:pressed {\n"
                "image:url(:/images/min_pressed.png);\n"
                "}\n"
                "\n"
                "QWidget[objectName=\"Form\"]{\n"
                "border-image:url(\":/images/funcell_bg.png\");\n"
                "}\n"
                "\n"
                "QToolButton[objectName=\"toolButton\"]{\n"
                "background-color: rgb(85, 255, 127);\n"
                "border-radius: 10px;\n"
                "}\n"
                "QLineEdit[objectName=\"lineEdit\"],QLineEdit[objectName=\"lineEdit_2\"]{\n"
                "border:0px;\n"
                "background-color:transparent;\n"
                "}\n"
                "QCheckBox[objectName=\"checkBox\"],QLabel[objectName=\"label_3\"],QLineEdit[objectName=\"lineEdit\"],QLineEdit[objectName=\"lineEdit_2\"]{\n"
                "font-family:\'微软雅黑\';\n"
                "color:white;\n"
                "}\n"
                "\n"
                "QLabel[objectName=\"label_4\"],QLabel[objectName=\"label_5\"]{\n"
                "font-family:\'微软雅黑\';\n"
                "color:red;\n"
                "}\n"
                ""))
        self.widget = QtGui.QWidget(Form)
        self.widget.setGeometry(QtCore.QRect(-1, -1, 1081, 601))
        self.widget.setObjectName(_fromUtf8("widget"))
        self.line_2 = QtGui.QFrame(self.widget)
        self.line_2.setGeometry(QtCore.QRect(320, 225, 420, 3))
        self.line_2.setFrameShape(QtGui.QFrame.HLine)
        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_2.setObjectName(_fromUtf8("line_2"))
        self.label = QtGui.QLabel(self.widget)
        self.label.setGeometry(QtCore.QRect(320, 182, 30, 30))
        self.label.setText(_fromUtf8(""))
        self.label.setPixmap(QtGui.QPixmap(_fromUtf8(":/images/use.png")))
        self.label.setObjectName(_fromUtf8("label"))
        self.line_3 = QtGui.QFrame(self.widget)
        self.line_3.setGeometry(QtCore.QRect(320, 295, 420, 3))
        self.line_3.setFrameShape(QtGui.QFrame.HLine)
        self.line_3.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_3.setObjectName(_fromUtf8("line_3"))
        self.checkBox = QtGui.QCheckBox(self.widget)
        self.checkBox.setGeometry(QtCore.QRect(670, 365, 71, 16))
        self.checkBox.setChecked(True)
        self.checkBox.setObjectName(_fromUtf8("checkBox"))
        self.toolButton = QtGui.QToolButton(self.widget)
        self.toolButton.setGeometry(QtCore.QRect(320, 425, 420, 61))
        self.toolButton.setAutoRepeat(False)
        self.toolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
        self.toolButton.setObjectName(_fromUtf8("toolButton"))
        self.lineEdit = QtGui.QLineEdit(self.widget)
        self.lineEdit.setGeometry(QtCore.QRect(390, 185, 321, 25))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("微软雅黑"))
        self.lineEdit.setFont(font)
        self.lineEdit.setText(_fromUtf8(""))
        self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
        self.line_4 = QtGui.QFrame(self.widget)
        self.line_4.setGeometry(QtCore.QRect(360, 255, 3, 25))
        self.line_4.setFrameShape(QtGui.QFrame.VLine)
        self.line_4.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_4.setObjectName(_fromUtf8("line_4"))
        self.lineEdit_2 = QtGui.QLineEdit(self.widget)
        self.lineEdit_2.setGeometry(QtCore.QRect(390, 255, 321, 25))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("微软雅黑"))
        self.lineEdit_2.setFont(font)
        self.lineEdit_2.setText(_fromUtf8(""))
        self.lineEdit_2.setEchoMode(QtGui.QLineEdit.Password)
        self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
        self.line = QtGui.QFrame(self.widget)
        self.line.setGeometry(QtCore.QRect(360, 185, 3, 25))
        self.line.setFrameShape(QtGui.QFrame.VLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        #         self.label_3 = QtGui.QLabel(self.widget)
        #         self.label_3.setGeometry(QtCore.QRect(640, 525, 105, 31))
        #         self.label_3.setObjectName(_fromUtf8("label_3"))
        self.label_3 = MyLabel(self)
        self.label_3.setGeometry(QtCore.QRect(640, 525, 105, 31))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.label_3.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.label_2 = QtGui.QLabel(self.widget)
        self.label_2.setGeometry(QtCore.QRect(320, 250, 30, 30))
        self.label_2.setText(_fromUtf8(""))
        self.label_2.setPixmap(QtGui.QPixmap(_fromUtf8(":/images/suo.png")))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.closetoolButton = QtGui.QToolButton(self.widget)
        self.closetoolButton.setGeometry(QtCore.QRect(1050, 5, 27, 22))
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/close_normal.png")),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.closetoolButton.setIcon(icon)
        self.closetoolButton.setIconSize(QtCore.QSize(27, 22))
        self.closetoolButton.setObjectName(_fromUtf8("closetoolButton"))
        self.closetoolButton_2 = QtGui.QToolButton(self.widget)
        self.closetoolButton_2.setGeometry(QtCore.QRect(1020, 5, 27, 22))
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/min_normal.png")),
                        QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.closetoolButton_2.setIcon(icon1)
        self.closetoolButton_2.setIconSize(QtCore.QSize(27, 22))
        self.closetoolButton_2.setObjectName(_fromUtf8("closetoolButton_2"))
        self.label_4 = QtGui.QLabel(self.widget)
        self.label_4.setGeometry(QtCore.QRect(770, 210, 105, 31))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.label_5 = QtGui.QLabel(self.widget)
        self.label_5.setGeometry(QtCore.QRect(770, 280, 105, 31))
        self.label_5.setObjectName(_fromUtf8("label_5"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
        self.closetoolButton.clicked.connect(self.close)
        self.closetoolButton_2.clicked.connect(self.showMinimized)
        self.toolButton.clicked.connect(self.LoginTask)
        self.initUserInfo()
示例#8
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(467, 536)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.frame = QtWidgets.QFrame(self.centralwidget)
        self.frame.setGeometry(QtCore.QRect(10, 90, 441, 401))
        self.frame.setStyleSheet("")
        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.layoutWidget = QtWidgets.QWidget(self.frame)
        self.layoutWidget.setGeometry(QtCore.QRect(10, 10, 421, 381))
        self.layoutWidget.setObjectName("layoutWidget")
        self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setObjectName("gridLayout")
        self.account_lineEdit = QtWidgets.QLineEdit(self.layoutWidget)
        self.account_lineEdit.setMinimumSize(QtCore.QSize(293, 35))
        self.account_lineEdit.setMaximumSize(QtCore.QSize(293, 16777215))
        self.account_lineEdit.setStyleSheet("font: 14pt \"华文楷体\";")
        self.account_lineEdit.setClearButtonEnabled(True)
        self.account_lineEdit.setObjectName("account_lineEdit")
        self.gridLayout.addWidget(self.account_lineEdit, 0, 1, 1, 1)
        self.password_label = QtWidgets.QLabel(self.layoutWidget)
        self.password_label.setStyleSheet("font: 14pt \"华文楷体\";")
        self.password_label.setAlignment(QtCore.Qt.AlignCenter)
        self.password_label.setObjectName("password_label")
        self.gridLayout.addWidget(self.password_label, 1, 0, 1, 1)
        self.login_label = QtWidgets.QPushButton(self.layoutWidget)
        self.login_label.setMinimumSize(QtCore.QSize(0, 40))
        self.login_label.setMaximumSize(QtCore.QSize(16777215, 40))
        self.login_label.setStyleSheet("font: 14pt \"华文楷体\";")
        self.login_label.setObjectName("login_label")
        self.gridLayout.addWidget(self.login_label, 4, 0, 1, 2)
        self.password_lineEdit = QtWidgets.QLineEdit(self.layoutWidget)
        self.password_lineEdit.setMinimumSize(QtCore.QSize(293, 35))
        self.password_lineEdit.setMaximumSize(QtCore.QSize(293, 16777215))
        self.password_lineEdit.setStyleSheet("font: 14pt \"华文楷体\";")
        self.password_lineEdit.setEchoMode(QtWidgets.QLineEdit.Password)
        self.password_lineEdit.setClearButtonEnabled(True)
        self.password_lineEdit.setObjectName("password_lineEdit")
        self.gridLayout.addWidget(self.password_lineEdit, 1, 1, 1, 1)
        self.picture_label = MyLabel(self.layoutWidget)
        self.picture_label.setMinimumSize(QtCore.QSize(293, 190))
        self.picture_label.setMaximumSize(QtCore.QSize(293, 190))
        self.picture_label.setStyleSheet("font: 14pt \"华文楷体\";\n"
"background-color: rgb(0, 255, 255);")
        self.picture_label.setAlignment(QtCore.Qt.AlignCenter)
        self.picture_label.setObjectName("picture_label")
        self.gridLayout.addWidget(self.picture_label, 2, 1, 2, 1)
        self.account_label = QtWidgets.QLabel(self.layoutWidget)
        self.account_label.setStyleSheet("font: 14pt \"华文楷体\";")
        self.account_label.setAlignment(QtCore.Qt.AlignCenter)
        self.account_label.setObjectName("account_label")
        self.gridLayout.addWidget(self.account_label, 0, 0, 1, 1)
        self.refresh_button = QtWidgets.QPushButton(self.layoutWidget)
        self.refresh_button.setMinimumSize(QtCore.QSize(50, 60))
        self.refresh_button.setStyleSheet("font: 14pt \"华文楷体\";")
        self.refresh_button.setObjectName("refresh_button")
        self.gridLayout.addWidget(self.refresh_button, 2, 0, 1, 1)
        self.autoSelect_button = QtWidgets.QPushButton(self.layoutWidget)
        self.autoSelect_button.setMinimumSize(QtCore.QSize(50, 60))
        self.autoSelect_button.setStyleSheet("font: 14pt \"华文楷体\";")
        self.autoSelect_button.setObjectName("autoSelect_button")
        self.gridLayout.addWidget(self.autoSelect_button, 3, 0, 1, 1)
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(20, 10, 421, 81))
        self.label.setStyleSheet("font: 14pt \"华文楷体\";\n"
"border-image: url(:/image/qiangpiao.png);")
        self.label.setText("")
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 467, 23))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        self.refresh_button.clicked.connect(MainWindow.reFresh)
        self.autoSelect_button.clicked.connect(MainWindow.autoSelect)
        self.login_label.clicked.connect(MainWindow.login)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)