Python PyQt5.QtWidgets.QPushButton() Examples

The following are code examples for showing how to use PyQt5.QtWidgets.QPushButton(). They are extracted from open source Python projects. You can vote up the examples you like or vote down the ones you don't like. You can also save this page to your account.

Example 1
Project: examples   Author: pyqt   File: ui_previewer.py    (license) View Source Project 30 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(911, 688)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(Form)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.splitter = QtWidgets.QSplitter(Form)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.editorBox = QtWidgets.QGroupBox(self.splitter)
        self.editorBox.setObjectName("editorBox")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.editorBox)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.plainTextEdit = QtWidgets.QPlainTextEdit(self.editorBox)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.verticalLayout_2.addWidget(self.plainTextEdit)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.clearButton = QtWidgets.QPushButton(self.editorBox)
        self.clearButton.setObjectName("clearButton")
        self.horizontalLayout.addWidget(self.clearButton)
        self.previewButton = QtWidgets.QPushButton(self.editorBox)
        self.previewButton.setObjectName("previewButton")
        self.horizontalLayout.addWidget(self.previewButton)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.horizontalLayout_2.addLayout(self.verticalLayout_2)
        self.previewerBox = QtWidgets.QGroupBox(self.splitter)
        self.previewerBox.setObjectName("previewerBox")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.previewerBox)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.webView = QtWebKitWidgets.QWebView(self.previewerBox)
        self.webView.setUrl(QtCore.QUrl("about:blank"))
        self.webView.setObjectName("webView")
        self.horizontalLayout_3.addWidget(self.webView)
        self.horizontalLayout_4.addWidget(self.splitter)

        self.retranslateUi(Form)
        self.clearButton.clicked.connect(self.plainTextEdit.clear)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example 2
Project: MusicPlayer   Author: HuberTRoy   File: addition.py    (license) View Source Project 11 votes vote down vote up
def __init__(self, parent=None):
        super(SearchLineEdit, self).__init__()
        self.setObjectName("SearchLine")
        self.parent = parent
        self.setMinimumSize(218, 20)
        with open('QSS/searchLine.qss', 'r') as f:
            self.setStyleSheet(f.read())

        self.button = QPushButton(self)
        self.button.setMaximumSize(13, 13)
        self.button.setCursor(QCursor(Qt.PointingHandCursor))

        self.setTextMargins(3, 0, 19, 0)

        self.spaceItem = QSpacerItem(150, 10, QSizePolicy.Expanding)

        self.mainLayout = QHBoxLayout()
        self.mainLayout.addSpacerItem(self.spaceItem)
        # self.mainLayout.addStretch(1)
        self.mainLayout.addWidget(self.button)
        self.mainLayout.addSpacing(10)
        self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.mainLayout) 
Example 3
Project: coliform-project   Author: uprm-research-resto   File: GUI.py    (GNU General Public License v3.0) View Source Project 8 votes vote down vote up
def createTopLeftGroupBox(self):
        self.topLeftGroupBox = QGroupBox("Temperature Sensor")

        tempLabel = QLabel('Temperature: ')
        self.tempValLabel = QLabel('NULL')

        plotButton = QPushButton("Show Plot")
        plotButton.clicked.connect(self.tempPlot)
        saveDataButton = QPushButton('Save Data File')
        saveDataButton.clicked.connect(self.savefile)

        vbox1 = QVBoxLayout()
        vbox1.addWidget(tempLabel)
        vbox1.addWidget(self.tempValLabel)

        vbox2 = QVBoxLayout()
        vbox2.addWidget(plotButton)
        vbox2.addWidget(saveDataButton)

        layout = QHBoxLayout()
        layout.addLayout(vbox1)
        layout.addLayout(vbox2)
        layout.addStretch(1)
        self.topLeftGroupBox.setLayout(layout) 
Example 4
Project: EMFT   Author: 132nd-etcher   File: main_ui_progress.py    (license) View Source Project 8 votes vote down vote up
def progress_start(title: str = '', length: int = 100, label: str = ''):
        MainUiProgress.progress = QProgressDialog()
        MainUiProgress.progress.setWindowFlags(Qt.FramelessWindowHint)
        MainUiProgress.progress.setWindowFlags(Qt.WindowTitleHint)
        MainUiProgress.progress.setMinimumWidth(400)
        from PyQt5.QtWidgets import QPushButton
        # QString() seems to be deprecated in v5
        # PyQt does not support setCancelButton(0) as it expects a QPushButton instance
        # Get your shit together, Qt !
        MainUiProgress.progress.findChild(QPushButton).hide()
        MainUiProgress.progress.setMinimumDuration(1)
        MainUiProgress.progress.setWindowModality(Qt.ApplicationModal)
        MainUiProgress.progress.setCancelButtonText('')
        MainUiProgress.progress.setWindowIcon(QIcon(':/ico/app.ico'))
        MainUiProgress.progress.setWindowTitle(title)
        MainUiProgress.progress.setLabelText(label)
        MainUiProgress.progress.setMaximum(length)
        MainUiProgress.progress.show() 
Example 5
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: tabs.py    (license) View Source Project 8 votes vote down vote up
def __init__(self, parent):   
        super(QWidget, self).__init__(parent)
        self.layout = QVBoxLayout(self)

        # Initialize tab screen
        self.tabs = QTabWidget()
        self.tab1 = QWidget()	
        self.tab2 = QWidget()
        self.tabs.resize(300,200) 

        # Add tabs
        self.tabs.addTab(self.tab1,"Tab 1")
        self.tabs.addTab(self.tab2,"Tab 2")

        # Create first tab
        self.tab1.layout = QVBoxLayout(self)
        self.pushButton1 = QPushButton("PyQt5 button")
        self.tab1.layout.addWidget(self.pushButton1)
        self.tab1.setLayout(self.tab1.layout)

        # Add tabs to widget        
        self.layout.addWidget(self.tabs)
        self.setLayout(self.layout) 
