python类QPushButton()的实例源码

pmonitor.py 文件源码 项目:PH5 作者: PIC-IRIS 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def __init__ (self, title, mmax=100) :
        super (FamilyProgress, self).__init__ ()

        self.setWindowTitle (title)
        self.setFixedHeight (48)
        self.pbar = QtGui.QProgressBar ()
        self.pbar.setRange (0, mmax - 1)

        self.btn = QtGui.QPushButton ("Starting", self)

        pbarvbox = QtGui.QVBoxLayout()
        pbarvbox.addStretch (False)
        pbarvbox.addWidget (self.pbar)
        buttonvbox = QtGui.QVBoxLayout ()
        buttonvbox.addStretch (True)
        buttonvbox.addWidget (self.btn)
        hbox = QtGui.QHBoxLayout ()
        hbox.addLayout(pbarvbox, stretch=False)
        hbox.addLayout(buttonvbox)

        self.setLayout (hbox)
        self.pbar.setStyleSheet(START_STYLE)        
        #self.show()
universal_tool_template_v7.3.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtGui.QLabel, QtGui.QPushButton, QtGui.QAction, QtGui.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtGui.QGroupBox, QtGui.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtGui.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name]
design.py 文件源码 项目:TWTools 作者: ZeX2 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def setupUi(self):
        """Bruh"""
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setGeometry(50, 50, 600, 300)
        self.setWindowTitle("ZeZe's TWTools - Backtiming Calculator")
        self.setWindowIcon(QtGui.QIcon(resource_path("images/icon.png")))

        """Background color"""
        self.backgroundPalette = QtGui.QPalette()
        self.backgroundColor = QtGui.QColor(217, 204, 170)
        self.backgroundPalette.setColor(
            QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(self.backgroundPalette)

        """Main layout & return to main menu button"""
        self.verticalLayout = QtGui.QVBoxLayout(self)

        self.buttonLayout = QtGui.QHBoxLayout(self)
        self.verticalLayout.addLayout(self.buttonLayout)
        self.returnButton = QtGui.QPushButton("  Return to the Main Menu  ", self)
        self.returnButton.clicked.connect(self.return_function)
        self.buttonLayout.addWidget(self.returnButton)
        self.buttonSpacer = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.buttonLayout.addItem(self.buttonSpacer)
pysidetest.py 文件源码 项目:3dsmaxTools 作者: col-one 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def main():
    #MaxPlus.FileManager.Reset(True)
    w = QtGui.QWidget()
    MaxPlus.AttachQWidgetToMax(w)
    if _GCProtector.widgets :
        w = _GCProtector.widgets
        print w
    w.resize(250, 100)
    w.setWindowTitle('Window')
    _GCProtector.widgets = w
    w.show()
    main_layout = QtGui.QVBoxLayout()
    label = QtGui.QLabel("Click button to create a cylinder in the scene")
    main_layout.addWidget(label)

    cylinder_btn = QtGui.QPushButton("Cylinder")
    main_layout.addWidget(cylinder_btn)
    w.setLayout(main_layout)

    cylinder_btn.clicked.connect(make_cylinder)
matcher_sup.py 文件源码 项目:3dsmaxTools 作者: col-one 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self):
        super(MatcherUI, self).__init__()
        self.setWindowTitle("Matcher")
        self.resize(230, 180)
        self.layout = QtGui.QVBoxLayout(self)
        label = QtGui.QLabel("Match attributes\nbetween objects")
        separator = HSeparator()
        self.name = QtGui.QCheckBox("Name")
        self.color = QtGui.QCheckBox("Color")
        self.position = QtGui.QCheckBox("Position")
        self.rotation = QtGui.QCheckBox("Rotation")
        self.ref = QtGui.QCheckBox("Ref")
        separator2 = HSeparator()
        self.button = QtGui.QPushButton("Apply")

        self.layout.addWidget(label)
        self.layout.addWidget(separator)
        self.layout.addWidget(self.name)
        self.layout.addWidget(self.color)
        self.layout.addWidget(self.position)
        self.layout.addWidget(self.rotation)
        self.layout.addWidget(self.ref)
        self.layout.addWidget(separator2)
        self.layout.addWidget(self.button)
