python类QLabel()的实例源码

universal_tool_template_v7.3.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 28 收藏 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]
miki.py 文件源码 项目:reconstruction 作者: microelly2 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def  fv2(name="vertical",title=''):
    ''' create as a dock widget '''

    t=QtGui.QLabel("my widget")
    w=MyDockWidget(t,"Reconstruction WB")

    if title <>'': w.setWindowTitle(title)


    w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
    ComboViewShowWidget(w,True)

    # store it to FC.w5
    try: FreeCAD.w5.append(w)
    except: FreeCAD.w5=[w]

    return w
miki.py 文件源码 项目:reconstruction 作者: microelly2 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def  fh(name="horizontal",title=''):
    w=QtGui.QWidget()
    #w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)

### w.setStyleSheet("QWidget { font: bold 18px;color:blue;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}")
    layout = QtGui.QHBoxLayout()
    layout.setAlignment(QtCore.Qt.AlignLeft)
    w.setLayout(layout)
    # Gruppenname setzen:
    #pB= QtGui.QLabel("name")
    #pB.setStyleSheet("QWidget { font: bold 18px;color:red;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}")
    #layout.addWidget(pB)

    if title <>'': w.setWindowTitle(title)
    #w.show()
    #ComboViewShowWidget(w,False)
    w.layout=layout
    return w
miki.py 文件源码 项目:reconstruction 作者: microelly2 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def  fh2(name="vertik horizontal",title=''):
    w=QtGui.QWidget()
    #w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)

### w.setStyleSheet("QWidget { font: bold 18px;color:blue;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}")
    layout = QtGui.QVBoxLayout()
    layout.setAlignment(QtCore.Qt.AlignLeft)
    w.setLayout(layout)
    #pB= QtGui.QLabel("name")
    #pB.setStyleSheet("QWidget { font: bold 18px;color:red;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}")
    #layout.addWidget(pB)
    if title <>'': w.setWindowTitle(title)
    #w.show()
    #ComboViewShowWidget(w,False)
    w.layout=layout
    return w
miki.py 文件源码 项目:reconstruction 作者: microelly2 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def getdockwindowMgr2():
    if 1:
        w = getMainWindowByName("name")
        t = QtGui.QLabel('Title 1')
        d = MyDockWidget(t,"huhu")
        w.addDockWidget(QtCore.Qt.LeftDockWidgetArea, d)
        t = QtGui.QLabel('Title 2')
        d2 = MyDockWidget(t,"haha")
        w.addDockWidget(QtCore.Qt.LeftDockWidgetArea, d2)
        w.tabifyDockWidget(d2, d);
        w.show()
        FreeCAD.dockwindowMgr=w
        return w



################
pysidetest.py 文件源码 项目:3dsmaxTools 作者: col-one 项目源码 文件源码 阅读 18 收藏 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 项目源码 文件源码 阅读 21 收藏 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)
PCBcategories.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.setWindowTitle(u'Add new category')
        #
        self.categoryName = QtGui.QLineEdit('')
        self.categoryName.setStyleSheet('background-color:#FFF;')

        self.categoryDescription = QtGui.QTextEdit('')
        # buttons
        buttons = QtGui.QDialogButtonBox()
        buttons.setOrientation(QtCore.Qt.Vertical)
        buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole)
        buttons.addButton("Add", QtGui.QDialogButtonBox.AcceptRole)
        self.connect(buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()"))
        self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()"))
        #
        lay = QtGui.QGridLayout(self)
        lay.addWidget(QtGui.QLabel(u'Name'), 0, 0, 1, 1)
        lay.addWidget(self.categoryName, 0, 1, 1, 1)
        lay.addWidget(QtGui.QLabel(u'Desctiption'), 1, 0, 1, 1, QtCore.Qt.AlignTop)
        lay.addWidget(self.categoryDescription, 1, 1, 1, 1)
        lay.addWidget(buttons, 0, 2, 2, 1, QtCore.Qt.AlignCenter)
        lay.setRowStretch(1, 10)
razen.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def __init__(self, filename=None, parent=None):
        dialogMAIN_FORM.__init__(self, parent)
        self.databaseType = "razen"

        ###
        self.generateLayers()
        self.spisWarstw.sortItems(1)
        #
        self.razenBiblioteki = QtGui.QLineEdit('')
        if PCBconf.supSoftware[self.databaseType]['libPath'] != "":
            self.razenBiblioteki.setText(PCBconf.supSoftware[self.databaseType]['libPath'])

        lay = QtGui.QHBoxLayout()
        lay.addWidget(QtGui.QLabel('Library'))
        lay.addWidget(self.razenBiblioteki)
        self.lay.addLayout(lay, 12, 0, 1, 6)
fidocadj.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def __init__(self, filename=None, parent=None):
        dialogMAIN_FORM.__init__(self, parent)
        self.databaseType = "fidocadj"

        self.projektBRD = __builtin__.open(filename, "r").read().replace("\r", "")
        self.layersNames = {}
        self.getLayersNames()
        ####
        self.generateLayers()
        self.spisWarstw.sortItems(1)
        #
        self.fidocadjBiblioteki = QtGui.QLineEdit('')
        if PCBconf.supSoftware[self.databaseType]['libPath'] != "":
            self.fidocadjBiblioteki.setText(PCBconf.supSoftware[self.databaseType]['libPath'])

        lay = QtGui.QHBoxLayout()
        lay.addWidget(QtGui.QLabel('Library'))
        lay.addWidget(self.fidocadjBiblioteki)
        self.lay.addLayout(lay, 12, 0, 1, 6)
renamewindow.py 文件源码 项目:android_malware_detection 作者: congyuandong 项目源码 文件源码 阅读 22 收藏 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)
xrefwindow.py 文件源码 项目:android_malware_detection 作者: congyuandong 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, parent=None, win=None, xrefs=None, headers=["Origin", "Method"]):
        super(XrefListView, self).__init__(parent)
        self.parent = parent
        self.mainwin = win
        self.xrefs = xrefs
        self.headers = headers

        self.setMinimumSize(600, 400)

        self.filterPatternLineEdit = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter origin pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.xrefwindow = XrefValueWindow(self, win, self.xrefs, self.headers)

        sourceLayout = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.xrefwindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout)