Example 6
Project: taobao   Author: laogewen   File: start.py    (license) View Source Project 8 votes vote down vote up
def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(564, 270)
        self.centralWidget = QtWidgets.QWidget(MainWindow)
        self.centralWidget.setObjectName("centralWidget")
        self.pushButton = QtWidgets.QPushButton(self.centralWidget)
        self.pushButton.setGeometry(QtCore.QRect(320, 60, 93, 28))
        self.pushButton.setObjectName("pushButton")
        self.textEdit = QtWidgets.QTextEdit(self.centralWidget)
        self.textEdit.setGeometry(QtCore.QRect(60, 60, 151, 31))
        self.textEdit.setObjectName("textEdit")
        self.pushButton_2 = QtWidgets.QPushButton(self.centralWidget)
        self.pushButton_2.setGeometry(QtCore.QRect(320, 150, 111, 28))
        self.pushButton_2.setObjectName("pushButton_2")
        self.label = QtWidgets.QLabel(self.centralWidget)
        self.label.setGeometry(QtCore.QRect(60, 30, 151, 16))
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(self.centralWidget)
        self.label_2.setGeometry(QtCore.QRect(60, 110, 151, 41))
        self.label_2.setObjectName("label_2")
        self.comboBox = QtWidgets.QComboBox(self.centralWidget)
        self.comboBox.setGeometry(QtCore.QRect(60, 160, 87, 22))
        self.comboBox.setObjectName("comboBox")
        MainWindow.setCentralWidget(self.centralWidget)
        self.menuBar = QtWidgets.QMenuBar(MainWindow)
        self.menuBar.setGeometry(QtCore.QRect(0, 0, 564, 26))
        self.menuBar.setObjectName("menuBar")
        MainWindow.setMenuBar(self.menuBar)
        self.mainToolBar = QtWidgets.QToolBar(MainWindow)
        self.mainToolBar.setObjectName("mainToolBar")
        MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.mainToolBar)
        self.statusBar = QtWidgets.QStatusBar(MainWindow)
        self.statusBar.setObjectName("statusBar")
        MainWindow.setStatusBar(self.statusBar)

        self.comboBox.addItems(["%s" % x for x in range(1, 100)])
        self.pushButton.clicked.connect(self.start)
        
        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow) 
Example 7
Project: pyopenvr   Author: cmbruns   File: track_hmd_qt.py    (license) View Source Project 7 votes vote down vote up
def __init__(self):
        QWidget.__init__(self)
        
        self.resize(1600, 940)
        self.setWindowTitle('OpenVR tracking data')
        
        self.webview = QWebEngineView()

        self.button = QPushButton('Quit', self)
        self.button.clicked.connect(self.close)
        layout = QVBoxLayout(self)
        layout.setSpacing(0)
        # layout.setMargin(0)
        layout.addWidget(self.button)
        layout.addWidget(self.webview)
        
        # XXX check result
        openvr.init(openvr.VRApplication_Scene)        
        poses_t = openvr.TrackedDevicePose_t * openvr.k_unMaxTrackedDeviceCount
        self.poses = poses_t()
        
        self.timer = QTimer()
        self.timer.timeout.connect(self.update_page)
        self.timer.start(50)   # ms 
Example 8
Project: coliform-project   Author: uprm-research-resto   File: GUI.py    (GNU General Public License v3.0) View Source Project 6 votes vote down vote up
def createTopRightGroupBox(self):
        self.topRightGroupBox = QGroupBox('Heater')

        heatLabel = QLabel('Target Temperature(C):')
        heatEntry = QLineEdit()
        heatEntry.textChanged[str].connect(self.tempOnChanged)
        heatEntry.setText('41')

        self.heatButton = QPushButton('Heater ON')
        self.heatButton.clicked.connect(self.heaterPower)

        hbox1 = QHBoxLayout()
        hbox1.addWidget(heatLabel)
        hbox1.addWidget(heatEntry)

        hbox2 = QHBoxLayout()
        hbox2.addWidget(self.heatButton)

        layout = QVBoxLayout()
        layout.addLayout(hbox1)
        layout.addLayout(hbox2)
        layout.addStretch(1)
        self.topRightGroupBox.setLayout(layout) 
Example 9
Project: coliform-project   Author: uprm-research-resto   File: GUI.py    (GNU General Public License v3.0) View Source Project 6 votes vote down vote up
def createBottomLeftGroupBox(self):
        self.bottomLeftGroupBox = QGroupBox('Sensor Options')

        captureBtn = QPushButton('Capture Data')
        captureBtn.clicked.connect(self.captureDataThread)

        setNormOptionsBtn = QPushButton('Set Normal Options')
        setNormOptionsBtn.clicked.connect(self.normalSettings)

        setDarkOptionsBtn = QPushButton('Set Low Light Options')
        setDarkOptionsBtn.clicked.connect(self.darkSettings)

        saveBtn = QPushButton('Save Data')
        saveBtn.clicked.connect(self.saveData)

        layout = QVBoxLayout()
        layout.addWidget(captureBtn)
        layout.addWidget(setNormOptionsBtn)
        layout.addWidget(setDarkOptionsBtn)
        layout.addWidget(saveBtn)
        layout.addStretch(1)
        self.bottomLeftGroupBox.setLayout(layout) 
Example 10
Project: incubator-senssoft-userale-pyqt5   Author: apache   File: testapp.py    (Apache License 2.0) View Source Project 6 votes vote down vote up
def initUI(self):               
        
        qbtn = QPushButton('Quit', self)
        qbtn.setObjectName ("testApplicationButton")
        qbtn.clicked.connect(QCoreApplication.instance().quit)
        qbtn.resize(qbtn.sizeHint())
        qbtn.move(50, 50)       
         
        self.setGeometry(300, 300, 250, 150)
        self.setWindowTitle('Quit button')    
        self.show() 
Example 11
Project: pytc-gui   Author: harmslab   File: about.py    (license) View Source Project 6 votes vote down vote up
def layout(self):
        """
        """
        main_layout = QW.QVBoxLayout(self)
        form_layout = QW.QFormLayout()

        version = pkg_resources.require("pytc-gui")[0].version

        name_label = QW.QLabel("pytc: GUI")
        name_font = name_label.font()
        name_font.setPointSize(20)
        name_label.setFont(name_font)
        name_label.setAlignment(Qt.AlignCenter)

        version_label = QW.QLabel("Version " + version)
        version_font = version_label.font()
        version_font.setPointSize(14)
        version_label.setFont(version_font)
        version_label.setAlignment(Qt.AlignCenter)

        author_info = QW.QLabel("Hiranmayi Duvvuri, Mike Harms")
        author_font = author_info.font()
        author_font.setPointSize(10)
        author_info.setFont(author_font)

        OK_button = QW.QPushButton("OK", self)
        OK_button.clicked.connect(self.close)

        main_layout.addWidget(name_label)
        main_layout.addWidget(version_label)
        main_layout.addWidget(author_info)
        main_layout.addWidget(OK_button)

        self.setWindowTitle("About") 
