本文整理汇总了Python中PySide.QtGui.QIcon.addFile方法的典型用法代码示例。如果您正苦于以下问题:Python QIcon.addFile方法的具体用法?Python QIcon.addFile怎么用?Python QIcon.addFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QIcon
的用法示例。
在下文中一共展示了QIcon.addFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtGui import QIcon [as 别名]
# 或者: from PySide.QtGui.QIcon import addFile [as 别名]
def __init__(self,winTitle='Rotate WP', icon='rotWP.svg'):
super(rotWPForm,self).__init__()
self.move(QPoint(100,250))
self.setWindowFlags(Qt.WindowStaysOnTopHint)
self.setWindowTitle(winTitle)
iconPath=join(dirname(abspath(__file__)),"icons",icon)
from PySide.QtGui import QIcon
Icon=QIcon()
Icon.addFile(iconPath)
self.setWindowIcon(Icon)
self.grid=QGridLayout()
self.setLayout(self.grid)
self.radioX=QRadioButton('X')
self.radioX.setChecked(True)
self.radioY=QRadioButton('Y')
self.radioZ=QRadioButton('Z')
self.lab1=QLabel('Angle:')
self.edit1=QLineEdit('45')
self.edit1.setAlignment(Qt.AlignCenter)
self.edit1.setValidator(QDoubleValidator())
self.btn1=QPushButton('Rotate working plane')
self.btn1.clicked.connect(self.rotate)
self.grid.addWidget(self.radioX,0,0,1,1,Qt.AlignCenter)
self.grid.addWidget(self.radioY,0,1,1,1,Qt.AlignCenter)
self.grid.addWidget(self.radioZ,0,2,1,1,Qt.AlignCenter)
self.grid.addWidget(self.lab1,1,0,1,1)
self.grid.addWidget(self.edit1,1,1,1,2)
self.grid.addWidget(self.btn1,2,0,1,3,Qt.AlignCenter)
self.show()
self.sg=FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
s=FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetInt("gridSize")
sc=[float(x*s) for x in [1,1,.2]]
from polarUtilsCmd import arrow
self.arrow =arrow(FreeCAD.DraftWorkingPlane.getPlacement(),scale=sc,offset=s)
示例2: _init_window
# 需要导入模块: from PySide.QtGui import QIcon [as 别名]
# 或者: from PySide.QtGui.QIcon import addFile [as 别名]
def _init_window(self):
"""Init window attributes"""
self.setWindowTitle('Series list')
if os.path.exists(const.ICON_PATH):
icon = QIcon()
icon.addFile(const.ICON_PATH)
else:
icon = QIcon.fromTheme('series_list_icon')
self.setWindowIcon(icon)
示例3: __init__
# 需要导入模块: from PySide.QtGui import QIcon [as 别名]
# 或者: from PySide.QtGui.QIcon import addFile [as 别名]
def __init__(self,winTitle='Insert section', icon='flamingo.svg'):
'''
__init__(self,winTitle='Title',icon='filename.svg')
'''
super(insertSectForm,self).__init__()
self.move(QPoint(100,250))
self.setWindowFlags(Qt.WindowStaysOnTopHint)
self.setWindowTitle(winTitle)
iconPath=join(dirname(abspath(__file__)),"icons",icon)
from PySide.QtGui import QIcon
Icon=QIcon()
Icon.addFile(iconPath)
self.setWindowIcon(Icon)
self.mainHL=QHBoxLayout()
self.setLayout(self.mainHL)
self.firstCol=QWidget()
self.firstCol.setLayout(QVBoxLayout())
self.mainHL.addWidget(self.firstCol)
self.SType='IPE'
self.currentRatingLab=QLabel('Section: '+self.SType)
self.firstCol.layout().addWidget(self.currentRatingLab)
self.sizeList=QListWidget()
self.sizeList.setMaximumWidth(120)
self.firstCol.layout().addWidget(self.sizeList)
self.sectDictList=[]
self.fileList=listdir(join(dirname(abspath(__file__)),"tables"))
self.fillSizes()
self.PRatingsList=[s.lstrip("Section_").rstrip(".csv") for s in self.fileList if s.startswith("Section")]
self.secondCol=QWidget()
self.secondCol.setLayout(QVBoxLayout())
self.lab1=QLabel('Section types:')
self.secondCol.layout().addWidget(self.lab1)
self.ratingList=QListWidget()
self.ratingList.setMaximumWidth(100)
self.ratingList.addItems(self.PRatingsList)
self.ratingList.itemClicked.connect(self.changeRating)
self.ratingList.setCurrentRow(0)
self.secondCol.layout().addWidget(self.ratingList)
self.btn1=QPushButton('Insert')
self.btn1.setMaximumWidth(100)
self.btn1.clicked.connect(self.insert)
self.secondCol.layout().addWidget(self.btn1)
self.mainHL.addWidget(self.secondCol)
self.show()
示例4: __init__
# 需要导入模块: from PySide.QtGui import QIcon [as 别名]
# 或者: from PySide.QtGui.QIcon import addFile [as 别名]
def __init__(self,winTitle='Title',btn1Text='Button1',btn2Text='Button2',initVal='someVal',units='someUnit', icon='flamingo.svg'):
super(prototypeForm,self).__init__()
self.setWindowFlags(Qt.WindowStaysOnTopHint)
self.setWindowTitle(winTitle)
iconPath=join(dirname(abspath(__file__)),"icons",icon)
from PySide.QtGui import QIcon
Icon=QIcon()
Icon.addFile(iconPath)
self.setWindowIcon(Icon)
self.move(QPoint(100,250))
self.mainVL=QVBoxLayout()
self.setLayout(self.mainVL)
self.inputs=QWidget()
self.inputs.setLayout(QFormLayout())
self.edit1=QLineEdit(initVal)
self.edit1.setMinimumWidth(40)
self.edit1.setAlignment(Qt.AlignHCenter)
self.edit1.setMaximumWidth(60)
self.inputs.layout().addRow(units,self.edit1)
self.mainVL.addWidget(self.inputs)
self.radio1=QRadioButton()
self.radio1.setChecked(True)
self.radio2=QRadioButton()
self.radios=QWidget()
self.radios.setLayout(QFormLayout())
self.radios.layout().setAlignment(Qt.AlignHCenter)
self.radios.layout().addRow('move',self.radio1)
self.radios.layout().addRow('copy',self.radio2)
self.mainVL.addWidget(self.radios)
self.btn1=QPushButton(btn1Text)
self.btn1.setDefault(True)
self.btn1.setFocus()
self.btn2=QPushButton(btn2Text)
self.buttons=QWidget()
self.buttons.setLayout(QHBoxLayout())
self.buttons.layout().addWidget(self.btn1)
self.buttons.layout().addWidget(self.btn2)
self.mainVL.addWidget(self.buttons)