stringswindow.py 文件源码 项目:android_malware_detection 作者: congyuandong 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, parent=None, win=None, session=None):
        super(StringsWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Strings"

        self.filterPatternLineEdit = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter string pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.stringswindow = StringsValueWindow(self, win, session)

        sourceLayout = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.stringswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout)
renamewindow.py 文件源码 项目:android_malware_detection 作者: congyuandong 项目源码 文件源码 阅读 24 收藏 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)
xrefwindow.py 文件源码 项目:android_malware_detection 作者: congyuandong 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, parent=None, win=None, xrefs=None, headers=["Origin", "Method"]):
        super(XrefListView, self).__init__(parent)
        self.parent = parent
        self.mainwin = win
        self.xrefs = xrefs
        self.headers = headers

        self.setMinimumSize(600, 400)

        self.filterPatternLineEdit = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter origin pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.xrefwindow = XrefValueWindow(self, win, self.xrefs, self.headers)

        sourceLayout = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.xrefwindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout)
main.py 文件源码 项目:Electrify 作者: jyapayne 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def create_icon_box(self, name, text):
        style = 'width:48px;height:48px;background-color:white;border-radius:5px;border:1px solid rgb(50,50,50);'
        icon_label = QtGui.QLabel()
        icon_label.setStyleSheet(style)
        icon_label.setMaximumWidth(48)
        icon_label.setMinimumWidth(48)
        icon_label.setMaximumHeight(48)
        icon_label.setMinimumHeight(48)

        setattr(self, name, icon_label)

        icon_text = QtGui.QLabel(text)
        icon_text.setStyleSheet('font-size:10px;')
        icon_text.setAlignment(QtCore.Qt.AlignCenter)
        vbox = QVBoxLayout()
        vbox.setAlignment(QtCore.Qt.AlignCenter)
        vbox.addWidget(icon_label)
        vbox.addWidget(icon_text)
        vbox.setContentsMargins(0, 0, 0, 0)

        w = QtGui.QWidget()
        w.setLayout(vbox)
        w.setMaximumWidth(70)
        return w
ParameterPanel.py 文件源码 项目:PipeLine 作者: draknova 项目源码 文件源码 阅读 24 收藏 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
UITranslator.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 21 收藏 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_0904.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 33 收藏 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 项目源码 文件源码 阅读 26 收藏 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 项目源码 文件源码 阅读 21 收藏 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)
gui.py 文件源码 项目:epycyzm 作者: slush0 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def createIconGroupBox(self):
        self.iconGroupBox = QtGui.QGroupBox("Tray Icon")

        self.iconLabel = QtGui.QLabel("Icon:")

        self.iconComboBox = QtGui.QComboBox()
        self.iconComboBox.addItem(QtGui.QIcon(':/icons/miner.svg'), "Miner")
        self.iconComboBox.addItem(QtGui.QIcon(':/images/heart.svg'), "Heart")
        self.iconComboBox.addItem(QtGui.QIcon(':/images/trash.svg'), "Trash")

        self.showIconCheckBox = QtGui.QCheckBox("Show icon")
        self.showIconCheckBox.setChecked(True)

        iconLayout = QtGui.QHBoxLayout()
        iconLayout.addWidget(self.iconLabel)
        iconLayout.addWidget(self.iconComboBox)
        iconLayout.addStretch()
        iconLayout.addWidget(self.showIconCheckBox)
        self.iconGroupBox.setLayout(iconLayout)