Example 12
Project: pytc-gui   Author: harmslab   File: aic_test.py    (license) View Source Project 6 votes vote down vote up
def layout(self):
        """
        Lay out the dialog.
        """

        main_layout = QW.QVBoxLayout(self)
        test_layout = QW.QHBoxLayout()
        button_layout = QW.QVBoxLayout()

        self._fitter_select = QW.QListWidget()
        self._fitter_select.setSelectionMode(QW.QAbstractItemView.ExtendedSelection)

        for k,v in self._fit_snapshot_dict.items():
            self._fitter_select.addItem(k)

        self._fitter_select.setFixedSize(150, 100)

        ftest_button = QW.QPushButton("Perform AIC Test", self)
        ftest_button.clicked.connect(self.perform_test)

        add_fit_button = QW.QPushButton("Append New Fit", self)
        add_fit_button.clicked.connect(self.add_fitter)

        self._data_out = QW.QTextEdit()
        self._data_out.setReadOnly(True)
        self._data_out.setMinimumWidth(400)

        # add buttons to layout
        button_layout.addWidget(ftest_button)
        button_layout.addWidget(add_fit_button)

        # add widgets to layout
        test_layout.addWidget(self._fitter_select)
        test_layout.addLayout(button_layout)
        main_layout.addLayout(test_layout)
        main_layout.addWidget(self._data_out)

        self.setWindowTitle('AIC Test') 
Example 13
Project: pytc-gui   Author: harmslab   File: documentation.py    (license) View Source Project 6 votes vote down vote up
def layout(self):
        """
        """
        main_layout = QW.QVBoxLayout(self)
        form_layout = QW.QFormLayout()

        pytc_docs = "<a href=\"https://pytc.readthedocs.io/en/latest/\">documentation</a>"
        gui_docs = "<a href=\"https://pytc-gui.readthedocs.io/en/latest/\">documentation</a>"

        pytc_label = QW.QLabel(pytc_docs)
        pytc_label.setOpenExternalLinks(True)

        gui_label = QW.QLabel(gui_docs)
        gui_label.setOpenExternalLinks(True)

        form_layout.addRow(QW.QLabel("pytc:"), pytc_label)
        form_layout.addRow(QW.QLabel("pytc-gui:"), gui_label)

        OK_button = QW.QPushButton("OK", self)
        OK_button.clicked.connect(self.close)

        main_layout.addLayout(form_layout)
        main_layout.addWidget(OK_button)

        self.setWindowTitle("Documentation") 
Example 14
Project: pytc-gui   Author: harmslab   File: global_dialog.py    (license) View Source Project 6 votes vote down vote up
def layout(self):
        """
        Populate the window.
        """

        self._main_layout = QW.QVBoxLayout(self)
        self._form_layout = QW.QFormLayout()

        # Input box holding name
        self._global_var_input = QW.QLineEdit(self)
        self._global_var_input.setText("global")
        self._global_var_input.editingFinished.connect(self._check_name)

        # Final OK button
        self._OK_button = QW.QPushButton("OK", self)
        self._OK_button.clicked.connect(self._ok_button_handler)

        # Add to form
        self._form_layout.addRow(QW.QLabel("New Global Variable:"), self._global_var_input)

        # add to main layout
        self._main_layout.addLayout(self._form_layout)
        self._main_layout.addWidget(self._OK_button)

        self.setWindowTitle("Add new global variable") 
Example 15
Project: pytc-gui   Author: harmslab   File: experiment_widget.py    (license) View Source Project 6 votes vote down vote up
def layout(self):
        """
        Layout the row for this experiment.
        """

        self._main_layout = QW.QGridLayout(self)

        # Construct the header for the experiment
        self._main_layout.addWidget(QW.QLabel(self._expt_label),0,0)
 
        # -------------- Buttons --------------------

        # Button to show experiment options
        self._show_options_button = QW.QPushButton("", self)
        self._show_options_button.clicked.connect(self._options_callback)
        self._show_options_button.setIcon(QG.QIcon(os.path.join(self._image_base,"icons","more-info.png")))
        self._show_options_button.setIconSize(QC.QSize(21,21))
        self._show_options_button.setFixedWidth(30)
        self._main_layout.addWidget(self._show_options_button,0,1)

        # Button to remove experiment
        self._remove_button = QW.QPushButton("", self)
        self._remove_button.clicked.connect(self._remove_callback)
        self._remove_button.setIcon(QG.QIcon(os.path.join(self._image_base,"icons","delete-icon.png")))
        self._remove_button.setIconSize(QC.QSize(21,21))
        self._remove_button.setFixedWidth(30)
        self._main_layout.addWidget(self._remove_button,0,2)

        self.setFrameShape(QW.QFrame.StyledPanel)

        if self._experiment is None:
            self._show_options_button.setDisabled(True)
            self._remove_button.setDisabled(True) 
Example 16
Project: binja_dynamics   Author: nccgroup   File: __init__.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super(TracebackWindow, self).__init__()
        self.framelist = []
        self.ret_add = 0x0
        self.setWindowTitle("Traceback")
        self.setLayout(QtWidgets.QVBoxLayout())
        self._layout = self.layout()

        # Creates the rich text viewer that displays the traceback
        self._textBrowser = QtWidgets.QTextBrowser()
        self._textBrowser.setOpenLinks(False)
        self._textBrowser.setFont(QFontDatabase.systemFont(QFontDatabase.FixedFont))
        self._layout.addWidget(self._textBrowser)

        # Creates the button that displays the return address
        self._ret = QtWidgets.QPushButton()
        self._ret.setFlat(True)
        self._layout.addWidget(self._ret)

        self.resize(self.width(), int(self.height() * 0.5))

        self.setObjectName('Traceback_Window') 
