Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
app = QtGui.QApplication(sys.argv)
print QtGui.QStyleFactory.keys()
nuke = Nuke()
nuke.show()
import qdarkstyle
app.setStyleSheet(qdarkstyle.load_stylesheet_pyside())
# styles = [u'Windows', u'WindowsXP', u'WindowsVista', u'Motif', u'CDE', u'Plastique', u'Cleanlooks']
QtGui.QApplication.setStyle(QtGui.QStyleFactory.create('Cleanlooks'))
# QtGui.QApplication.setStyle(QtGui.QStyleFactory.create('Plastique'))
app.exec_()
def test_create_qss():
# Should not raise a CompileError
create_qss()
self.parameter_name = str(self.comboBox_2.currentText())
def update_parameter(self):
self.comboBox_2.clear()
self.comboBox_2.addItems(self.model.parameter_names)
def onModelChanged(self):
self.model.close()
self.model = self.current_model_index
self.verticalLayout.addWidget(self.model)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
win = FRETLineGeneratorWidget()
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
win.show()
sys.exit(app.exec_())
import os
from PyQt5 import QtGui
from PyQt5.QtWidgets import QApplication
from pluto.ui.player.controllers import PlayerController
from pluto.ui.qt.mvc.routers import Router
from pluto.ui.stitcher.controllers import ImageStitchingController
from pluto.ui.qt.qtutils import QtUtil
import qdarkstyle
if __name__ == '__main__':
app = QApplication(sys.argv)
# setup stylesheet
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
app.setWindowIcon(QtGui.QIcon(QtUtil.resource_path(os.path.join('windows', 'pluto.png'))))
router = Router(app)
router.add_ctrl('player', PlayerController(router))
router.add_ctrl('image', ImageStitchingController(router))
router.go('player')
sys.exit(app.exec_())
filename = mfm.widgets.get_filename(
'Open Trajectory-File',
'H5-Trajectory-Files (*.h5)'
)
self.trajectory_file = filename
self.lineEdit.setText(self.trajectory_file)
@property
def energy(self) -> float:
return self.universe.getEnergy(self.structure)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
win = PotentialEnergyWidget()
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
win.show()
sys.exit(app.exec_())
font = QtGui.QFont('Microsoft Sans Serif', 12)
if config_client['language'] == 'cn':
config_file = os.path.join(path, 'source/gui/language/cn/live_text.yaml')
font = QtGui.QFont(u'微软雅黑', 10)
with open(os.path.expanduser(config_file), encoding='utf8') as fd:
lang_dict = yaml.load(fd)
lang_dict['font'] = font
except IOError:
print("live_text.yaml is missing")
app = QtWidgets.QApplication(sys.argv)
mainWindow = MainWindow(config_server, config_client, lang_dict)
if config_client['theme'] == 'dark':
import qdarkstyle
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
mainWindow.showMaximized()
sys.exit(app.exec_())
if self.isRunning() and single_app:
self.sendMessage("open main window")
print('An instance of Vorta is already running. Opening main window.')
sys.exit()
init_translations(self)
self.setQuitOnLastWindowClosed(False)
self.scheduler = VortaScheduler(self)
# Prepare system tray icon
self.tray = TrayMenu(self)
# Apply dark stylesheet
if SettingsModel.get(key='use_dark_theme').value:
self.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
args = parse_args()
if not (hasattr(args, 'daemonize') and args.daemonize):
if (hasattr(args, 'foreground') and args.foreground) or SettingsModel.get(key='foreground').value:
self.open_main_window_action()
self.backup_started_event.connect(self.backup_started_event_response)
self.backup_finished_event.connect(self.backup_finished_event_response)
self.backup_cancelled_event.connect(self.backup_cancelled_event_response)
self.message_received_event.connect(self.message_received_event_response)
self.set_borg_details_action()
@property
def E(self) -> float:
return float(self.doubleSpinBox_4.value())
@E.setter
def E(
self,
v: float
):
self.doubleSpinBox_4.setValue(v)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
win = FRETCalculator()
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
win.show()
sys.exit(app.exec_())
# add the image widget to the parents vertical layout
parent_vbox_layout.addWidget(image_widget)
class LeftImageCustomWidget(QtWidgets.QWidget):
def __init__(self, main_image_label):
self.main_image_label = main_image_label
def mousePressEvent(self, event):
if event.button() == Qt.LeftButton:
self.main_image_label.setPixmap(QtGui.QPixmap(self.pixmap))
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
wnd2 = MainView()
# wnd2.setWindowState(Qt.WindowFullScreen)
wnd2.show()
sys.exit(app.exec_())
def ending_changed(self):
self.filelist.filename_ending = self.ending
def open_target(self, filename=None):
if filename is None:
filename = mfm.widgets.save_file(file_type="*.photon.h5")
self.lineEdit.setText(filename)
spc_files = self.filenames
h5 = mfm.io.tttr.spc2hdf(spc_files, routine_name=self.filetype, filename=filename)
h5.close()
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
win = TTTRConvert()
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
win.show()
sys.exit(app.exec_())