GDT.py 文件源码 项目:FreeCAD-GDT 作者: juanvanyo 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def initUI(self, title, idGDT, ContainerOfData):
        self.idGDT = idGDT
        self.ContainerOfData = ContainerOfData
        vbox = QtGui.QVBoxLayout()
        for widg in self.dd_dialogWidgets:
            if widg <> None:
                w = widg.generateWidget(self.idGDT,self.ContainerOfData)
                if isinstance(w, QtGui.QLayout):
                    vbox.addLayout( w )
                else:
                    vbox.addWidget( w )
        hbox = QtGui.QHBoxLayout()
        buttonCreate = QtGui.QPushButton(title)
        buttonCreate.setDefault(True)
        buttonCreate.clicked.connect(self.createObject)
        hbox.addStretch(1)
        hbox.addWidget( buttonCreate )
        hbox.addStretch(1)
        vbox.addLayout( hbox )
        self.setLayout(vbox)
periodic_table.py 文件源码 项目:smhr 作者: andycasey 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def select_element(self, element):
        """
        Show an element as selected.
        """

        widget = self._get_element_widget(element)
        widget.setStyleSheet("QPushButton { font-weight: bold; }")

        if self.multiple_select:
            self._selected_elements.append(element)
            self.btn_ok.setEnabled(True)

        else:
            self._selected_elements = [element]
            if self.close_on_first_select:
                self.close()

        return None
periodic_table.py 文件源码 项目:smhr 作者: andycasey 项目源码 文件源码 阅读 37 收藏 0 点赞 0 评论 0
def deselect_element(self, element):
        """
        Show an element as being de-selected.
        """

        widget = self._get_element_widget(element)
        widget.setStyleSheet("QPushButton { font-weight: normal; }")

        try:
            self._selected_elements.remove(element)

        except ValueError:
            None

        if len(self._selected_elements) == 0 and self.multiple_select:
            self.btn_ok.setEnabled(False)

        return None
renamewindow.py 文件源码 项目:android_malware_detection 作者: congyuandong 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self, parent=None, win=None, element="", info=()):
        super(RenameDialog, self).__init__(parent)

        self.sourceWin = parent
        self.info = info
        self.element = element
        title = "Rename: " + element
        self.setWindowTitle(title)

        layout = QtGui.QGridLayout()
        question = QtGui.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtGui.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtGui.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtGui.QPushButton("Cancel", self)
        layout.addWidget(self.buttonCancel, 1, 0)

        self.lineEdit.setText(self.element)

        self.setLayout(layout)

        self.buttonCancel.clicked.connect(self.cancelClicked)
        self.buttonOK.clicked.connect(self.okClicked)
ParameterPanel.py 文件源码 项目:PipeLine 作者: draknova 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def __init__(self):
        super(HeaderParameterPanel,self).__init__()

        layout = QtGui.QHBoxLayout()
        self.setLayout(layout)

        self.nodeTypeLabel = QtGui.QLabel("<NodeDefaultType>")
        self.nodeNameField = QtGui.QLineEdit("<NodeDefaultName>")
        self.lockButton = QtGui.QPushButton("L")
        self.editInterfaceButton = QtGui.QPushButton("G")
        layout.addWidget(self.nodeTypeLabel)
        layout.addWidget(self.nodeNameField)
        layout.addWidget(self.lockButton)
        layout.addWidget(self.editInterfaceButton)



# This is the graphical aspect of the ParameterTemplate
interface.py 文件源码 项目:PipeLine 作者: draknova 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def initUI(self):
        self._layout = QtGui.QHBoxLayout()
        self.setLayout(self._layout)
        self._layout.setContentsMargins(10,0,10,10)
        self._layout.setSpacing(5)

        self._tabs = QtGui.QTabBar()
        #self._tabs.setTabsClosable(True)
        self._tabs.addTab("Tab1")
        self._tabs.addTab("Tab2")
        self._tabs.addTab("Tab3")

        icnPath = "/Users/draknova/Documents/workspace/sPipe/bin/images/icons"
        addIcone = QtGui.QIcon(QtGui.QPixmap("%s/add.png"%(icnPath)))
        panelIcone = QtGui.QIcon(QtGui.QPixmap("%s/list.png"%(icnPath)))

        self._addButton = QtGui.QPushButton(addIcone,"")

        self._panelButton = QtGui.QPushButton(panelIcone,"")

        self._layout.addWidget(self._tabs)
        self._layout.addWidget(self._addButton)
        self._layout.addStretch()
        self._layout.addWidget(self._panelButton)