Example 17
Project: activity-browser   Author: LCA-ActivityBrowser   File: inventory.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super(ProjectsWidget, self).__init__()
        self.projects_list = ProjectListWidget()
        # Buttons
        self.new_project_button = QtWidgets.QPushButton(QtGui.QIcon(icons.add), 'New')
        self.copy_project_button = QtWidgets.QPushButton(QtGui.QIcon(icons.copy), 'Copy current')
        self.delete_project_button = QtWidgets.QPushButton(QtGui.QIcon(icons.delete), 'Delete current')
        # Layout
        self.h_layout = QtWidgets.QHBoxLayout()
        self.h_layout.addWidget(header('Current Project:'))
        self.h_layout.addWidget(self.projects_list)
        self.h_layout.addWidget(self.new_project_button)
        self.h_layout.addWidget(self.copy_project_button)
        self.h_layout.addWidget(self.delete_project_button)
        self.setLayout(self.h_layout)
        self.setSizePolicy(QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.Maximum,
            QtWidgets.QSizePolicy.Maximum)
        )
        self.connect_signals() 
Example 18
Project: activity-browser   Author: LCA-ActivityBrowser   File: inventory.py    (license) View Source Project 6 votes vote down vote up
def __init__(self, parent):
        super(DatabaseWidget, self).__init__(parent)

        # Labels
        self.label_no_database_selected = QtWidgets.QLabel("Select a database (double-click on table).")

        # Buttons
        self.add_default_data_button = QtWidgets.QPushButton(
            'Add Default Data (Biosphere flows, LCIA methods)')
        self.new_database_button = QtWidgets.QPushButton('New Database')
        self.import_database_button = QtWidgets.QPushButton('Import Database')

        # Header widget
        self.header_layout.addWidget(self.add_default_data_button)
        self.header_layout.addWidget(self.new_database_button)
        self.header_layout.addWidget(self.import_database_button)

        # Overall Layout
        self.v_layout.addWidget(self.label_no_database_selected)

        self.connect_signals() 
Example 19
Project: activity-browser   Author: LCA-ActivityBrowser   File: db_import_wizard.py    (license) View Source Project 6 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.path_edit = QtWidgets.QLineEdit()
        self.registerField('dirpath*', self.path_edit)
        self.browse_button = QtWidgets.QPushButton('Browse')
        self.browse_button.clicked.connect(self.get_directory)

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(QtWidgets.QLabel(
            'Choose location of existing ecospold2 directory:'))
        layout.addWidget(self.path_edit)
        browse_lay = QtWidgets.QHBoxLayout()
        browse_lay.addWidget(self.browse_button)
        browse_lay.addStretch(1)
        layout.addLayout(browse_lay)
        self.setLayout(layout) 
Example 20
Project: activity-browser   Author: LCA-ActivityBrowser   File: db_import_wizard.py    (license) View Source Project 6 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.wizard = self.parent()
        self.path_edit = QtWidgets.QLineEdit()
        self.registerField('archivepath*', self.path_edit)
        self.browse_button = QtWidgets.QPushButton('Browse')
        self.browse_button.clicked.connect(self.get_archive)

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(QtWidgets.QLabel(
            'Choose location of 7z archive:'))
        layout.addWidget(self.path_edit)
        browse_lay = QtWidgets.QHBoxLayout()
        browse_lay.addWidget(self.browse_button)
        browse_lay.addStretch(1)
        layout.addLayout(browse_lay)
        self.setLayout(layout) 
Example 21
Project: activity-browser   Author: LCA-ActivityBrowser   File: db_import_wizard.py    (license) View Source Project 6 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.wizard = self.parent()
        self.complete = False
        self.description_label = QtWidgets.QLabel('Login to the ecoinvent homepage:')
        self.username_edit = QtWidgets.QLineEdit()
        self.username_edit.setPlaceholderText('ecoinvent username')
        self.password_edit = QtWidgets.QLineEdit()
        self.password_edit.setPlaceholderText('ecoinvent password'),
        self.password_edit.setEchoMode(QtWidgets.QLineEdit.Password)
        self.login_button = QtWidgets.QPushButton('login')
        self.login_button.clicked.connect(self.login)
        self.login_button.setCheckable(True)
        self.password_edit.returnPressed.connect(self.login_button.click)
        self.success_label = QtWidgets.QLabel('')
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.description_label)
        layout.addWidget(self.username_edit)
        layout.addWidget(self.password_edit)
        hlay = QtWidgets.QHBoxLayout()
        hlay.addWidget(self.login_button)
        hlay.addStretch(1)
        layout.addLayout(hlay)
        layout.addWidget(self.success_label)
        self.setLayout(layout) 
Example 22
Project: scm-workbench   Author: barry-scott   File: wb_hg_preferences.py    (license) View Source Project 6 votes vote down vote up
def __init__( self, app ):
        super().__init__( app, T_('Hg') )

        self.prefs = self.app.prefs.hg

        #------------------------------------------------------------
        self.hg_program = QtWidgets.QLineEdit()
        if self.prefs.program is not None:
            self.hg_program.setText( str(self.prefs.program) )

        else:
            # show the default
            self.hg_program.setText( hglib.HGPATH )

        self.browse_program = QtWidgets.QPushButton( T_('Browse...') )
        self.browse_program.clicked.connect( self.__pickProgram )

        #------------------------------------------------------------
        self.addRow( T_('Hg Program'), self.hg_program, self.browse_program ) 
Example 23
Project: scm-workbench   Author: barry-scott   File: wb_git_preferences.py    (license) View Source Project 6 votes vote down vote up
def __init__( self, app ):
        super().__init__( app, T_('Git') )

        self.prefs = self.app.prefs.git

        #------------------------------------------------------------
        self.git_program = QtWidgets.QLineEdit()
        if self.prefs.program is not None:
            self.git_program.setText( str(self.prefs.program) )

        else:
            # show the default
            self.git_program.setText( git.Git.GIT_PYTHON_GIT_EXECUTABLE )

        self.browse_program = QtWidgets.QPushButton( T_('Browse...') )
        self.browse_program.clicked.connect( self.__pickProgram )

        self.addRow( T_('Git Program'), self.git_program, self.browse_program ) 
