def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.setupUi(self) # Connections self.gridSweepWidget.dataRenewed.connect(self.gridFieldWidget.updateData) self.gridSweepWidget.dataRenewed.connect(self.aCorrWidget.updateData) self.gridSweepWidget.positionPicked.connect(self.updateRC) self.bumpSweepWidget.dataRenewed.connect(self.eFRExampleWidget.updateData) self.bumpSweepWidget.dataRenewed.connect(self.iFRExampleWidget.updateData) self.bumpSweepWidget.positionPicked.connect(self.updateRC) self.bumpSweepWidget.bumpSigmaUpdate.connect(self.bumpSigmaLabel.setText) self.tabWidget.currentChanged.connect(self.updateExamples) self.noise_sigmaSpinBox.valueChanged.connect(self.changeNoiseSigma) self.gESpinBox.valueChanged.connect(self.gESpinBoxChange) self.gISpinBox.valueChanged.connect(self.gISpinBoxChange) self.selectButton.clicked.connect(self.select_dir) self.loadButton.clicked.connect(self.load_dir) self.trialNumSpinBox.valueChanged.connect(self.bumpSweepWidget.setTrial) self.trialNumSpinBox.valueChanged.connect(self.updateExamples) # Default states of widgets self.loadLineEdit.setText(self.defaultBaseDir) self.useNoiseSigmaCheckBox.setCheckState(QtCore.Qt.Checked) self.r = self.gESpinBox.value() self.c = self.gISpinBox.value() self.bumpSigmaLabel.setText("???") # Initial signal distribution self.trialNumSpinBox.valueChanged.emit(self.trialNumSpinBox.value())
def __init__(self, menu, game_app): QMainWindow.__init__(self) self.menu = menu self.game_app = game_app self.layout().addWidget(menu) self.layout().addWidget(game_app) self.setMinimumSize(800, 500)
class SphairaApp(QApplication): def __init__(self, args): super(SphairaApp, self).__init__(args) name = 'Sphaira Viewer' self.setApplicationName(name) self.layer_widget = QDockWidget('Layers') self.layer_widget.setFeatures( QDockWidget.DockWidgetMovable | QDockWidget.DockWidgetFloatable ) self.layer_list = LayerListWithToolBar() self.layer_widget.setWidget(self.layer_list) self.gl_widget = SphairaView(self.layer_list) self.mainWindow = QMainWindow() self.mainWindow.setWindowTitle(name) self.mainWindow.setCentralWidget(self.gl_widget) self.mainWindow.addDockWidget( QtCore.Qt.DockWidgetArea.BottomDockWidgetArea, self.layer_widget, ) self.mainWindow.resize(800, 600) self.mainWindow.showMaximized() def load_file(self, file_name, in_format): return self.gl_widget.load_file(file_name, in_format)
def __init__(self, user, parent=None): QMainWindow.__init__(self, None) self.nurse_app = Nurse.NurseApplication() self.parent = parent self.user = user self.initUI() self.initLayout()
def __init__(self, note, *args, **kwargs): QMainWindow.__init__(self, *args, **kwargs) # Configure logger. self.logger = logging.getLogger('everpad-editor') self.logger.setLevel(logging.DEBUG) fh = logging.FileHandler( os.path.expanduser('~/.everpad/logs/everpad.log')) fh.setLevel(logging.DEBUG) formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s') fh.setFormatter(formatter) self.logger.addHandler(fh) self.app = QApplication.instance() self.note = note self.closed = False self.ui = Ui_Editor() self.ui.setupUi(self) self.setWindowIcon(get_icon()) self.alternatives_template =\ self.ui.alternativeVersions.text() self.init_controls() self.load_note(note) self.update_title() self.mark_untouched() geometry = self.app.settings.value("note-geometry-%d" % self.note.id) if not geometry: geometry = self.app.settings.value("note-geometry-default") if geometry: self.restoreGeometry(geometry) self.resource_edit.note = note
def __init__(self, args, continuous): self.continuous = continuous gobject.GObject.__init__(self) #start by making our app self.app = QApplication(args) #make a window self.window = QMainWindow() #give the window a name self.window.setWindowTitle("BlatherQt") self.window.setMaximumSize(400, 200) center = QWidget() self.window.setCentralWidget(center) layout = QVBoxLayout() center.setLayout(layout) #make a listen/stop button self.lsbutton = QPushButton("Listen") layout.addWidget(self.lsbutton) #make a continuous button self.ccheckbox = QCheckBox("Continuous Listen") layout.addWidget(self.ccheckbox) #connect the buttons self.lsbutton.clicked.connect(self.lsbutton_clicked) self.ccheckbox.clicked.connect(self.ccheckbox_clicked) #add a label to the UI to display the last command self.label = QLabel() layout.addWidget(self.label) #add the actions for quiting quit_action = QAction(self.window) quit_action.setShortcut('Ctrl+Q') quit_action.triggered.connect(self.accel_quit) self.window.addAction(quit_action)
def __init__(self): QMainWindow.__init__(self) Window = QWorkspace() Window.setWindowTitle('Inventario') self.setGeometry(500, 500, 300, 300)
def __init__(self, *args, **kwargs): QMainWindow.__init__(self, *args, **kwargs) self.installEventFilter(self) self.setWindowFlags(QtCore.Qt.Drawer) self.layoutWidget = QWidget() self.setCentralWidget(self.layoutWidget) self.layout = QVBoxLayout(self.layoutWidget) self.layout.setContentsMargins(5, 5, 5, 5) self.ui_labels = UI_labels() self.ui_driverAttr1 = UI_attrlist() self.ui_driverAttr2 = UI_attrlist() self.ui_buttons = UI_buttons() self.layout.addWidget(self.ui_labels) self.layout.addWidget(self.ui_driverAttr1) self.layout.addWidget(self.ui_driverAttr2) self.layout.addWidget(self.ui_buttons) self.ui_driverAttr1.lineEdit_key.setText('0') self.ui_driverAttr1.lineEdit_value.setText('0') self.ui_driverAttr2.lineEdit_key.setText('1') self.ui_driverAttr2.lineEdit_value.setText('1') def addLineCommand(): numItems = self.layout.count() attrlist = UI_attrlist() self.layout.insertWidget(numItems - 1, attrlist) self.ui_buttons.button_connect.clicked.connect( partial(Commands.connectCommand, self)) self.ui_buttons.button_addLine.clicked.connect(addLineCommand)
def __init__(self, *args, **kwargs ): QMainWindow.__init__( self, *args, **kwargs ) self.installEventFilter( self ) self.setObjectName( Window.objectName ) self.setWindowTitle( Window.title ) mainWidget = QWidget(); self.setCentralWidget( mainWidget ) mainLayout = QVBoxLayout( mainWidget ) addButtonsLayout = QHBoxLayout() buttonAddTab = QPushButton( 'Add Tab' ) buttonAddLine = QPushButton( 'Add Line' ) addButtonsLayout.addWidget( buttonAddTab ) addButtonsLayout.addWidget( buttonAddLine ) tabWidget = TabWidget() self.tabWidget = tabWidget buttonLayout = QHBoxLayout() buttonCreate = QPushButton( "Create" ) buttonClose = QPushButton( "Close" ) buttonLayout.addWidget( buttonCreate ) buttonLayout.addWidget( buttonClose ) mainLayout.addLayout( addButtonsLayout ) mainLayout.addWidget( tabWidget ) mainLayout.addLayout( buttonLayout ) QtCore.QObject.connect( buttonAddTab, QtCore.SIGNAL( 'clicked()' ), partial( self.addTab ) ) QtCore.QObject.connect( buttonAddLine, QtCore.SIGNAL( "clicked()" ), partial( tabWidget.addLine ) ) QtCore.QObject.connect( buttonCreate, QtCore.SIGNAL( "clicked()" ), self.cmd_create ) QtCore.QObject.connect( buttonClose, QtCore.SIGNAL( "clicked()" ), self.cmd_close )
def __init__(self, parent = None): QMainWindow.__init__(self); # Initialize the base class self.setWindowTitle('Meso 18/19 Sounding Processor'); # Set the window title self.src_dir = None; # Set attribute for source data directory to None self.dst_dir = None; # Set attribute for destination data directory to None self.dst_dirFull = None; # Set attribute for destination data directory to None self.iopName = None; # Set attribute for the IOP name to None self.dateFrame = None; # Set attribute for the date QFrame to None self.date = None; self.date_str = None; # Set attribute for date string self.skew = None; # Set attribute for the skewt plot to None self.sndDataFile = None; # Set attribute for sounding data input file self.sndDataPNG = None; # Set attribute for sounding image file self.ftpInfo = None; # Set attribute for ftp info self.ranFTP = False; # Boolean to check if FTP uploading has been tried self.config = ConfigParser.RawConfigParser(); # Initialize a ConfigParser; required for the SPCWidget self.timeCheck.connect( self.on_timeCheck ); # Connect on_timeCheck method to the timeCheck signal if not self.config.has_section('paths'): # If there is no 'paths' section in the parser self.config.add_section( 'paths' ); # Add a 'paths' section to the parser self.log = logging.getLogger( __name__ ); # Get a logger rfh = RotatingFileHandler(_logfile,maxBytes=_logsize,backupCount=_logcount);# Create rotating file handler rfhFMT = logging.Formatter( '%(asctime)s - ' + settings.log_fmt ); # Logger format rfh.setFormatter( rfhFMT ) rfh.setLevel( logging.DEBUG ); # Set log level to debug self.log.addHandler( rfh ); # Add handler to main logger self.initUI(); # Run method to initialize user interface
def __init__(self): """ Constructor Function """ QMainWindow.__init__(self) self.setWindowTitle("A Simple Text Editor") self.setWindowIcon(QIcon('appicon.png')) self.setGeometry(300, 250, 400, 300)
def __init__(self, number=1): QApplication.__init__(self, sys.argv) self.setApplicationName("SphereTest") self.mainWindow = QMainWindow() self.gl_widget = proPixx480_1440test() self.mainWindow.setCentralWidget(self.gl_widget) self.mainWindow.setGeometry( QtGui.QDesktopWidget().availableGeometry(1)) self.mainWindow.showFullScreen() self.curr_time = time.time() self.timer = QTimer() self.timer.setInterval(0) self.timer.timeout.connect(self.gl_widget.update) self.timer.start() self.timer2 = QTimer() self.timer2.setInterval(3000) self.timer2.timeout.connect(self.printFrames) self.timer2.start() self.gl_widget.mode = number self.gl_widget.mouseDoubleClickEvent = lambda x: self.mainWindow.close( ) self.previous_time = 0 self.previous_total = 0 my_device = PROPixx() if number is 0: # 480 Hz my_device.setDlpSequencerProgram('QUAD4X') else: # 1440 Hz my_device.setDlpSequencerProgram('QUAD12X') my_device.updateRegisterCache() sys.exit(self.exec_()) # Start Qt main loop
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.setWindowFilePath('No file') # the media object controls the playback self.media = Phonon.MediaObject(self) # the audio output does the actual sound playback self.audio_output = Phonon.AudioOutput(Phonon.MusicCategory, self) # a slider to seek to any given position in the playback self.seeker = Phonon.SeekSlider(self) self.setCentralWidget(self.seeker) # link media objects together. The seeker will seek in the created # media object self.seeker.setMediaObject(self.media) # audio data from the media object goes to the audio output object Phonon.createPath(self.media, self.audio_output) # set up actions to control the playback self.actions = self.addToolBar('Actions') for name, label, icon_name in self.ACTIONS: icon = self.style().standardIcon(icon_name) action = QAction(icon, label, self) action.setObjectName(name) self.actions.addAction(action) if name == 'open': action.triggered.connect(self._ask_open_filename) else: action.triggered.connect(getattr(self.media, name)) # whenever the playback state changes, show a message to the user self.media.stateChanged.connect(self._show_state_message)
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.chat_widget = ChatWidget(self) self.setCentralWidget(self.chat_widget) # set up all actions self.chat_widget.message.connect(self.statusBar().showMessage) app_menu = self.menuBar().addMenu('&Application') self.connect_action = QAction('&Connect', self) self.connect_action.triggered.connect(self._connect) self.connect_action.setShortcut('Ctrl+C') app_menu.addAction(self.connect_action) app_menu.addSeparator() self.quit_server_action = QAction('Quit &server', self) self.quit_server_action.triggered.connect(self._quit_server) self.quit_server_action.setEnabled(False) self.quit_server_action.setShortcut('Ctrl+D') app_menu.addAction(self.quit_server_action) quit_action = QAction( self.style().standardIcon(QStyle.SP_DialogCloseButton), '&Quit', self) quit_action.triggered.connect(QApplication.instance().quit) quit_action.setShortcut('Ctrl+Q') app_menu.addAction(quit_action) # attempt to connect self._connect()
def _init_widgets(self): main = QMainWindow() main.setWindowFlags(Qt.Widget) # main.setCorner(Qt.TopLeftCorner, Qt.TopDockWidgetArea) # main.setCorner(Qt.TopRightCorner, Qt.RightDockWidgetArea) pathtree = QPathTree(self, self.workspace, parent=main) pathtree_dock = QDockWidget('PathTree', pathtree) main.setCentralWidget(pathtree_dock) # main.addDockWidget(Qt.BottomDockWidgetArea, pathtree_dock) pathtree_dock.setWidget(pathtree) simgrs_logic = self.workspace.instance.simgrs if self.workspace.instance is not None else None simgrs = QSimulationManagers(simgrs_logic, main) pathgroups_dock = QDockWidget('SimulationManagers', simgrs) main.addDockWidget(Qt.RightDockWidgetArea, pathgroups_dock) pathgroups_dock.setWidget(simgrs) state_viewer = StateInspector(self.workspace, parent=self) state_viewer_dock = QDockWidget('Selected State', state_viewer) main.addDockWidget(Qt.RightDockWidgetArea, state_viewer_dock) state_viewer_dock.setWidget(state_viewer) self._pathtree = pathtree self._simgrs = simgrs self._state_viewer = state_viewer main_layout = QHBoxLayout() main_layout.addWidget(main) main_layout.setContentsMargins(0, 0, 0, 0) self.setLayout(main_layout)
def __init__(self, *args, **kwargs ): QMainWindow.__init__( self, *args, **kwargs ) self.installEventFilter( self ) self.setWindowFlags(QtCore.Qt.Drawer) self.layoutWidget = QWidget() self.setCentralWidget( self.layoutWidget ) self.layout = QVBoxLayout( self.layoutWidget ) self.layout.setContentsMargins( 5,5,5,5 ) self.ui_labels = UI_labels() self.ui_driverAttr1 = UI_attrlist() self.ui_driverAttr2 = UI_attrlist() self.ui_buttons = UI_buttons() self.layout.addWidget( self.ui_labels ) self.layout.addWidget( self.ui_driverAttr1 ) self.layout.addWidget( self.ui_driverAttr2 ) self.layout.addWidget( self.ui_buttons ) self.ui_driverAttr1.lineEdit_key.setText( '0' ) self.ui_driverAttr1.lineEdit_value.setText( '0' ) self.ui_driverAttr2.lineEdit_key.setText( '1' ) self.ui_driverAttr2.lineEdit_value.setText( '1' ) def addLineCommand(): numItems = self.layout.count() attrlist = UI_attrlist() self.layout.insertWidget( numItems-1, attrlist ) self.ui_buttons.button_connect.clicked.connect( partial( Commands.connectCommand, self ) ) self.ui_buttons.button_addLine.clicked.connect( addLineCommand )
def __init__(self): QMainWindow.__init__(self) # self.setWindowIcon(QIcon('./FiSig/icon/icon_fifi.png')) # self.setAcceptDrops(True) # ==================================== # メンバ変数の定義 # ==================================== self.fileName = None # パス名 path の正規化された絶対パスを返します。 self.abspath = None # パス名 path の末尾のファイル名部分を返します。 self.basename = None # パス名 path のディレクトリ名を返します。 self.dirname = None # pathが実在するパスか、オープンしているファイル記述子を参照している場合 True を返します。 self.exists = None # 拡張子無しファイル名と、拡張子を返す self.name, self.ext = None, None # ==================================== # UIの生成 # ==================================== # QListViewを使うためには下のコードを書くだけ self.myListView = FileListView() self.widget = QWidget() layout = QVBoxLayout(self.widget) layout.addWidget(self.myListView) self.setCentralWidget(self.widget) # ==================================== # シグナルスロットのコネクト # ==================================== self.connect(self.myListView, SIGNAL("clicked(QModelIndex)"), self.slot1)
def closeEvent(self, event): """ OVERRIDE... Insures proper garbage collection of UI """ self.deleteLater() QMainWindow.closeEvent(self, event)
def __init__(self, html, app, hub, debug=False): QMainWindow.__init__(self) self.app = app self.hub = hub self.debug = debug self.html = html self.url = "file:///" \ + os.path.join(self.app.property("ResPath"), "www/", html ).replace('\\', '/') self.is_first_load = True self.view = web_core.QWebView(self) if not self.debug: self.view.setContextMenuPolicy(qt_core.Qt.NoContextMenu) self.view.setCursor(qt_core.Qt.ArrowCursor) self.view.setZoomFactor(1) self.setWindowTitle(APP_NAME) self.icon = self._getQIcon('evominer_64x64.png') self.setWindowIcon(self.icon) self.setCentralWidget(self.view) self.center()
def __init__(self): QMainWindow.__init__(self) self.setWindowTitle("QSingleApplication Demo") labelText = "<b>dallagnese.fr recipe</b><br /><br />\ Allows you to start your program only once.<br />\ Parameters of later calls can be handled by this application." self.setCentralWidget(QLabel(labelText))
def __init__(self): """ Constructor Function """ QMainWindow.__init__(self) self.setWindowTitle("A Simple Text Editor") self.setWindowIcon(QIcon('iconos/prueba.png')) self.setGeometry(300, 250, 400, 300)
def __init__(self, debug_index=None): ''' Set up all state and control that the application requires. ''' QMainWindow.__init__(self) self.setAttribute(QtCore.Qt.WA_AcceptTouchEvents) self.DEBUG_MODE = debug_index self.USE_AUTO_MODE = False self.shared_prefs = SharedPreferences() self.initialize_model_view_controller() self.controller.set_auto_mode(self.USE_AUTO_MODE) # put the window at the screen position (100, 30) # with size 480 by 800 self.setGeometry(100, 30, 480, 800) self.show() # every 5 seconds re-render the sky and run updates self.update_rendering() self.timer = QtCore.QTimer(self) self.timer.timeout.connect(self.update_rendering) self.timer.setInterval(5000) self.timer.start()
def __init__(self, *args, **kwargs): QMainWindow.__init__(self, *args, **kwargs) self.app = QApplication.instance() self.closed = False self.sort_order = None self.ui = Ui_List() self.ui.setupUi(self) self.setWindowIcon(get_icon()) self.app.data_changed.connect(self._reload_notebooks_list) self.notebooksModel = QStandardItemModel() self.ui.notebooksList.setModel(self.notebooksModel) self.ui.notebooksList.selection.connect(self.selection_changed) self.ui.notebooksList.setContextMenuPolicy(Qt.CustomContextMenu) self.ui.notebooksList.customContextMenuRequested.connect(self.notebook_context_menu) self.notesModel = QStandardItemModel() self.notesModel.setHorizontalHeaderLabels( [self.tr('Title'), self.tr('Last Updated')]) self.ui.notesList.setModel(self.notesModel) self.ui.notesList.doubleClicked.connect(self.note_dblclicked) self.ui.notesList.setContextMenuPolicy(Qt.CustomContextMenu) self.ui.notesList.customContextMenuRequested.connect(self.note_context_menu) self.ui.notesList.header().sortIndicatorChanged.connect(self.sort_order_updated) self.ui.newNotebookBtn.setIcon(QIcon.fromTheme('folder-new')) self.ui.newNotebookBtn.clicked.connect(self.new_notebook) self.ui.newNoteBtn.setIcon(QIcon.fromTheme('document-new')) self.ui.newNoteBtn.clicked.connect(self.new_note) self.ui.newNoteBtn.setShortcut(QKeySequence(self.tr('Ctrl+n'))) self.ui.newNotebookBtn.setShortcut(QKeySequence(self.tr('Ctrl+Shift+n'))) QShortcut(QKeySequence(self.tr('Ctrl+q')), self, self.close)
def closeEvent(self, event): """ Handles the user requesting the window to close. """ # If the 'Handler' allowed the window to close, then pass the request # along to the standard Qt event handler, which will close the window: if getattr(self, "_closed", False): QMainWindow.closeEvent(self, event)
def __init__(self, parent=None): """ Constructor of main window. """ QMainWindow.__init__(self, parent) self.setupUi(self) self.center()
def __init__(self, note, *args, **kwargs): QMainWindow.__init__(self, *args, **kwargs) # Configure logger. self.logger = logging.getLogger("everpad-editor") self.logger.setLevel(logging.DEBUG) fh = logging.FileHandler(os.path.expanduser("~/.everpad/logs/everpad.log")) fh.setLevel(logging.DEBUG) formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") fh.setFormatter(formatter) self.logger.addHandler(fh) self.app = QApplication.instance() self.timer = QBasicTimer() self.note = note self.closed = False self.ui = Ui_Editor() self.ui.setupUi(self) self.setWindowIcon(get_icon()) self.alternatives_template = self.ui.alternativeVersions.text() self.init_controls() self.load_note(note) self.update_title() self.mark_untouched() geometry = self.app.settings.value("note-geometry-%d" % self.note.id) if not geometry: geometry = self.app.settings.value("note-geometry-default") if geometry: self.restoreGeometry(geometry) self.resource_edit.note = note self.timer.start(10000, self)
class Form(QDialog): def __init__(self, parent=None): super(Form, self).__init__() self.tab = QTabWidget() # Add demo data for tab 1 x = np.random.normal(size=1000) y = np.random.normal(size=1000) plot1 = PlotWidget() plot1.plot(x, y, pen=None, symbol='o') self.tab.insertTab(0, plot1, "random") # Add demo data for tab 2 x = np.linspace(0, 6*np.pi, 1000) y = np.sin(x) plot2 = PlotWidget() plot2.plot(x, y) self.tab.insertTab(1, plot2, "sinus") self.main_window = QMainWindow() self.main_window.setCentralWidget(self.tab) self.main_window.show() # Force the window to stay on top self.setWindowFlags(Qt.WindowStaysOnTopHint)
def __init__(self, parent=None): # Set up everything QMainWindow.__init__(self, parent) self.setWindowTitle("USB4000 Control") self.make_main_frame() self.spectra_timer = QTimer() self.spectra_timer.timeout.connect(self.update_spectrum) self.temp_timer = QTimer() self.temp_timer.timeout.connect(self.update_temp) self.worker = Usb4000Thread() self.wavelength_mapping = self.worker.dev.get_wavelength_mapping() self.curves = [] self.persistence_sb.valueChanged.connect(self.change_persistence) self.change_persistence() self.background = 1 self.bg_min = 0 self.use_background = False self.abs645 = pg.InfiniteLine(angle=90, movable=False) self.abs663 = pg.InfiniteLine(angle=90, movable=False) self.plot.addItem(self.abs645, ignoreBounds=True) self.plot.addItem(self.abs663, ignoreBounds=True) self.abs645.setPos(645) self.abs663.setPos(663) self.conc_deque = deque(maxlen=20)
def __init__(self): QMainWindow.__init__(self) self.setWindowTitle("Salary Manager") self.setGeometry(50,50, 800, 600) self.setWindowIcon(QIcon("Resources/rupee.png")) self.widgetStack = QStackedWidget() self.setCentralWidget(self.widgetStack) self.pages = { "Login": LoginWidget, "Home": HomeWidget, "Add Employee": AddEmployeeWidget, "Del Employee": DelEmployeeWidget, "Edit Employee": EditEmployeeWidget, "Show Employee": ShowEmployeeWidget, "Add Designation": AddDesignationWidget, "Show Designation": ShowDesigationWidget, "Calc Salary": CalculateSalaryWidget, "Result": ShowPaySlipWidget } self.gotoPage("Login")
def __init__(self, *args, **kwargs): QMainWindow.__init__(self, *args, **kwargs) self.installEventFilter(self) self.setWindowFlags(QtCore.Qt.Drawer) self.layoutWidget = QWidget() self.setCentralWidget(self.layoutWidget) self.layout = QVBoxLayout(self.layoutWidget) self.layout.setContentsMargins(5, 5, 5, 5) hLayoutWidget = QWidget() self.addTabButton = AddTabButton("Add Tab") self.duplicateButton = AddTabButton("Duplicate Tab") hLayout = QHBoxLayout(hLayoutWidget) hLayout.setContentsMargins(5, 5, 5, 5) hLayout.addWidget(self.addTabButton) hLayout.addWidget(self.duplicateButton) self.tabWidget = Tab() self.layout.addWidget(hLayoutWidget) self.layout.addWidget(self.tabWidget) self.addTabButton.clicked.connect(self.promptDialog) self.duplicateButton.clicked.connect(self.duplicateDialog)
def __init__(self, user, parent=None): QMainWindow.__init__(self, None) self.crtlDatabase = Doctor.DoctorApplication() self.parent = parent self.user = user self.initUI() self.initLayout()
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.setupUi(self) self.daliyTable.setEditTriggers( QAbstractItemView.NoEditTriggers) # 表格内容禁止修改 self.daliyTable.setSortingEnabled(True) # 设置表格可排序 self.daliyTable.verticalHeader().hide() # 隐藏边栏序号 # 设置 dataLabel 显示的默认日期 self.date = self.daliyCalendar.selectedDate() self.dataLabel.setText(u"日期: " + self.date.toString()) # 设置 daliyTable 头部信息 self.db_dataName = config.db_dataName self.daliyTable.setColumnCount(len(self.db_dataName)) self.daliyTable.setHorizontalHeaderLabels(self.db_dataName.keys()) self.daliyTable.setColumnWidth(0, 50) self.daliyTable.setColumnWidth(1, 220) self.daliyTable.setColumnWidth(2, 350) self.daliyTable.setColumnWidth(3, 80) self.daliyTable.setColumnWidth(4, 50) self.daliyTable.setColumnWidth(5, 70) self.daliyTable.setColumnWidth(6, 500) self.set_table_info(self.date) self.daliyCalendar.selectionChanged.connect( self.on_daliyCalendar_selectionChanged) self.set_style_sheet()
def __init__(self, *args, **kwargs ): QMainWindow.__init__( self, *args, **kwargs ) self.installEventFilter( self ) self.setWindowFlags(QtCore.Qt.Drawer) self.layoutWidget = QWidget() self.setCentralWidget( self.layoutWidget ) self.layout = QVBoxLayout( self.layoutWidget ) self.layout.setContentsMargins( 5,5,5,5 ) self.ui_labels = UI_labels() self.ui_driverAttr = UI_attrlist() #self.ui_options = UI_options() self.ui_buttons = UI_buttons() self.layout.addWidget( self.ui_labels ) self.layout.addWidget( self.ui_driverAttr ) #self.layout.addWidget( self.ui_options ) self.layout.addWidget( self.ui_buttons ) def addLineCommand(): numItems = self.layout.count() attrlist = UI_attrlist() self.layout.insertWidget( numItems-2, attrlist ) def setAttrCommand(): import pymel.core cmds.undoInfo( ock=1 ) sels = pymel.core.ls( sl=1 ) numItems = self.layout.count() for i in range( 1, numItems-1 ): targetWidget = self.layout.itemAt( i ).widget() attrName = targetWidget.lineEdit_srcAttr.text() attrValue = targetWidget.lineEdit_dstAttr.text() if not attrName or not attrValue: continue for sel in sels: attrType = sel.attr( attrName ).type() if attrType == 'string': sel.attr( attrName ).set( attrValue ) else: print "attr value : ", attrValue if attrValue.find( ',' ) != -1: values = [ float( value ) for value in attrValue.split( ',' ) ] sel.attr( attrName ).set( values ) else: sel.attr( attrName ).set( float( attrValue ) ) cmds.undoInfo( cck=1 ) self.ui_buttons.button_connect.clicked.connect( setAttrCommand ) self.ui_buttons.button_addLine.clicked.connect( addLineCommand )
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.setWindowTitle('Table test') view = AutoSizeTableView(self) view.auto_resize_columns = True model = SimpleTableModel([['foo', 'bar'], ['spam', 'eggs']], view) view.setModel(model) self.setCentralWidget(view)
def __init__(self): QMainWindow.__init__(self) self.setupUi(self) self.load_ini() self.tblTuring.setModel(self.turing_model) self.actionLoad.triggered.connect(self.load_machine) self.tblTuring.setItemDelegate(Cell_Delegate())
def __init__(self, parent=None): """ Constructor @param parent reference to the parent widget (QWidget) """ QMainWindow.__init__(self, parent) self.setupUi(self)
def __init__(self): QMainWindow.__init__(self) self.setWindowTitle('Galaga-Esque') self.level_controller = LevelController(self) self.level_controller.run() self.showFullScreen()
def __init__(self): QMainWindow.__init__(self) self.setWindowTitle("Main Window") self.setGeometry(300, 250, 400, 300) self.statusLabel = QLabel('Showing Progress') self.progressBar = QProgressBar() self.progressBar.setMinimum(0) self.progressBar.setMaximum(100)
def __init__(self, *args, **kwargs ): QMainWindow.__init__( self, *args, **kwargs ) self.installEventFilter( self ) self.setWindowTitle( Window_global.title ) self.mainWidget = QWidget() self.setCentralWidget( self.mainWidget )
def __init__(self): QMainWindow.__init__(self) # setup ui (the pcef GenericEditor is created there using # the promoted widgets system) self.ui = simple_editor_ui.Ui_MainWindow() self.ui.setupUi(self) self.setWindowTitle("PCEF - Generic Example") editor = self.ui.genericEditor # open this file try: openFileInEditor(self.ui.genericEditor, __file__) except: pass # install Panel where user can add its own markers p = UserMarkersPanel() editor.installPanel(p, editor.PANEL_ZONE_LEFT) # add a fold indicator around our class and the main editor.foldPanel.addIndicator(136, 141) # add styles actions allStyles = styles.getAllStyles() allStyles.sort() self.styleActionGroup = QActionGroup(self) for style in allStyles: action = QAction(unicode(style), self.ui.menuStyle) action.setCheckable(True) action.setChecked(style == "Default") self.styleActionGroup.addAction(action) self.ui.menuStyle.addAction(action) self.styleActionGroup.triggered.connect( self.on_styleActionGroup_triggered) # add panels actions allPanels = self.ui.genericEditor.panels() allPanels.sort() self.panels_actions = [] for panel in allPanels: action = QAction(unicode(panel), self.ui.menuPanels) action.setCheckable(True) action.setChecked(panel.enabled) self.ui.menuPanels.addAction(action) self.panels_actions.append(action) action.triggered.connect(self.onPanelActionTriggered) # add panels actions allModes = self.ui.genericEditor.modes() allModes.sort() self.modes_actions = [] for mode in allModes: action = QAction(unicode(mode), self.ui.menuModes) action.setCheckable(True) action.setChecked(mode.enabled) self.ui.menuModes.addAction(action) self.modes_actions.append(action) action.triggered.connect(self.onModeActionTriggered)
class App(QApplication): """""" def __init__(self): QApplication.__init__(self, sys.argv) self.setApplicationName("Viewer app") self.setup() self.main.setFixedSize(1264, 768) self.main.show() def setup(self): self.setup_mainwindow() def start(self): sys.exit(self.exec_()) def setup_mainwindow(self): self.main = QMainWindow() self.setup_centralwidget() self.setup_menubar() self.setup_sidebar() self.setup_statusbar() def setup_centralwidget(self): self.view = view = View(self) view.setFocusPolicy(Qt.StrongFocus) view.setFocus() self.main.setCentralWidget(view) def setup_menubar(self): self.menu = menu = self.main.menuBar() self.main.setMenuBar(menu) self.add_filemenu() def add_filemenu(self): menu = self.menu.addMenu('&File') new_action = menu.addAction('&New') new_action.triggered.connect(self.do_newfile) def do_newfile(self): print('i am doing it!') def setup_sidebar(self): self.sidebar = sidebar = QDockWidget() sidebar.setAllowedAreas(Qt.LeftDockWidgetArea) sidebar.setFeatures(QDockWidget.NoDockWidgetFeatures) sidebar.setFixedWidth(240) widget = QWidget(sidebar) # add stuff here # provide a callback? sidebar.setWidget(widget) print(sidebar.size()) self.main.addDockWidget(Qt.LeftDockWidgetArea, sidebar) def setup_statusbar(self): self.status = self.main.statusBar() self.main.setStatusBar(self.status) self.status.showMessage('status')
def __init__(self, *args, **kwargs ): QMainWindow.__init__( self, *args, **kwargs ) self.installEventFilter( self ) self.setWindowFlags(QtCore.Qt.Drawer) self.layoutWidget = QWidget() self.setCentralWidget( self.layoutWidget ) self.layout = QVBoxLayout( self.layoutWidget ) self.layout.setContentsMargins( 5,5,5,5 ) self.ui_labels = UI_labels() self.ui_driverAttr = UI_attrlist() self.ui_options = UI_options() self.ui_buttons = UI_buttons() self.layout.addWidget( self.ui_labels ) self.layout.addWidget( self.ui_driverAttr ) self.layout.addWidget( self.ui_options ) self.layout.addWidget( self.ui_buttons ) def addLineCommand(): numItems = self.layout.count() attrlist = UI_attrlist() self.layout.insertWidget( numItems-2, attrlist ) def connectCommand(): cmds.undoInfo( ock=1 ) sels = cmds.ls( sl=1 ) numItems = self.layout.count() optionWidget = self.layout.itemAt( numItems-2 ).widget() for i in range( 1, numItems-2 ): targetWidget = self.layout.itemAt( i ).widget() srcAttr = targetWidget.lineEdit_srcAttr.text() dstAttr = targetWidget.lineEdit_dstAttr.text() if not srcAttr or not dstAttr: continue try: for sel in sels[1:]: target = sel if optionWidget.checkBox.isChecked(): selParents = cmds.listRelatives( sel, p=1, f=1 ) if selParents: target = selParents[0] cmds.connectAttr( sels[0] + '.' + srcAttr, target + '.' + dstAttr ) except: pass cmds.undoInfo( cck=1 ) self.ui_buttons.button_connect.clicked.connect( connectCommand ) self.ui_buttons.button_addLine.clicked.connect( addLineCommand )
def __init__(self): self.mainwindow = QMainWindow() settings.get_settings() self.access = tuple(settings.access.items()) self.progress = QProgressDialog("Setting up modules...", "cancel", 0, 7, self.mainwindow) self.progress.setWindowTitle( QApplication.translate("MainWindow", str(settings.company), None, QApplication.UnicodeUTF8))
def __init__(self): QMainWindow.__init__(self) self.setWindowTitle("Foc for windows") self.resize(WINDOWS_SIZE) self.exe_path = full_exe_path() self.progID = PROGID_NAME self.make_central_widget("Args displayed here") if len(sys.argv) > 1: self.compute_args(sys.argv[1])
def __init__(self): QMainWindow.__init__(self) self.mplwidget = MatplotlibWidget(self, title='Example', xlabel='Linear scale', ylabel='Log scale', hold=True, yscale='log') self.mplwidget.setFocus() self.setCentralWidget(self.mplwidget) self.plot(self.mplwidget.axes)
def __init__(self, parent_title): QMainWindow.__init__(self) self.setupUi(self) self.setup_toolbar() self.setWindowTitle("{}'s Fourier".format(parent_title)) self.fourier.fourier_updated.connect(self.fourier_updated.emit) self.setup_actions() self.resize(800, 600)
def __init__(self, *args, **kwargs): QMainWindow.__init__(self, *args, **kwargs) self.installEventFilter(self) self.setWindowFlags(QtCore.Qt.Drawer) self.layoutWidget = QWidget() self.setCentralWidget(self.layoutWidget) self.layout = QVBoxLayout(self.layoutWidget) self.layout.setContentsMargins(5, 5, 5, 5) self.ui_labels = UI_labels() self.ui_driverAttr = UI_attrlist() self.ui_options = UI_options() self.ui_buttons = UI_buttons() self.layout.addWidget(self.ui_labels) self.layout.addWidget(self.ui_driverAttr) self.layout.addWidget(self.ui_options) self.layout.addWidget(self.ui_buttons) def addLineCommand(): numItems = self.layout.count() attrlist = UI_attrlist() self.layout.insertWidget(numItems - 2, attrlist) def connectCommand(): cmds.undoInfo(ock=1) sels = cmds.ls(sl=1) numItems = self.layout.count() optionWidget = self.layout.itemAt(numItems - 2).widget() for i in range(1, numItems - 2): targetWidget = self.layout.itemAt(i).widget() srcAttr = targetWidget.lineEdit_srcAttr.text() dstAttr = targetWidget.lineEdit_dstAttr.text() if not srcAttr or not dstAttr: continue try: for sel in sels[1:]: target = sel if optionWidget.checkBox.isChecked(): selParents = cmds.listRelatives(sel, p=1, f=1) if selParents: target = selParents[0] cmds.connectAttr(sels[0] + '.' + srcAttr, target + '.' + dstAttr) except: pass cmds.undoInfo(cck=1) self.ui_buttons.button_connect.clicked.connect(connectCommand) self.ui_buttons.button_addLine.clicked.connect(addLineCommand)
def __init__(self, *args, **kwargs ): self.minimum = 1 self.maximum = 100 self.lineEditMaximum = 10000 QMainWindow.__init__( self, *args, **kwargs ) self.installEventFilter( self ) #self.setWindowFlags( QtCore.Qt.Drawer ) self.setWindowTitle( Window_global.title ) widgetMain = QWidget() layoutVertical = QVBoxLayout( widgetMain ) self.setCentralWidget( widgetMain ) layoutSlider = QHBoxLayout() lineEdit = QLineEdit(); lineEdit.setFixedWidth( 100 ) lineEdit.setText( str( 1 ) ) validator = QIntValidator(self.minimum, self.lineEditMaximum, self) lineEdit.setValidator( validator ) slider = QSlider(); slider.setOrientation( QtCore.Qt.Horizontal ) slider.setMinimum( self.minimum ) slider.setMaximum( self.maximum ) layoutSlider.addWidget( lineEdit ) layoutSlider.addWidget( slider ) layoutAngle = QVBoxLayout() checkBox = QCheckBox( 'Connect Angle By Tangent' ) layoutVector = QHBoxLayout() leVx = QLineEdit(); leVx.setText( str( 1.000 ) ); leVx.setEnabled( False ) leVx.setValidator( QDoubleValidator( -100, 100, 5, self ) ) leVy = QLineEdit(); leVy.setText( str( 0.000 ) ); leVy.setEnabled( False ) leVy.setValidator( QDoubleValidator( -100, 100, 5, self ) ) leVz = QLineEdit(); leVz.setText( str( 0.000 ) ); leVz.setEnabled( False ) leVz.setValidator( QDoubleValidator( -100, 100, 5, self ) ) layoutAngle.addWidget( checkBox ) layoutAngle.addLayout( layoutVector ) layoutVector.addWidget( leVx ); layoutVector.addWidget( leVy ); layoutVector.addWidget( leVz ) button = QPushButton( 'Create' ) layoutVertical.addLayout( layoutSlider ) layoutVertical.addLayout( layoutAngle ) layoutVertical.addWidget( button ) QtCore.QObject.connect( slider, QtCore.SIGNAL('valueChanged(int)'), self.sliderValueChanged ) QtCore.QObject.connect( lineEdit, QtCore.SIGNAL('textEdited(QString)'), self.lineEditValueChanged ) QtCore.QObject.connect( button, QtCore.SIGNAL('clicked()'), Functions.createPointOnCurve ) QtCore.QObject.connect( checkBox, QtCore.SIGNAL( 'clicked()'), Functions.setAngleEnabled ) self.slider = slider self.lineEdit = lineEdit Window_global.slider = slider Window_global.button = button Window_global.checkBox = checkBox Window_global.leVx = leVx Window_global.leVy = leVy Window_global.leVz = leVz
def __init__(self, setup=False, **kwargs): QMainWindow.__init__(self) self.setWindowTitle('...') # time to syncronize plot and media object self.tShift = 0 self.t = 0 self.mpl = {} self.ca_widget_handle = [] self.ca_bar_handle = [] # bools to know if the timer is to be activated # refresh timer self.refresh = 15 # ms self.timer = QtCore.QTimer() self.timer.setInterval(self.refresh) self.lcd = QtGui.QLCDNumber(self) self.lcd.setDigitCount(5) self.lcd.display("{:+05.1f}".format(self.t)) # phonon # the media object controls the playback self.media = Phonon.MediaObject(self) self.audio_output = Phonon.AudioOutput(Phonon.MusicCategory, self) self.seeker = Phonon.SeekSlider(self) self.seeker.setFixedHeight(35) self.seeker.setMediaObject(self.media) self.media.setTickInterval(20) # audio data from the media object goes to the audio output object Phonon.createPath(self.media, self.audio_output) # set up actions to control the playback ACTIONS = [ ('play', 'Play', QStyle.SP_MediaPlay), ('pause', 'Pause', QStyle.SP_MediaPause), ('stop', 'Stop', QStyle.SP_MediaStop)] self.actions = self.addToolBar('Actions') for name, label, icon_name in ACTIONS: icon = self.style().standardIcon(icon_name) action = QtGui.QAction(icon, label, self, ) action.setObjectName(name) self.actions.addAction(action) action.triggered.connect(getattr(self.media, name)) self.actions.addSeparator() # show help helpAction = QtGui.QAction('&Help', self) helpAction.setObjectName(name) self.actions.addAction(helpAction) helpAction.triggered.connect(self.show_help) # layout self.vBox = QtGui.QVBoxLayout() hBox = QtGui.QHBoxLayout() hBox.addWidget(self.lcd) hBox.addWidget(self.seeker) self.vBox.addLayout(hBox) # finish setup if setup: self.setup(**kwargs)
def __init__(self, parent, log_file): QMainWindow.__init__(self, parent) self.view = web_core.QWebView(self) self.view.setContextMenuPolicy(qt_core.Qt.NoContextMenu) self.view.setCursor(qt_core.Qt.ArrowCursor) self.view.setZoomFactor(1) self.setCentralWidget(self.view) self.log_file = log_file self.setWindowTitle("%s - Log view [%s]" % (APP_NAME, os.path.basename(log_file)))