mainwidget.py 文件源码 项目:qtinwin 作者: alfalfasprossen 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, *args,**kwargs):
        super(MainWidget, self).__init__(*args,**kwargs)
        self.setLayout(QtGui.QHBoxLayout())
        self.bkg_wdgt = QtGui.QWidget()
        self.layout().addWidget(self.bkg_wdgt)
        self.bkg_wdgt.setLayout(QtGui.QHBoxLayout())
        self.btn = QtGui.QPushButton("hallo")
        self.textarea = QtGui.QTextEdit()
        self.bkg_wdgt.layout().addWidget(self.btn)
        self.bkg_wdgt.layout().addWidget(self.textarea)

        self.setWindowFlags(QtCore.Qt.FramelessWindowHint)

        self.btn.clicked.connect(self.on_btn_clicked)

        # self.parent_hwnd = None
UITranslator.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name]
UITranslator_v1.0.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtGui.QLabel, QtGui.QPushButton, QtGui.QAction, QtGui.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtGui.QGroupBox, QtGui.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtGui.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name]
universal_tool_template_0904.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name]
universal_tool_template_0803.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name]
universal_tool_template_0903.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name]
universal_tool_template_v8.1.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name]
ui_instructions.py 文件源码 项目:FitScan 作者: GunfighterJ 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def setupUi(self, Instructions):
        Instructions.setObjectName("Instructions")
        Instructions.setEnabled(True)
        Instructions.resize(400, 300)
        Instructions.setMinimumSize(QtCore.QSize(400, 300))
        Instructions.setMaximumSize(QtCore.QSize(400, 300))
        self.label = QtGui.QLabel(Instructions)
        self.label.setGeometry(QtCore.QRect(20, 10, 361, 271))
        self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.label.setWordWrap(True)
        self.label.setObjectName("label")
        self.pushButton_OK = QtGui.QPushButton(Instructions)
        self.pushButton_OK.setGeometry(QtCore.QRect(300, 260, 75, 23))
        self.pushButton_OK.setObjectName("pushButton_OK")

        self.retranslateUi(Instructions)
        QtCore.QMetaObject.connectSlotsByName(Instructions)
sketchmanager.py 文件源码 项目:freecad-nurbs 作者: microelly2 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def MySaveDialog(target=None):
    '''widget for save sketch into a file''' 

    lm=getfiles()
    w=QtGui.QWidget()
    w.target=target

    box = QtGui.QVBoxLayout()
    w.setLayout(box)
    w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)


    w.r=QtGui.QPushButton("save selected sketch as file")
    box.addWidget(w.r)
    w.r.pressed.connect(lambda :saveSketch(w))

    w.show()
    return w
controlpanel.py 文件源码 项目:freecad-nurbs 作者: microelly2 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def dialogV(obj):
    '''erzeugen dialog vLayout'''

    w=QtGui.QWidget()
    box = QtGui.QVBoxLayout()
    w.setLayout(box)
    w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)

    for p in obj.props:
        pw=createPropWidget( obj,p)
        box.addWidget(pw)

    w.r=QtGui.QPushButton("close")
    box.addWidget(w.r)
    w.r.pressed.connect(lambda :clear(w))

    w.show()
    return w


##create controller main dialog
treepanel.py 文件源码 项目:LCInterlocking 作者: execuc 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def init_params(self):
        QtGui.QWidget().setLayout(self.params_vbox)
        parts_vbox = QtGui.QGridLayout(self.params_widget)
        self.hide_button = QtGui.QPushButton('Hide others', self.params_widget)
        parts_vbox.addWidget(self.hide_button, 0, 0)
        self.hide_button.clicked.connect(self.hide_others)
        self.show_button = QtGui.QPushButton('Show all', self.params_widget)
        parts_vbox.addWidget(self.show_button, 0, 1)
        self.show_button.clicked.connect(self.show_initial_objects)

        self.set_transparency_button = QtGui.QPushButton('Set transparent', self.params_widget)
        parts_vbox.addWidget(self.set_transparency_button, 1, 0)
        self.set_transparency_button.clicked.connect(self.set_transparency)
        self.reset_transparency_button = QtGui.QPushButton('Restore transparent', self.params_widget)
        parts_vbox.addWidget(self.reset_transparency_button, 1, 1)
        self.reset_transparency_button.clicked.connect(self.restore_transparency)

        preview_button = QtGui.QPushButton('Preview', self.params_widget)
        parts_vbox.addWidget(preview_button,2,0,1,2)
        preview_button.clicked.connect(self.preview)
