def catalogChange(self,*args):
while self.form.Reference.count():
self.form.Reference.removeItem(0)
for reference in self.form.Catalog.itemData(args[0]):
red = QtGui.QPixmap(16, 16)
red.fill(QtGui.QColor("red"))
green = QtGui.QPixmap(16, 16)
green.fill(QtGui.QColor("green"))
if self.is_available(self.form.Catalog.currentText(),reference):
color = green
else:
color = red
self.form.Reference.addItem(color,reference)
#item.setStyleSheet("color: green")
python类QPixmap()的实例源码
def __init__(self, filename=None):
QtGui.QApplication.__init__(self, ['Talpa'])
splash_img = QtGui.QPixmap(
get_resource('talpa_splash.png'))\
.scaled(QtCore.QSize(400, 250), QtCore.Qt.KeepAspectRatio)
self.splash = QtGui.QSplashScreen(
splash_img, QtCore.Qt.WindowStaysOnTopHint)
self.updateSplashMessage('')
self.splash.show()
self.processEvents()
self.talpa_win = TalpaMainWindow(filename=filename)
self.splash.finish(self.talpa_win)
self.aboutToQuit.connect(self.splash.deleteLater)
self.aboutToQuit.connect(self.deleteLater)
self.talpa_win.show()
rc = self.exec_()
sys.exit(rc)
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)
def setimage_connection(self):
'''
Setting image to connctivity.
'''
self.ui.lbl_connectivity.show()
loc = self.ui.comboConnLoc.currentText()
if loc == "Column flange-Beam web":
pixmap = QtGui.QPixmap(":/newPrefix/images/beam2.jpg")
pixmap.scaledToHeight(50)
pixmap.scaledToWidth(60)
self.ui.lbl_connectivity.setPixmap(pixmap)
# self.ui.lbl_connectivity.show()
elif(loc == "Column web-Beam web"):
picmap = QtGui.QPixmap(":/newPrefix/images/beam.jpg")
picmap.scaledToHeight(50)
picmap.scaledToWidth(60)
self.ui.lbl_connectivity.setPixmap(picmap)
else:
self.ui.lbl_connectivity.hide()
def __init__(self, Rebar = None):
self.CustomSpacing = None
if not Rebar:
selected_obj = FreeCADGui.Selection.getSelectionEx()[0]
self.SelectedObj = selected_obj.Object
self.FaceName = selected_obj.SubElementNames[0]
else:
self.FaceName = Rebar.Base.Support[0][1][0]
self.SelectedObj = Rebar.Base.Support[0][0]
self.form = FreeCADGui.PySideUic.loadUi(os.path.splitext(__file__)[0] + ".ui")
self.form.setWindowTitle(QtGui.QApplication.translate("RebarAddon", "Stirrup Rebar", None))
self.form.bentAngle.addItems(["135", "90"])
self.form.amount_radio.clicked.connect(self.amount_radio_clicked)
self.form.spacing_radio.clicked.connect(self.spacing_radio_clicked)
self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0]+"/icons/Stirrup.svg"))
self.form.customSpacing.clicked.connect(lambda: runRebarDistribution(self))
self.form.removeCustomSpacing.clicked.connect(lambda: removeRebarDistribution(self))
self.form.PickSelectedFace.clicked.connect(lambda: getSelectedFace(self))
self.form.toolButton.setIcon(self.form.toolButton.style().standardIcon(QtGui.QStyle.SP_DialogHelpButton))
self.form.toolButton.clicked.connect(lambda: showPopUpImageDialog(os.path.split(os.path.abspath(__file__))[0] + "/icons/StirrupDetailed.svg"))
self.Rebar = Rebar
def __init__(self, Rebar = None):
self.CustomSpacing = None
if not Rebar:
selected_obj = FreeCADGui.Selection.getSelectionEx()[0]
self.SelectedObj = selected_obj.Object
self.FaceName = selected_obj.SubElementNames[0]
else:
self.FaceName = Rebar.Base.Support[0][1][0]
self.SelectedObj = Rebar.Base.Support[0][0]
self.form = FreeCADGui.PySideUic.loadUi(os.path.splitext(__file__)[0] + ".ui")
self.form.setWindowTitle(QtGui.QApplication.translate("RebarAddon", "L-Shape Rebar", None))
self.form.orientation.addItems(["Bottom Right", "Bottom Left", "Top Right", "Top Left"])
self.form.amount_radio.clicked.connect(self.amount_radio_clicked)
self.form.spacing_radio.clicked.connect(self.spacing_radio_clicked)
self.form.customSpacing.clicked.connect(lambda: runRebarDistribution(self))
self.form.removeCustomSpacing.clicked.connect(lambda: removeRebarDistribution(self))
self.form.PickSelectedFace.clicked.connect(lambda: getSelectedFace(self))
self.form.orientation.currentIndexChanged.connect(self.getOrientation)
self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarBR.svg"))
self.form.toolButton.setIcon(self.form.toolButton.style().standardIcon(QtGui.QStyle.SP_DialogHelpButton))
self.form.toolButton.clicked.connect(lambda: showPopUpImageDialog(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarDetailed.svg"))
self.Rebar = Rebar
def __init__(self, Rebar = None):
self.form = FreeCADGui.PySideUic.loadUi(os.path.splitext(__file__)[0] + ".ui")
self.form.setWindowTitle(QtGui.QApplication.translate("Arch", "Helical Rebar", None))
if not Rebar:
normal = facenormalDirection()
else:
normal = facenormalDirection(Rebar.Base.Support[0][0], Rebar.Base.Support[0][1][0])
if not round(normal.z) in {1, -1}:
self.form.topCoverLabel.setText(translate("RebarAddon", "Left Cover"))
self.form.bottomCoverLabel.setText(translate("RebarAddon", "Right Cover"))
self.form.PickSelectedFace.clicked.connect(self.getSelectedFace)
self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/HelicalRebar.svg"))
self.form.toolButton.clicked.connect(lambda: showPopUpImageDialog(os.path.split(os.path.abspath(__file__))[0] + "/icons/HelicalRebarDetailed.svg"))
self.form.toolButton.setIcon(self.form.toolButton.style().standardIcon(QtGui.QStyle.SP_DialogHelpButton))
self.Rebar = Rebar
self.SelectedObj = None
self.FaceName = None
def __init__(self, Rebar = None):
self.CustomSpacing = None
if not Rebar:
selected_obj = FreeCADGui.Selection.getSelectionEx()[0]
self.SelectedObj = selected_obj.Object
self.FaceName = selected_obj.SubElementNames[0]
else:
self.FaceName = Rebar.Base.Support[0][1][0]
self.SelectedObj = Rebar.Base.Support[0][0]
self.form = FreeCADGui.PySideUic.loadUi(os.path.splitext(__file__)[0] + ".ui")
self.form.setWindowTitle(QtGui.QApplication.translate("RebarAddon", "U-Shape Rebar", None))
self.form.orientation.addItems(["Bottom", "Top", "Right", "Left"])
self.form.amount_radio.clicked.connect(self.amount_radio_clicked)
self.form.spacing_radio.clicked.connect(self.spacing_radio_clicked)
self.form.customSpacing.clicked.connect(lambda: runRebarDistribution(self))
self.form.removeCustomSpacing.clicked.connect(lambda: removeRebarDistribution(self))
self.form.PickSelectedFace.clicked.connect(lambda: getSelectedFace(self))
self.form.orientation.currentIndexChanged.connect(self.getOrientation)
self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/UShapeRebarBottom.svg"))
self.form.toolButton.setIcon(self.form.toolButton.style().standardIcon(QtGui.QStyle.SP_DialogHelpButton))
self.form.toolButton.clicked.connect(lambda: showPopUpImageDialog(os.path.split(os.path.abspath(__file__))[0] + "/icons/UShapeRebarDetailed.svg"))
self.Rebar = Rebar
def _new_graph(self):
self._graph = QtGui.QPixmap(self.width(), self.height())
self._graph.fill(Qt.black)
def _new_reticle(self):
self._reticle = QtGui.QPixmap(self.width(), self.height())
self._reticle.fill(Qt.transparent)
def __init__(self, *args, **kw):
url = kw.pop('url', None)
first = False
if not url:
url = "http://localhost:7070"
path = os.path.join(get_path_prefix(), 'leap', 'authtoken')
waiting = 20
while not os.path.isfile(path):
if waiting == 0:
# If we arrive here, something really messed up happened,
# because touching the token file is one of the first
# things the backend does, and this BrowserWindow
# should be called *right after* launching the backend.
raise NoAuthToken(
'No authentication token found!')
time.sleep(0.1)
waiting -= 1
token = open(path).read().strip()
url += '#' + token
first = True
self.url = url
self.closing = False
super(QWebView, self).__init__(*args, **kw)
self.setWindowTitle('Bitmask')
self.bitmask_browser = NewPageConnector(self) if first else None
self.loadPage(self.url)
self.proxy = AppProxy(self) if first else None
self.frame.addToJavaScriptWindowObject(
"bitmaskApp", self.proxy)
icon = QtGui.QIcon()
icon.addPixmap(
QtGui.QPixmap(":/mask-icon.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.setWindowIcon(icon)
def set_icon(self, icon):
self.type_icon.setPixmap(QtGui.QPixmap(icon))
def set_icon(self, icon, width, height):
self.icon.setPixmap(QtGui.QPixmap(icon).scaled(width, height, QtCore.Qt.KeepAspectRatio))
def __init__(self, parent=None):
QtGui.QWizard.__init__(self, parent)
self.setWindowTitle(u"Export PCB")
self.setPixmap(QtGui.QWizard.LogoPixmap, QtGui.QPixmap(":/data/img/exportModel.png"))
self.exportType = eagle()
###
self.addPage(self.formatPliku())
self.addPage(self.exportUstawienia())
#
self.listaFormatow.setCurrentRow(0)
self.button(QtGui.QWizard.FinishButton).clicked.connect(self.export)
def __init__(self, parent=None):
QtGui.QLabel.__init__(self, parent)
#
self.setPixmap(QtGui.QPixmap(':/data/img/user_profile.png'))
self.setToolTip('Registration is necessary')
def __init__(self, parent=None):
QtGui.QLabel.__init__(self, parent)
#
self.setPixmap(QtGui.QPixmap(':/data/img/arrow-forward.png'))
def images_loaded(self, result):
self.midLabel.setText("Last submitted pack:")
for (card, filename), label in zip(result, self.cardLabels):
label.card = card
if card.golden:
res = QtGui.QMovie(filename)
label.card_data = res
label.setMovie(res)
res.start()
else:
res = QtGui.QPixmap(filename)
label.card_data = res
label.setPixmap(res)
label.show()
def additional_gui_setup(self):
# Additional GUI setup
self.graphicsView_banner.mouseDoubleClickEvent = MainWindow.banner_double_click
self.setWindowTitle(__appname__)
self.scene_banner = QtGui.QGraphicsScene()
self.graphicsView_banner.setScene(self.scene_banner)
self.scene_banner.addPixmap(QtGui.QPixmap(":images/banner.png"))
self._path_message("", MainWindow.MSG_OK)
self._avoid_message("", MainWindow.MSG_OK)
self.lineEdit_source.setFocus()
# Auto-completion
system_list = self.nav.eve_db.system_name_list()
for line_edit_field in [
self.lineEdit_source,
self.lineEdit_destination,
self.lineEdit_avoid_name,
self.lineEdit_set_dest,
]:
completer = QtGui.QCompleter(system_list, self)
completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
line_edit_field.setCompleter(completer)
# Signals
self.pushButton_eve_login.clicked.connect(self.btn_eve_login_clicked)
self.pushButton_player_location.clicked.connect(self.btn_player_location_clicked)
self.pushButton_find_path.clicked.connect(self.btn_find_path_clicked)
self.pushButton_crest_config.clicked.connect(self.btn_crest_config_clicked)
self.pushButton_trip_config.clicked.connect(self.btn_trip_config_clicked)
self.pushButton_trip_get.clicked.connect(self.btn_trip_get_clicked)
self.pushButton_avoid_add.clicked.connect(self.btn_avoid_add_clicked)
self.pushButton_avoid_delete.clicked.connect(self.btn_avoid_delete_clicked)
self.pushButton_avoid_clear.clicked.connect(self.btn_avoid_clear_clicked)
self.pushButton_set_dest.clicked.connect(self.btn_set_dest_clicked)
self.pushButton_reset.clicked.connect(self.btn_reset_clicked)
self.lineEdit_source.returnPressed.connect(self.line_edit_source_return)
self.lineEdit_destination.returnPressed.connect(self.line_edit_destination_return)
self.lineEdit_avoid_name.returnPressed.connect(self.line_edit_avoid_name_return)
self.lineEdit_set_dest.returnPressed.connect(self.btn_set_dest_clicked)
self.tableWidget_path.itemSelectionChanged.connect(self.table_item_selection_changed)
def _new_graph(self):
self._graph = QtGui.QPixmap(self.width(), self.height())
self._graph.fill(Qt.black)
def _new_reticle(self):
self._reticle = QtGui.QPixmap(self.width(), self.height())
self._reticle.fill(Qt.transparent)
def joinIconPaths(self):
# Icon's aren't pathed properly if the CWD is somewhere else than the source folder, so...
self.source_dir = os.path.dirname( os.path.realpath(__file__) )
# Join all the icons and reload them
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/CINAlogo.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MainWindow.setWindowIcon(icon)
self.label_2.setPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/CINAlogo.png")))
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/folder.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbOpenCachePath.setIcon(icon1)
self.tbOpenQsubHeader.setIcon(icon1)
self.tbGautoOpenTemplate.setIcon(icon1)
self.ui_FileLocDialog.tbOpenGainRefPath.setIcon(icon1)
self.ui_FileLocDialog.tbOpenFiguresPath.setIcon(icon1)
self.ui_FileLocDialog.tbOpenInputPath.setIcon(icon1)
self.ui_FileLocDialog.tbOpenOutputPath.setIcon(icon1)
self.ui_FileLocDialog.tbOpenRawPath.setIcon(icon1)
self.ui_FileLocDialog.tbOpenSumPath.setIcon(icon1)
self.ui_FileLocDialog.tbOpenAlignPath.setIcon(icon1)
self.ui_OrienGainRefDialog.tbOrientGain_GainRef.setIcon(icon1)
self.ui_OrienGainRefDialog.tbOrientGain_TargetStack.setIcon(icon1)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/go-next.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbRun.setIcon(icon2)
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/process-stop.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbKillAll.setIcon(icon3)
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/user-trash.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbDeleteFile.setIcon(icon4)
icon5 = QtGui.QIcon()
icon5.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/boxes.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbParticlePick.setIcon(icon5)
icon6 = QtGui.QIcon()
icon6.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/view-refresh.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbReprocess.setIcon(icon6)
def joinIconPaths(self):
# Icon's aren't pathed properly if the CWD is somewhere else than the source folder, so...
self.source_dir = os.path.dirname( os.path.realpath(__file__) )
# Join all the icons and reload them
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/application-resize.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbPopoutView.setIcon(icon)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/monitor-dead.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
icon1.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/monitor-live.png")), QtGui.QIcon.Normal, QtGui.QIcon.On)
self.tbLive.setIcon(icon1)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/color.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbChangeColormap.setIcon(icon2)
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/colorbar.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbToggleColorbar.setIcon(icon3)
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/magnifier-zoom-in.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbZoomIn.setIcon(icon4)
icon5 = QtGui.QIcon()
icon5.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/magnifier-zoom-out.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbZoomOut.setIcon(icon5)
icon6 = QtGui.QIcon()
icon6.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/boxes.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbShowBoxes.setIcon(icon6)
icon7 = QtGui.QIcon()
icon7.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/logscale.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbLogIntensity.setIcon(icon7)
icon8 = QtGui.QIcon()
icon8.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/histogram.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbToggleHistogramContrast.setIcon(icon8)
icon9 = QtGui.QIcon()
icon9.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/arrow-180.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbPrevImage.setIcon(icon9)
icon10 = QtGui.QIcon()
icon10.addPixmap(QtGui.QPixmap(os.path.join( self.source_dir, "icons/arrow.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.tbNextImage.setIcon(icon10)
def _new_graph(self):
self._graph = QtGui.QPixmap(self.width(), self.height())
self._graph.fill(Qt.black)
def _new_reticle(self):
self._reticle = QtGui.QPixmap(self.width(), self.height())
self._reticle.fill(Qt.transparent)
def __init__(self):
super(SplashScreen, self).__init__(QtGui.QPixmap(pathjoin(config.RESOURCES, "tray_icon.png")),
QtCore.Qt.WindowStaysOnTopHint) # ???????
# ?? fade =1 ?? fade= 2 ??? t sleep ?? ??
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(680, 403)
self.gridLayout = QtGui.QGridLayout(Dialog)
self.gridLayout.setObjectName("gridLayout")
self.labelVersion = QtGui.QLabel(Dialog)
self.labelVersion.setObjectName("labelVersion")
self.gridLayout.addWidget(self.labelVersion, 0, 0, 1, 1)
self.labelSupport = QtGui.QLabel(Dialog)
self.labelSupport.setObjectName("labelSupport")
self.gridLayout.addWidget(self.labelSupport, 1, 0, 1, 1)
self.labelLicense = QtGui.QLabel(Dialog)
self.labelLicense.setObjectName("labelLicense")
self.gridLayout.addWidget(self.labelLicense, 2, 0, 1, 1)
self.pushButton = QtGui.QPushButton(Dialog)
self.pushButton.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/mpowertcx icon flat.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton.setIcon(icon)
self.pushButton.setIconSize(QtCore.QSize(256, 256))
self.pushButton.setFlat(True)
self.pushButton.setObjectName("pushButton")
self.gridLayout.addWidget(self.pushButton, 3, 1, 1, 1)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem, 4, 1, 1, 1)
self.licenseEdit = QtGui.QPlainTextEdit(Dialog)
self.licenseEdit.setFrameShape(QtGui.QFrame.Box)
self.licenseEdit.setReadOnly(True)
self.licenseEdit.setObjectName("licenseEdit")
self.gridLayout.addWidget(self.licenseEdit, 3, 0, 2, 1)
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(True)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 2)
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(756, 395)
self.gridLayout = QtGui.QGridLayout(Dialog)
self.gridLayout.setObjectName("gridLayout")
self.labelVersion = QtGui.QLabel(Dialog)
self.labelVersion.setObjectName("labelVersion")
self.gridLayout.addWidget(self.labelVersion, 0, 0, 1, 1)
self.labelSupport = QtGui.QLabel(Dialog)
self.labelSupport.setObjectName("labelSupport")
self.gridLayout.addWidget(self.labelSupport, 1, 0, 1, 1)
self.labelLicense = QtGui.QLabel(Dialog)
self.labelLicense.setObjectName("labelLicense")
self.gridLayout.addWidget(self.labelLicense, 2, 0, 1, 1)
self.pushButton = QtGui.QPushButton(Dialog)
self.pushButton.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/mpowertcx icon flat.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton.setIcon(icon)
self.pushButton.setIconSize(QtCore.QSize(256, 256))
self.pushButton.setFlat(True)
self.pushButton.setObjectName("pushButton")
self.gridLayout.addWidget(self.pushButton, 3, 1, 1, 1)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem, 4, 1, 1, 1)
self.licenseEdit = QtGui.QPlainTextEdit(Dialog)
self.licenseEdit.setFrameShape(QtGui.QFrame.NoFrame)
self.licenseEdit.setReadOnly(True)
self.licenseEdit.setObjectName("licenseEdit")
self.gridLayout.addWidget(self.licenseEdit, 3, 0, 2, 1)
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(True)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 2)
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def set_bg_image(self):
self.bgimage = QtGui.QPixmap("images/bg.png").scaled(self.size(), transformMode=QtCore.Qt.SmoothTransformation)
palette = QtGui.QPalette()
palette.setBrush(QtGui.QPalette.Window,self.bgimage)
self.setPalette(palette)
def set_bg_image(self):
self.bgimage = QtGui.QPixmap("images/bg.png").scaled(self.size(), transformMode=QtCore.Qt.SmoothTransformation)
palette = QtGui.QPalette()
palette.setBrush(QtGui.QPalette.Window,self.bgimage)
self.setPalette(palette)
universal_tool_template_0803.py 文件源码
项目:universal_tool_template.py
作者: shiningdesign
项目源码
文件源码
阅读 35
收藏 0
点赞 0
评论 0
def __init__(self, parent=None, mode=0):
super_class.__init__(self, parent)
#------------------------------
# class variables
#------------------------------
self.version="0.1"
self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file."
self.uiList={} # for ui obj storage
self.memoData = {} # key based variable data storage
self.location = ""
if getattr(sys, 'frozen', False):
# frozen - cx_freeze
self.location = sys.executable
else:
# unfrozen
self.location = os.path.realpath(__file__) # location: ref: sys.modules[__name__].__file__
self.name = self.__class__.__name__
self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
self.iconPix = QtGui.QPixmap(self.iconPath)
self.icon = QtGui.QIcon(self.iconPath)
self.fileType='.{0}_EXT'.format(self.name)
# Custom user variable
#------------------------------
# initial data
#------------------------------
self.memoData['data']=[]
self.setupStyle()
if isinstance(self, QtWidgets.QMainWindow):
self.setupMenu()
self.setupWin()
self.setupUI()
self.Establish_Connections()
self.loadData()
self.loadLang()