miki.py 文件源码 项目:freecad-nurbs 作者: microelly2 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def  fv2(name="vertical",title=''):
    ''' create as a dock widget '''

    t=QtGui.QLabel("my widget")
#   w=MyDockWidget(t,"Reconstruction WB")
    w=MyWidget(t,"Reconstruction WB")

    if title <>'': w.setWindowTitle(title)


    w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
    ComboViewShowWidget(w,True)

    # store it to FC.w5
    try: FreeCAD.w5.append(w)
    except: FreeCAD.w5=[w]

    return w
miki.py 文件源码 项目:freecad-nurbs 作者: microelly2 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def  fv(name="vertical",title=''):

    # w=QtGui.QWidget()
    t=QtGui.QLabel("my widget")
    w=MyDockWidget(t,"Reconstruction WB")

### w.setStyleSheet("QWidget { font: bold 18px;color:brown;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}")

    if title <>'': w.setWindowTitle(title)

    layout = QtGui.QVBoxLayout()
    layout.setAlignment(QtCore.Qt.AlignTop)
    #w.layout=layout
    #w.setLayout(layout)

    w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
    w.show()
    # ComboViewShowWidget(w,True)
    try:
        FreeCAD.w5.append(w)
    except:
        FreeCAD.w5=[w]

    return w
miki.py 文件源码 项目:freecad-nurbs 作者: microelly2 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def  fh2(name="vertik horizontal",title=''):
    w=QtGui.QWidget()
    #w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)

### w.setStyleSheet("QWidget { font: bold 18px;color:blue;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}")
    layout = QtGui.QVBoxLayout()
    layout.setAlignment(QtCore.Qt.AlignLeft)
    w.setLayout(layout)
    #pB= QtGui.QLabel("name")
    #pB.setStyleSheet("QWidget { font: bold 18px;color:red;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}")
    #layout.addWidget(pB)
    if title <>'': w.setWindowTitle(title)
    #w.show()
    #ComboViewShowWidget(w,False)
    w.layout=layout
    return w
miki.py 文件源码 项目:freecad-nurbs 作者: microelly2 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def getdockwindowMgr2():
    if 1:
        w = getMainWindowByName("name")
        t = QtGui.QLabel('Title 1')
        d = MyDockWidget(t,"huhu")
        w.addDockWidget(QtCore.Qt.LeftDockWidgetArea, d)
        t = QtGui.QLabel('Title 2')
        d2 = MyDockWidget(t,"haha")
        w.addDockWidget(QtCore.Qt.LeftDockWidgetArea, d2)
        w.tabifyDockWidget(d2, d);
        w.show()
        FreeCAD.dockwindowMgr=w
        return w



################
main.py 文件源码 项目:porn_sieve 作者: PornSieve 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def init_middle_pane(self):
        self.mid_pane = QtGui.QHBoxLayout()

        # IMGS: images which will display the video preview
        pixmap = QtGui.QPixmap("0.jpg")
        pixmap.scaledToWidth(self.preview_size)
        pixmap.scaledToHeight(self.preview_size)
        img_lbl = QtGui.QLabel(self)
        img_lbl.setPixmap(pixmap)

        # Make sure the window isn't constantly resizing
        img_lbl.setScaledContents(True)
        img_lbl.setMaximumWidth(self.preview_size)
        img_lbl.setMaximumHeight(self.preview_size)

        self.img = img_lbl
        self.mid_pane.addWidget(self.img)

        # SLIDER: slide to rate the quality of the video
        self.slider = QtGui.QSlider(self, QtCore.Qt.Vertical)
        self.slider.setTickPosition(QtGui.QSlider.TicksBothSides)
        self.slider.setTickInterval(20)
        self.mid_pane.addWidget(self.slider)

        self.layout.addLayout(self.mid_pane)
main.py 文件源码 项目:porn_sieve 作者: PornSieve 项目源码 文件源码 阅读 18 收藏 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)
shortcuts_UIs.py 文件源码 项目:CNCGToolKit 作者: cineuse 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(573, 391)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.table = QtGui.QTableWidget(Dialog)
        self.table.setObjectName("table")
        self.table.setColumnCount(0)
        self.table.setRowCount(0)
        self.verticalLayout.addWidget(self.table)
        self.label = QtGui.QLabel(Dialog)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setWeight(75)
        font.setItalic(False)
        font.setBold(True)
        self.label.setFont(font)
        self.label.setFrameShape(QtGui.QFrame.NoFrame)
        self.label.setTextFormat(QtCore.Qt.AutoText)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
renamewindow.py 文件源码 项目:DroidWatcher 作者: suemi994 项目源码 文件源码 阅读 32 收藏 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)


问题


面经


文章

微信
公众号

扫码关注公众号