crosspiece.py 文件源码 项目:LCInterlocking 作者: execuc 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def init_tree_widget(self):
        # Add part buttons
        h_box = QtGui.QHBoxLayout(self.tree_widget)
        add_parts_button = QtGui.QPushButton('Add parts', self.tree_widget)
        add_parts_button.clicked.connect(self.add_parts)
        add_same_part_button = QtGui.QPushButton('Add same parts', self.tree_widget)
        add_same_part_button.clicked.connect(self.add_same_parts)
        h_box.addWidget(add_parts_button)
        h_box.addWidget(add_same_part_button)
        self.tree_vbox.addLayout(h_box)
        # tree
        self.selection_model = self.tree_view_widget.selectionModel()
        self.selection_model.selectionChanged.connect(self.selection_changed)
        self.tree_vbox.addWidget(self.tree_view_widget)
        remove_item_button = QtGui.QPushButton('Remove item', self.tree_widget)
        remove_item_button.clicked.connect(self.remove_items)
        self.tree_vbox.addWidget(remove_item_button)
        # test layout
        self.edit_items_layout = QtGui.QVBoxLayout(self.tree_widget)
        self.tree_vbox.addLayout(self.edit_items_layout)
main.py 文件源码 项目:porn_sieve 作者: PornSieve 项目源码 文件源码 阅读 40 收藏 0 点赞 0 评论 0
def init_right_pane(self):
        self.right_pane = QtGui.QVBoxLayout()

        # RATE button
        self.rate_btn = QtGui.QPushButton("rate", self)
        self.rate_btn.clicked.connect(self.rate)
        self.right_pane.addWidget(self.rate_btn)

        # OPEN button
        self.open_btn = QtGui.QPushButton("open", self)
        self.open_btn.clicked.connect(lambda: webbrowser.open(self.cur_vid))
        self.right_pane.addWidget(self.open_btn)

        # INFO box
        self.info_box = QtGui.QLabel(self)
        self.info_box.setText("")
        self.right_pane.addWidget(self.info_box)

        # SKIP button
        # by some magic this is aligned correctly
        self.skip_btn = QtGui.QPushButton("skip", self)
        self.skip_btn.clicked.connect(self.skip)
        self.right_pane.addWidget(self.skip_btn)

        self.layout.addLayout(self.right_pane)
attTable_UIs.py 文件源码 项目:pw_mGeoExporter 作者: paulwinex 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.horizontalLayout = QtGui.QHBoxLayout(Form)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.tableLayout = QtGui.QVBoxLayout()
        self.tableLayout.setObjectName("tableLayout")
        self.horizontalLayout.addLayout(self.tableLayout)
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.addAttr_btn = QtGui.QPushButton(Form)
        self.addAttr_btn.setMaximumSize(QtCore.QSize(30, 16777215))
        self.addAttr_btn.setObjectName("addAttr_btn")
        self.verticalLayout.addWidget(self.addAttr_btn)
        self.removeAttr_btn = QtGui.QPushButton(Form)
        self.removeAttr_btn.setMaximumSize(QtCore.QSize(30, 16777215))
        self.removeAttr_btn.setObjectName("removeAttr_btn")
        self.verticalLayout.addWidget(self.removeAttr_btn)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.horizontalLayout.addLayout(self.verticalLayout)
        self.horizontalLayout.setStretch(0, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
renamewindow.py 文件源码 项目:DroidWatcher 作者: suemi994 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def __init__(self, parent=None, win=None, element="", info=()):
        super(RenameDialog, self).__init__(parent)

        self.sourceWin = parent
        self.info = info
        self.element = element
        title = "Rename: " + element
        self.setWindowTitle(title)

        layout = QtGui.QGridLayout()
        question = QtGui.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtGui.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtGui.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtGui.QPushButton("Cancel", self)
        layout.addWidget(self.buttonCancel, 1, 0)

        self.lineEdit.setText(self.element)

        self.setLayout(layout)

        self.buttonCancel.clicked.connect(self.cancelClicked)
        self.buttonOK.clicked.connect(self.okClicked)
renamewindow.py 文件源码 项目:DroidWatcher 作者: suemi994 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self, parent=None, win=None, element="", info=()):
        super(RenameDialog, self).__init__(parent)

        self.sourceWin = parent
        self.info = info
        self.element = element
        title = "Rename: " + element
        self.setWindowTitle(title)

        layout = QtGui.QGridLayout()
        question = QtGui.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtGui.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtGui.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtGui.QPushButton("Cancel", self)
        layout.addWidget(self.buttonCancel, 1, 0)

        self.lineEdit.setText(self.element)

        self.setLayout(layout)

        self.buttonCancel.clicked.connect(self.cancelClicked)
        self.buttonOK.clicked.connect(self.okClicked)