Example 24
Project: scm-workbench   Author: barry-scott   File: wb_scm_preferences_dialog.py    (license) View Source Project 6 votes vote down vote up
def __init__( self, app ):
        super().__init__( app, T_('Editor') )

        if self.app is None:
            self.prefs = None
        else:
            self.prefs = self.app.prefs.editor

        self.editor_program = QtWidgets.QLineEdit( '' )
        self.editor_options = QtWidgets.QLineEdit( '' )

        if self.prefs is not None:
            self.editor_program.setText( self.prefs.program )
            self.editor_options.setText( self.prefs.options )

        self.browse = QtWidgets.QPushButton( T_('Browse…') )

        self.addRow( T_('Editor'), self.editor_program, self.browse )
        self.addRow( T_('Editor Options'), self.editor_options )

        self.browse.clicked.connect( self.pickEditor ) 
Example 25
Project: git-annex-metadata-gui   Author: alpernebbi   File: field_item_edit.py    (license) View Source Project 6 votes vote down vote up
def __init__(self, item, parent=None):
        super().__init__(parent)
        self._item = item
        self._values = []

        layout = QtWidgets.QHBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)

        model = self._item.model()
        model.dataChanged.connect(self._on_data_changed)

        append_button = QtWidgets.QPushButton()
        append_button.setText('+')
        append_button.setMaximumWidth(32)
        append_button.clicked.connect(self._on_append_button_clicked)
        self.layout().addWidget(append_button)

        self.update_widgets() 
Example 26
Project: idapython   Author: mr-tz   File: highlight_instructions.py    (license) View Source Project 6 votes vote down vote up
def __init__(self, parent=None):
        QtWidgets.QDialog.__init__(self, parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowCloseButtonHint)
        self.setWindowTitle("Highlighter v%s" % __version__)
        highlighter_layout = QtWidgets.QVBoxLayout()

        button_highlight = QtWidgets.QPushButton("&Highlight instructions")
        button_highlight.setDefault(True)
        button_highlight.clicked.connect(self.highlight)
        highlighter_layout.addWidget(button_highlight)

        button_clear = QtWidgets.QPushButton("&Clear all highlights")
        button_clear.clicked.connect(self.clear_colors)
        highlighter_layout.addWidget(button_clear)

        button_cancel = QtWidgets.QPushButton("&Close")
        button_cancel.clicked.connect(self.close)
        highlighter_layout.addWidget(button_cancel)

        self.setMinimumWidth(180)
        self.setLayout(highlighter_layout) 
Example 27
Project: axopy   Author: ucdrascal   File: session.py    (license) View Source Project 6 votes vote down vote up
def __init__(self, configurations=None, parent=None):
        super(SessionInfoWidget, self).__init__(parent=parent)

        main_layout = QtWidgets.QVBoxLayout()
        self.setLayout(main_layout)

        form_layout = QtWidgets.QFormLayout()
        form_layout.setFormAlignment(QtCore.Qt.AlignVCenter)
        main_layout.addLayout(form_layout)

        if configurations is not None:
            self._config_combo_box = QtWidgets.QComboBox()
            form_layout.addRow("Configuration", self._config_combo_box)

            for config in configurations:
                self._config_combo_box.addItem(config)

        self._subject_line_edit = QtWidgets.QLineEdit()
        form_layout.addRow("Subject", self._subject_line_edit)

        self._button = QtWidgets.QPushButton("Start")
        main_layout.addWidget(self._button)

        self._button.clicked.connect(self._on_button_click) 
Example 28
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: textbox.py    (license) View Source Project 6 votes vote down vote up
def initUI(self):
        self.setWindowTitle(self.title)
        self.setGeometry(self.left, self.top, self.width, self.height)
        
        # Create textbox
        self.textbox = QLineEdit(self)
        self.textbox.move(20, 20)
        self.textbox.resize(280,40)
 
        # Create a button in the window
        self.button = QPushButton('Show text', self)
        self.button.move(20,80)

        # connect button to function on_click
        self.button.clicked.connect(self.on_click)
        self.show() 
Example 29
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: horizontalLayout.py    (license) View Source Project 6 votes vote down vote up
def createHorizontalLayout(self):
        self.horizontalGroupBox = QGroupBox("What is your favorite color?")
        layout = QHBoxLayout()
 
        buttonBlue = QPushButton('Blue', self)
        buttonBlue.clicked.connect(self.on_click)
        layout.addWidget(buttonBlue) 
 
        buttonRed = QPushButton('Red', self)
        buttonRed.clicked.connect(self.on_click)
        layout.addWidget(buttonRed) 
 
        buttonGreen = QPushButton('Green', self)
        buttonGreen.clicked.connect(self.on_click)
        layout.addWidget(buttonGreen) 
 
        self.horizontalGroupBox.setLayout(layout) 
Example 30
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: grid.py    (license) View Source Project 6 votes vote down vote up
def createGridLayout(self):
        self.horizontalGroupBox = QGroupBox("Grid")
        layout = QGridLayout()
        layout.setColumnStretch(1, 4)
        layout.setColumnStretch(2, 4)
 
        layout.addWidget(QPushButton('1'),0,0) 
        layout.addWidget(QPushButton('2'),0,1) 
        layout.addWidget(QPushButton('3'),0,2) 
        layout.addWidget(QPushButton('4'),1,0) 
        layout.addWidget(QPushButton('5'),1,1) 
        layout.addWidget(QPushButton('6'),1,2) 
        layout.addWidget(QPushButton('7'),2,0) 
        layout.addWidget(QPushButton('8'),2,1) 
        layout.addWidget(QPushButton('9'),2,2) 
 
        self.horizontalGroupBox.setLayout(layout) 
Example 31
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: Notepad_menubar.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super().__init__()
        self.text = QTextEdit(self)
        self.clr_btn = QPushButton('Clear')
        self.sav_btn = QPushButton('Save')
        self.opn_btn = QPushButton('Open')
        self.font_btn = QPushButton('Change Font')

        self.init_ui() 
