Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
    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")
Exemplo n.º 3
0
 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 )
Exemplo n.º 4
0
 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()
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
 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()
Exemplo n.º 7
0
	def __init__(self):

		
		QMainWindow.__init__(self)
		Window = QWorkspace()
		Window.setWindowTitle('Inventario')
		self.setGeometry(500, 500, 300, 300)
Exemplo n.º 8
0
    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
Exemplo n.º 9
0
    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 )
Exemplo n.º 10
0
    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)
Exemplo n.º 11
0
 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)
Exemplo n.º 12
0
 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)
Exemplo n.º 13
0
 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()
Exemplo n.º 14
0
 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
Exemplo n.º 15
0
 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)
Exemplo n.º 16
0
    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)
Exemplo n.º 17
0
    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)
Exemplo n.º 18
0
    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()
Exemplo n.º 19
0
    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 )
Exemplo n.º 20
0
 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))
Exemplo n.º 21
0
    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())
Exemplo n.º 22
0
 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)
Exemplo n.º 23
0
    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)
Exemplo n.º 24
0
 def __init__(self, user, parent=None):
     QMainWindow.__init__(self, None)
     self.crtlDatabase = Doctor.DoctorApplication()
     self.parent = parent
     self.user = user
     self.initUI()
     self.initLayout()
Exemplo n.º 25
0
    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)
Exemplo n.º 26
0
 def __init__(self, parent=None):
     """
     Constructor of main window.
     """
     QMainWindow.__init__(self, parent)
     self.setupUi(self)
     self.center()
Exemplo n.º 27
0
 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)
Exemplo n.º 28
0
 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()
Exemplo n.º 29
0
    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):
     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)
Exemplo n.º 31
0
 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, parent=None):
     """
     Constructor
     
     @param parent reference to the parent widget (QWidget)
     """
     QMainWindow.__init__(self, parent)
     self.setupUi(self)
Exemplo n.º 33
0
    def __init__(self):
        QMainWindow.__init__(self)

        self.setWindowTitle('Galaga-Esque')
        self.level_controller = LevelController(self)
        self.level_controller.run()
            
        self.showFullScreen()
Exemplo n.º 34
0
 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)
Exemplo n.º 35
0
    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())
Exemplo n.º 36
0
 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 )
Exemplo n.º 37
0
    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 )
Exemplo n.º 38
0
    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)
Exemplo n.º 39
0
    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)
Exemplo n.º 40
0
 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)
Exemplo n.º 41
0
    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)
Exemplo n.º 42
0
 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])
Exemplo n.º 43
0
    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)
Exemplo n.º 44
0
 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
Exemplo n.º 45
0
Arquivo: widgets.py Projeto: e-sr/KG
    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)
Exemplo n.º 46
0
 def __init__(self, *args, **kwargs):
     QMainWindow.__init__(self, *args, **kwargs)
     self.app = QApplication.instance()
     self.closed = False
     self.sort_order = None
     self._init_interface()
     self.app.data_changed.connect(self._reload_data)
     self._init_notebooks()
     self._init_tags()
     self._init_notes()
Exemplo n.º 47
0
 def __init__(self):
     QMainWindow.__init__(self)
     # filename = QFileDialog.getOpenFileName(self, "Open File")[0]
     # self.setWindowTitle(os.path.basename(filename))
     # self.transcript = StepperTranscript(filename)
     self.save_file_name = None
     self.explorer_table = None
     self.transcript = None
     self.setupUi(self)
     self.setAcceptDrops(True)
Exemplo n.º 48
0
 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)))
Exemplo n.º 49
0
 def __init__(self, *args, **kwargs):
     QMainWindow.__init__(self, *args, **kwargs)
     self.app = QApplication.instance()
     self.closed = False
     self.sort_order = None
     self._init_interface()
     self.app.data_changed.connect(self._reload_data)
     self._init_notebooks()
     self._init_tags()
     self._init_notes()
Exemplo n.º 50
0
 def __init__(self):
     """ Constructo FUnction
     """
     QMainWindow.__init__(self)
     self.setWindowTitle("Application Title Here")
     self.setGeometry(300, 250, 400, 300)
     self.statusLabel = QLabel('Showing Progress')
     self.progressBar = QProgressBar()
     self.progressBar.setMinimum(0)
     self.progressBar.setMaximum(1000000)
Exemplo n.º 51
0
 def __init__(self, parent=None):
     QMainWindow.__init__(self, parent)
     central = QWidget(self)
     layout = QVBoxLayout(central)
     self.image_label = QLabel("here's the shot", central)
     layout.addWidget(self.image_label)
     self.button = QPushButton("Shoot me!", central)
     self.button.setObjectName("shot_button")
     layout.addWidget(self.button)
     self.setCentralWidget(central)
     QMetaObject.connectSlotsByName(self)
Exemplo n.º 52
0
 def __init__(self, parent=None):
     QMainWindow.__init__(self, parent)
     central = QWidget(self)
     layout = QVBoxLayout(central)
     self.image_label = QLabel('here\'s the shot', central)
     layout.addWidget(self.image_label)
     self.button = QPushButton('Shoot me!', central)
     self.button.setObjectName('shot_button')
     layout.addWidget(self.button)
     self.setCentralWidget(central)
     QMetaObject.connectSlotsByName(self)
Exemplo n.º 53
0
    def __init__(self):
        QMainWindow.__init__(self)

        # Pre-initializing an OpenGL context can let us use opengl
        # functions without having to show the window first...
        context = QGLContext(QGLFormat())
        widget = QChemlabWidget(context, self)
        context.makeCurrent()
        self.setCentralWidget(widget)
        self.resize(1000, 800)
        self.widget = widget
Exemplo n.º 54
0
 def __init__(self, parent=None):
     QMainWindow.__init__(self, parent)
     # activate the window and use the full screen
     self.setWindowState(Qt.WindowFullScreen | Qt.WindowActive)
     # empty the mouse cursor
     self.setCursor(Qt.BlankCursor)
     # add a menu to close the window
     appmenu = QMenu('&Application', self)
     quit = QAction('&Quit', self)
     appmenu.addAction(quit)
     self.menuBar().addMenu(appmenu)
     quit.triggered.connect(QApplication.instance().quit)
Exemplo n.º 55
0
 def __init__(self, athlete, pushups): 
     QMainWindow.__init__(self)
     self.setWindowTitle("Pushup app")       
     
     self.athlete = athlete
     self.pushups = pushups
     
     self._initWidth = 1000
     self._initHeight = 600
     self.resize(QSize(self._initWidth, self._initHeight))
     
     self.createGUI()
     self._centerWindow()