def __init__(self, styleoptions, parent=None): super(LoginDialog, self).__init__(styleoptions, parent) self.login_np = QtGui.QWidget() login_np_mainlayout = QtGui.QGridLayout() login_nameLabel = QtGui.QLabel(u'用户名') self.login_name = QtGui.QLineEdit(self) self.login_name.setPlaceholderText(u'用户名') login_passwordLabel = QtGui.QLabel(u'密码') self.login_password = QtGui.QLineEdit(self) self.login_password.setEchoMode(QtGui.QLineEdit.Password) self.login_password.setPlaceholderText(u'密码') login_np_mainlayout.addWidget(login_nameLabel, 0, 0) login_np_mainlayout.addWidget(self.login_name, 0, 1) login_np_mainlayout.addWidget(login_passwordLabel, 1, 0) login_np_mainlayout.addWidget(self.login_password, 1, 1) self.login_np.setLayout(login_np_mainlayout) #确认按钮布局 self.enterwidget = QtGui.QWidget() self.pbLogin = QtGui.QPushButton(u'登录', self) self.pbCancel = QtGui.QPushButton(u'取消', self) self.pbLogin.clicked.connect(self.login) self.pbCancel.clicked.connect(self.reject) enterwidget_mainlayout = QtGui.QGridLayout() enterwidget_mainlayout.addWidget(self.pbLogin, 0, 0) enterwidget_mainlayout.addWidget(self.pbCancel, 0, 1) self.enterwidget.setLayout(enterwidget_mainlayout) self.layout().addWidget(self.login_np) self.layout().addWidget(self.enterwidget) self.resize(self.width(), self.height())
def __init__(self, styleoptions, parent=None): super(IPaddressDialog, self).__init__(styleoptions, parent) # url内容输入 self.urlwidget = QtGui.QWidget() ip_mainlayout = QtGui.QGridLayout() self.ipLabel = QtGui.QLabel(u'输入主机ip:') self.ipLineEdit = QtGui.QLineEdit(u'192.168.100.100') self.ipLineEdit.setInputMask('000.000.000.000') self.portLabel = QtGui.QLabel(u'输入主机port:') self.portLineEdit = QtGui.QLineEdit(u'8000') ip_mainlayout.addWidget(self.ipLabel, 0, 0) ip_mainlayout.addWidget(self.ipLineEdit, 0, 1) ip_mainlayout.addWidget(self.portLabel, 1, 0) ip_mainlayout.addWidget(self.portLineEdit, 1, 1) self.urlwidget.setLayout(ip_mainlayout) #确认按钮布局 self.enterwidget = QtGui.QWidget() self.pbEnter = QtGui.QPushButton(u'确定', self) self.pbCancel = QtGui.QPushButton(u'取消', self) self.pbEnter.clicked.connect(self.enter) self.pbCancel.clicked.connect(self.reject) enterwidget_mainlayout = QtGui.QGridLayout() enterwidget_mainlayout.addWidget(self.pbEnter, 0, 0) enterwidget_mainlayout.addWidget(self.pbCancel, 0, 1) self.enterwidget.setLayout(enterwidget_mainlayout) self.layout().addWidget(self.urlwidget) self.layout().addWidget(self.enterwidget) self.resize(self.width(), self.height())
def __init__(self, styleoptions, parent=None): super(numinputDialog, self).__init__(styleoptions, parent) # url内容输入 self.numwidget = QtGui.QWidget() num_mainlayout = QtGui.QGridLayout() self.numLabel = QtGui.QLabel(u'Q的防区个数:') self.numspinbox = QtGui.QSpinBox(self.numwidget) self.ipLabel = QtGui.QLabel(u'Q的下位机IP:') self.ipIn = QtGui.QLineEdit() num_mainlayout.addWidget(self.numLabel, 0, 0) num_mainlayout.addWidget(self.numspinbox, 0, 1) #num_mainlayout.addWidget(self.ipLabel, 1, 0) #num_mainlayout.addWidget(self.ipIn, 1, 1) self.numwidget.setLayout(num_mainlayout) #确认按钮布局 self.enterwidget = QtGui.QWidget() self.pbEnter = QtGui.QPushButton(u'确定', self) self.pbCancel = QtGui.QPushButton(u'取消', self) self.pbEnter.clicked.connect(self.enter) self.pbCancel.clicked.connect(self.reject) enterwidget_mainlayout = QtGui.QGridLayout() enterwidget_mainlayout.addWidget(self.pbEnter, 0, 0) enterwidget_mainlayout.addWidget(self.pbCancel, 0, 1) self.enterwidget.setLayout(enterwidget_mainlayout) self.layout().addWidget(self.numwidget) self.layout().addWidget(self.enterwidget) self.resize(self.width(), self.height())
def __init__(self, styleoptions, parent=None): super(UrlinputDialog, self).__init__(styleoptions, parent) # url内容输入 self.urlwidget = QtGui.QWidget() url_mainlayout = QtGui.QGridLayout() self.urlLabel = QtGui.QLabel(u'请输入需要访问的url:') self.urlLineEdit = QtGui.QLineEdit(u'http://192.168.10.135:8000/webs/protection_areas/list') url_mainlayout.addWidget(self.urlLabel, 0, 0) url_mainlayout.addWidget(self.urlLineEdit, 1, 0) self.urlwidget.setLayout(url_mainlayout) #确认按钮布局 self.enterwidget = QtGui.QWidget() self.pbEnter = QtGui.QPushButton(u'确定', self) self.pbCancel = QtGui.QPushButton(u'取消', self) self.pbEnter.clicked.connect(self.enter) self.pbCancel.clicked.connect(self.reject) enterwidget_mainlayout = QtGui.QGridLayout() enterwidget_mainlayout.addWidget(self.pbEnter, 0, 0) enterwidget_mainlayout.addWidget(self.pbCancel, 0, 1) self.enterwidget.setLayout(enterwidget_mainlayout) self.layout().addWidget(self.urlwidget) self.layout().addWidget(self.enterwidget) self.resize(self.width(), self.height())