Example 32
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: LineEdit.py    (license) View Source Project 6 votes vote down vote up
def init_ui(self):
        self.le = QtWidgets.QLineEdit()
        self.b1 = QtWidgets.QPushButton('Clear')
        self.b2 = QtWidgets.QPushButton('Print')

        v_box = QtWidgets.QVBoxLayout()
        v_box.addWidget(self.le)
        v_box.addWidget(self.b1)
        v_box.addWidget(self.b2)

        self.setLayout(v_box)
        self.setWindowTitle('PyQt5 Lesson 7')

        self.b1.clicked.connect(self.btn_clk)
        self.b2.clicked.connect(self.btn_clk)

        self.show() 
Example 33
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: activity.py    (license) View Source Project 6 votes vote down vote up
def init_ui(self):
        self.b = QtWidgets.QPushButton('Push Me')
        self.l = QtWidgets.QLabel('I have not been clicked yet')

        h_box = QtWidgets.QHBoxLayout()
        h_box.addStretch()
        h_box.addWidget(self.l)
        h_box.addStretch()

        v_box = QtWidgets.QVBoxLayout()
        v_box.addWidget(self.b)
        v_box.addLayout(h_box)

        self.setLayout(v_box)
        self.setWindowTitle('PyQt5 Lesson 5')

        self.b.clicked.connect(self.btn_click)

        self.show() 
Example 34
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: TextEdit.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super(Notepad, self).__init__()
        self.text = QTextEdit(self)
        self.clr_btn = QPushButton('Clear')

        self.init_ui() 
Example 35
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: TextEditor_QFileDialog.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super(Notepad, self).__init__()
        self.text = QTextEdit(self)
        self.clr_btn = QPushButton('Clear')
        self.sav_btn = QPushButton('Save')
        self.opn_btn = QPushButton('Open')

        self.init_ui() 
Example 36
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: TextEdit2.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super(Notepad, self).__init__()
        self.text = QTextEdit(self)
        self.clr_btn = QPushButton('Save')

        self.init_ui() 
Example 37
Project: VIRTUAL-PHONE   Author: SumanKanrar-IEM   File: Notepad.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super().__init__()
        self.text = QTextEdit(self)
        self.clr_btn = QPushButton('Clear')
        self.sav_btn = QPushButton('Save')
        self.opn_btn = QPushButton('Open')
        self.font_btn = QPushButton('Change Font')
        # self.clr_btn.setStyle(QStyleFactory.create('Fusion'))
        # self.sav_btn.setStyle(QStyleFactory.create('Windows'))
        # self.opn_btn.setStyle(QStyleFactory.create('Cleanlooks'))

        self.init_ui() 
Example 38
Project: Crawler_UI_New   Author: crystalhsj   File: Ui_Login.py    (license) View Source Project 6 votes vote down vote up
def setupUi(self, Login):
        Login.setObjectName("Login")
        Login.resize(300, 400)
        Login.setMinimumSize(QtCore.QSize(300, 400))
        Login.setMaximumSize(QtCore.QSize(300, 400))
        self.pushButton = QtWidgets.QPushButton(Login)
        self.pushButton.setGeometry(QtCore.QRect(100, 320, 99, 27))
        self.pushButton.setObjectName("pushButton")
        self.label_2 = QtWidgets.QLabel(Login)
        self.label_2.setGeometry(QtCore.QRect(28, 190, 68, 17))
        self.label_2.setObjectName("label_2")
        self.lineEdit_2 = QtWidgets.QLineEdit(Login)
        self.lineEdit_2.setGeometry(QtCore.QRect(120, 190, 151, 27))
        self.lineEdit_2.setEchoMode(QtWidgets.QLineEdit.Password)
        self.lineEdit_2.setObjectName("lineEdit_2")
        self.label = QtWidgets.QLabel(Login)
        self.label.setGeometry(QtCore.QRect(28, 120, 68, 17))
        self.label.setObjectName("label")
        self.lineEdit = QtWidgets.QLineEdit(Login)
        self.lineEdit.setGeometry(QtCore.QRect(120, 120, 151, 27))
        self.lineEdit.setObjectName("lineEdit")

        self.retranslateUi(Login)
        QtCore.QMetaObject.connectSlotsByName(Login) 
Example 39
Project: Vector-Tiles-Reader-QGIS-Plugin   Author: geometalab   File: dlg_about_qt5.py    (license) View Source Project 6 votes vote down vote up
def setupUi(self, DlgAbout):
        DlgAbout.setObjectName("DlgAbout")
        DlgAbout.resize(382, 372)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(DlgAbout.sizePolicy().hasHeightForWidth())
        DlgAbout.setSizePolicy(sizePolicy)
        self.gridLayout = QtWidgets.QGridLayout(DlgAbout)
        self.gridLayout.setObjectName("gridLayout")
        self.btnClose = QtWidgets.QPushButton(DlgAbout)
        self.btnClose.setMinimumSize(QtCore.QSize(80, 0))
        self.btnClose.setObjectName("btnClose")
        self.gridLayout.addWidget(self.btnClose, 1, 0, 1, 1, QtCore.Qt.AlignRight)
        self.txtAbout = QtWidgets.QTextBrowser(DlgAbout)
        self.txtAbout.setMinimumSize(QtCore.QSize(350, 240))
        self.txtAbout.setOpenExternalLinks(True)
        self.txtAbout.setObjectName("txtAbout")
        self.gridLayout.addWidget(self.txtAbout, 0, 0, 1, 1)

        self.retranslateUi(DlgAbout)
        self.btnClose.clicked.connect(DlgAbout.reject)
        QtCore.QMetaObject.connectSlotsByName(DlgAbout) 
Example 40
Project: binja_dynamics   Author: ehennenfent   File: __init__.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super(TracebackWindow, self).__init__()
        self.framelist = []
        self.ret_add = 0x0
        self.setWindowTitle("Traceback")
        self.setLayout(QtWidgets.QVBoxLayout())
        self._layout = self.layout()

        # Creates the rich text viewer that displays the traceback
        self._textBrowser = QtWidgets.QTextBrowser()
        self._textBrowser.setOpenLinks(False)
        self._textBrowser.setFont(QFontDatabase.systemFont(QFontDatabase.FixedFont))
        self._layout.addWidget(self._textBrowser)

        # Creates the button that displays the return address
        self._ret = QtWidgets.QPushButton()
        self._ret.setFlat(True)
        self._layout.addWidget(self._ret)

        self.resize(self.width(), int(self.height() * 0.5))

        self.setObjectName('Traceback_Window') 