onionSkinRendererWindow.py 文件源码 项目:onionSkinRenderer 作者: Viele 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def addRemoveButton(self):
        self.frame_remove_btn = QtGui.QPushButton('rm')
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.frame_remove_btn.sizePolicy().hasHeightForWidth())
        self.frame_remove_btn.setSizePolicy(sizePolicy)
        self.frame_remove_btn.setMinimumSize(QtCore.QSize(16, 16))
        self.frame_remove_btn.setMaximumSize(QtCore.QSize(16, 16))
        self.frame_widget_layout.addWidget(self.frame_remove_btn)



# ----------------------
# OBJECT WIDGET
# the widget for displaying an object in a list
onionSkinRendererObjectWidget.py 文件源码 项目:onionSkinRenderer 作者: Viele 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def setupUi(self, onionSkinObject_layout):
        onionSkinObject_layout.setObjectName("onionSkinObject_layout")
        onionSkinObject_layout.resize(204, 38)
        self.horizontalLayout = QtGui.QHBoxLayout(onionSkinObject_layout)
        self.horizontalLayout.setSpacing(3)
        self.horizontalLayout.setContentsMargins(4, 2, 4, 2)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.object_label = QtGui.QLabel(onionSkinObject_layout)
        self.object_label.setObjectName("object_label")
        self.horizontalLayout.addWidget(self.object_label)
        self.object_remove_btn = QtGui.QPushButton(onionSkinObject_layout)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.object_remove_btn.sizePolicy().hasHeightForWidth())
        self.object_remove_btn.setSizePolicy(sizePolicy)
        self.object_remove_btn.setMinimumSize(QtCore.QSize(16, 16))
        self.object_remove_btn.setMaximumSize(QtCore.QSize(16, 16))
        self.object_remove_btn.setObjectName("object_remove_btn")
        self.horizontalLayout.addWidget(self.object_remove_btn)

        self.retranslateUi(onionSkinObject_layout)
        QtCore.QMetaObject.connectSlotsByName(onionSkinObject_layout)
Manual.py 文件源码 项目:BioNanoAnalyst 作者: AppliedBioinformatics 项目源码 文件源码 阅读 43 收藏 0 点赞 0 评论 0
def setupUi(self, Manual):
        Manual.setObjectName(_fromUtf8("Manual"))
        Manual.resize(740, 450)
        Manual.setMinimumSize(QtCore.QSize(740, 450))
        Manual.setMaximumSize(QtCore.QSize(740, 450))
        self.textBrowser = QtGui.QTextBrowser(Manual)
        self.textBrowser.setGeometry(QtCore.QRect(10, 40, 721, 371))
        self.textBrowser.setObjectName(_fromUtf8("textBrowser"))
        self.label = QtGui.QLabel(Manual)
        self.label.setGeometry(QtCore.QRect(10, 10, 271, 21))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Arial"))
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.manual_bn = QtGui.QPushButton(Manual)
        self.manual_bn.setGeometry(QtCore.QRect(650, 420, 75, 23))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Arial"))
        self.manual_bn.setFont(font)
        self.manual_bn.setObjectName(_fromUtf8("manual_bn"))

        self.retranslateUi(Manual)
        QtCore.QMetaObject.connectSlotsByName(Manual)


问题


面经


文章

微信
公众号

扫码关注公众号