Example 41
Project: Enibar   Author: ENIB   File: users_management_window.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super().__init__()
        self.layout = QtWidgets.QGridLayout()
        self.setStyleSheet("QPushButton{margin:0.5em 0 0 0;padding:0.25em 1em}")

        self.username_label = QtWidgets.QLabel("Nom d'utilisateur:", self)
        self.password_label = QtWidgets.QLabel("Mot de passe:", self)
        self.username_input = QtWidgets.QLineEdit(self)
        self.password_input = QtWidgets.QLineEdit(self)
        self.password_input.setEchoMode(QtWidgets.QLineEdit.Password)
        self.cancel_button = QtWidgets.QPushButton("Annuler", self)
        self.validation_button = QtWidgets.QPushButton("Ajouter", self)

        self.layout.addWidget(self.username_label, 0, 0)
        self.layout.addWidget(self.username_input, 1, 0, 1, 0)
        self.layout.addWidget(self.password_label, 2, 0)
        self.layout.addWidget(self.password_input, 3, 0, 1, 0)
        self.layout.addWidget(self.validation_button, 4, 0)
        self.layout.addWidget(self.cancel_button, 4, 1)

        self.cancel_button.setAutoDefault(False)
        self.setLayout(self.layout)

        self.cancel_button.clicked.connect(self.reject)
        self.validation_button.clicked.connect(self.accept) 
Example 42
Project: CeNet-Interconnect   Author: shikharsrivastava   File: ChatBox.py    (license) View Source Project 6 votes vote down vote up
def setupUi(self, chatBox,message):
        chatBox.setObjectName("chatBox")
        chatBox.resize(473, 294)
        self.gridLayout = QtWidgets.QGridLayout(chatBox)
        self.gridLayout.setObjectName("gridLayout")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.chatLabel = QtWidgets.QLabel(chatBox)
        self.chatLabel.setObjectName("chatLabel")
        self.verticalLayout.addWidget(self.chatLabel)
        self.userChat = chatText(chatBox)
        self.userChat.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
        self.userChat.setObjectName("userChat")
        self.verticalLayout.addWidget(self.userChat)
        self.gridLayout.addLayout(self.verticalLayout, 1, 0, 4, 1)
        self.chat = QtWidgets.QTextEdit(chatBox)
        self.chat.setEnabled(True)
        self.chat.setReadOnly(True)
        self.chat.setObjectName("chat")
        self.gridLayout.addWidget(self.chat, 0, 0, 1, 2)
        self.listOnline = QtWidgets.QPushButton(chatBox)
        self.listOnline.setObjectName("listOnline")
        self.gridLayout.addWidget(self.listOnline, 1, 1, 1, 1)
        self.sendButton = QtWidgets.QPushButton(chatBox)
        self.sendButton.setObjectName("sendButton")
        self.gridLayout.addWidget(self.sendButton, 3, 1, 1, 1)
        self.exitButton = QtWidgets.QPushButton(chatBox)
        self.exitButton.setObjectName("exitButton")
        self.gridLayout.addWidget(self.exitButton, 4, 1, 1, 1)
        self.fileSendButton = QtWidgets.QPushButton(chatBox)
        self.fileSendButton.setObjectName("fileSendButton")
        self.gridLayout.addWidget(self.fileSendButton, 2, 1, 1, 1)

        self.retranslateUi(chatBox,message)
        QtCore.QMetaObject.connectSlotsByName(chatBox) 
Example 43
Project: CeNet-Interconnect   Author: shikharsrivastava   File: test.py    (license) View Source Project 6 votes vote down vote up
def setupUi(self, chatBox,message):
        chatBox.setObjectName("chatBox")
        chatBox.resize(473, 294)
        self.gridLayout = QtWidgets.QGridLayout(chatBox)
        self.gridLayout.setObjectName("gridLayout")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.chatLabel = QtWidgets.QLabel(chatBox)
        self.chatLabel.setObjectName("chatLabel")
        self.verticalLayout.addWidget(self.chatLabel)
        self.userChat = QtWidgets.QTextEdit(chatBox)
        self.userChat.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
        self.userChat.setObjectName("userChat")
        self.verticalLayout.addWidget(self.userChat)
        self.gridLayout.addLayout(self.verticalLayout, 1, 0, 4, 1)
        self.chat = QtWidgets.QTextEdit(chatBox)
        self.chat.setEnabled(True)
        self.chat.setReadOnly(True)
        self.chat.setObjectName("chat")
        self.gridLayout.addWidget(self.chat, 0, 0, 1, 2)
        self.listOnline = QtWidgets.QPushButton(chatBox)
        self.listOnline.setObjectName("listOnline")
        self.gridLayout.addWidget(self.listOnline, 1, 1, 1, 1)
        self.sendButton = QtWidgets.QPushButton(chatBox)
        self.sendButton.setObjectName("sendButton")
        self.gridLayout.addWidget(self.sendButton, 3, 1, 1, 1)
        self.exitButton = QtWidgets.QPushButton(chatBox)
        self.exitButton.setObjectName("exitButton")
        self.gridLayout.addWidget(self.exitButton, 4, 1, 1, 1)
        self.fileSendButton = QtWidgets.QPushButton(chatBox)
        self.fileSendButton.setObjectName("fileSendButton")
        self.gridLayout.addWidget(self.fileSendButton, 2, 1, 1, 1)

        self.retranslateUi(chatBox,message)
        self.exitButton.clicked.connect(chatBox.close)
        self.sendButton.clicked.connect(self.userChat.clear)
        self.fileSendButton.clicked.connect(self.userChat.clear)
        QtCore.QMetaObject.connectSlotsByName(chatBox) 
Example 44
Project: vivisect-py3   Author: bat-serjo   File: qtrace.py    (license) View Source Project 6 votes vote down vote up
def __init__(self, trace=None, parent=None):
        QtWidgets.QWidget.__init__(self, parent=parent)
        VQTraceNotifier.__init__(self, trace)

        self.grid = QtWidgets.QGridLayout()
        if not trace.hasStatusRegister():
            return

        self.flags_def = trace.getStatusRegNameDesc()
        self.flags = {}
        self.flag_labels = {}
        for idx, (name, desc) in enumerate(self.flags_def):
            flag_button = QtWidgets.QPushButton(name)
            flag_button.clicked.connect(self.buttonClicked)
            flag_button.setToolTip(desc)

            flag_label = QtWidgets.QLabel('0', self)
            flag_label.setAlignment(QtCore.Qt.AlignCenter)
            self.flag_labels[name] = flag_label

            self.grid.addWidget(flag_button, 0, idx)
            self.grid.addWidget(flag_label, 1, idx)

        self.setLayout(self.grid)
        self.vqLoad() 
Example 45
Project: gpvdm   Author: roderickmackenzie   File: fit_poly.py    (license) View Source Project 6 votes vote down vote up
def __init__(self,x_min,x_max,data):
		QWidget.__init__(self)
		self.setWindowTitle(_("Poly fit")+"(https://www.gpvdm.com)") 
		self.data=data
		self.ret_math=None
		self.ret=None
		self.interal_data=[]
		for i in range (0,self.data.y_len):		#x_nm= [x * 1e9 for x in self.data.y_scale]
			x=self.data.y_scale[i]
			#print(x_min,x,x_max)
			if x>=x_min and x<=x_max:
				self.interal_data.append((self.data.y_scale[i],self.data.data[0][0][i]))
				#print(self.data.y_scale[i],self.data.data[0][0][i])
			#frequency, = self.ax1.plot(x_nm,self.data.data[0][0][i], 'bo-', linewidth=3 ,alpha=1.0)
		#print(self.interal_data)
		self.main_vbox=QVBoxLayout()
		self.label = QLabel(_("Polynomial coefficients"))
		self.main_vbox.addWidget(self.label)
		self.sp = QSpinBox()
		self.main_vbox.addWidget(self.sp)
		self.button = QPushButton(_("Ok"), self)
		self.button.clicked.connect(self.callback_click_ok)
		self.main_vbox.addWidget(self.button)
		self.setLayout(self.main_vbox)
		ret=False 
Example 46
Project: gpvdm   Author: roderickmackenzie   File: gpvdm_select.py    (license) View Source Project 6 votes vote down vote up
def __init__(self,file_box=False):
		QWidget.__init__(self)
		self.hbox=QHBoxLayout()
		self.edit=QLineEdit()
		self.button=QPushButton()
		self.button.setFixedSize(25, 25)
		self.button.setText("...")
		self.hbox.addWidget(self.edit)
		self.hbox.addWidget(self.button)

		self.hbox.setContentsMargins(0, 0, 0, 0)
		self.edit.setStyleSheet("QLineEdit { border: none }");

		if file_box==True:
			self.button.clicked.connect(self.callback_button_click)

		self.setLayout(self.hbox) 
Example 47
Project: gpvdm   Author: roderickmackenzie   File: QColorPicker.py    (license) View Source Project 6 votes vote down vote up
def __init__(self,r,g,b):
		QWidget.__init__(self)
		self.r=r
		self.g=g
		self.b=b
		self.hbox=QHBoxLayout()
		self.edit=QLineEdit()
		self.button=QPushButton()
		self.button.setFixedSize(25, 25)
		self.button.setText("...")
		self.hbox.addWidget(self.edit)
		self.hbox.addWidget(self.button)

		self.hbox.setContentsMargins(0, 0, 0, 0)
		self.update_color()

		
		self.button.clicked.connect(self.callback_button_click)

		self.setLayout(self.hbox) 
Example 48
Project: CRIkit2   Author: CoherentRamanNIST   File: helper_roiselect.py    (license) View Source Project 6 votes vote down vote up
def setupUi(self, MainWindow):
            MainWindow.setObjectName("MainWindow")
            MainWindow.resize(984, 658)
            self.centralwidget = QtWidgets.QWidget(MainWindow)
            self.centralwidget.setObjectName("centralwidget")
            self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
            self.gridLayout.setObjectName("gridLayout")
            self.verticalLayout = QtWidgets.QVBoxLayout()
            self.verticalLayout.setObjectName("verticalLayout")
            self.pushbutton = QtWidgets.QPushButton('Test')
            self.verticalLayout.addWidget(self.pushbutton)
            self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
            MainWindow.setCentralWidget(self.centralwidget)
            self.menubar = QtWidgets.QMenuBar(MainWindow)
            self.menubar.setGeometry(QtCore.QRect(0, 0, 984, 21))
            self.menubar.setObjectName("menubar")
            MainWindow.setMenuBar(self.menubar)
            self.statusbar = QtWidgets.QStatusBar(MainWindow)
            self.statusbar.setObjectName("statusbar")
            MainWindow.setStatusBar(self.statusbar)

            self.retranslateUi(MainWindow)
            QtCore.QMetaObject.connectSlotsByName(MainWindow) 
Example 49
Project: pyqt5   Author: yurisnm   File: SaveRetrieveObject.py    (license) View Source Project 6 votes vote down vote up
def __init__(self):
        super(MainWindow, self).__init__()
        self.central_widget = QWidget()
        self.layout = QVBoxLayout()
        self.central_widget.setLayout(self.layout)
        self.setCentralWidget(self.central_widget)

        self.widget = Widget()


        self.btn_save = QPushButton("Save")
        self.btn_save.clicked.connect(self.save)
        self.btn_load = QPushButton("Load")
        self.btn_load.clicked.connect(self.load)

        self.layout.addWidget(self.widget)
        self.layout.addWidget(self.btn_save)
        self.layout.addWidget(self.btn_load) 
Example 50
Project: pyqt5   Author: yurisnm   File: LeftBarLineChart.py    (license) View Source Project 6 votes vote down vote up
def init_ui(self):
        self.layout = QVBoxLayout()
        self.table = TableLineChart(self)
        self.setLayout(self.layout)
        self.layout.addWidget(self.table)

        self.btn_add_line = QPushButton("+")
        self.btn_add_line.setStyleSheet("""
        background-color: green;
        color: white;
        """)
        self.btn_remove_line = QPushButton("-")
        self.btn_remove_line.setStyleSheet("""
        background-color: red;
        color: white;
        """)
        self.layout.addWidget(self.btn_remove_line)
        self.layout.addWidget(self.btn_add_line)