Python PyQt5.QtWidgets.QPushButton() Examples

The following are 30 code examples of PyQt5.QtWidgets.QPushButton(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .
Example #1
Source File: window.py    From visma with GNU General Public License v3.0 10 votes vote down vote up
def equationsLayout(self):
        self.myQListWidget = QtWidgets.QListWidget(self)
        for index, name in self.equations:
            myQCustomQWidget = QCustomQWidget()
            myQCustomQWidget.setTextUp(index)
            myQCustomQWidget.setTextDown(name)
            myQListWidgetItem = QtWidgets.QListWidgetItem(self.myQListWidget)
            myQListWidgetItem.setSizeHint(myQCustomQWidget.sizeHint())
            self.myQListWidget.addItem(myQListWidgetItem)
            self.myQListWidget.setItemWidget(
                myQListWidgetItem, myQCustomQWidget)
        self.myQListWidget.resize(400, 300)
        self.equationListVbox.addWidget(self.myQListWidget)
        self.myQListWidget.itemClicked.connect(self.Clicked)
        self.clearButton = QtWidgets.QPushButton('Clear equations')
        self.clearButton.clicked.connect(self.clearHistory)
        self.clearButton.setStatusTip("Clear history")
        self.equationListVbox.addWidget(self.clearButton)
        return self.equationListVbox 
Example #2
Source File: window.py    From visma with GNU General Public License v3.0 8 votes vote down vote up
def buttonsLayout(self):
        self.matrix = False
        vbox = QVBoxLayout()
        interactionModeLayout = QVBoxLayout()
        self.interactionModeButton = QtWidgets.QPushButton('visma')
        self.interactionModeButton.clicked.connect(self.interactionMode)
        interactionModeLayout.addWidget(self.interactionModeButton)
        interactionModeWidget = QWidget(self)
        interactionModeWidget.setLayout(interactionModeLayout)
        interactionModeWidget.setFixedSize(275, 50)
        topButtonSplitter = QSplitter(Qt.Horizontal)
        topButtonSplitter.addWidget(interactionModeWidget)
        permanentButtons = QWidget(self)
        topButtonSplitter.addWidget(permanentButtons)
        self.bottomButton = QFrame()
        self.buttonSplitter = QSplitter(Qt.Vertical)
        self.buttonSplitter.addWidget(topButtonSplitter)
        self.buttonSplitter.addWidget(self.bottomButton)
        vbox.addWidget(self.buttonSplitter)
        return vbox 
Example #3
Source File: angrysearch.py    From ANGRYsearch with GNU General Public License v2.0 7 votes vote down vote up
def __init__(self, setting_params=None):
        super().__init__()
        self.setting_params = setting_params
        self.search_input = Qw.QLineEdit()
        self.table = AngryTableView(self.setting_params['angrysearch_lite'],
                                    self.setting_params['row_height'])
        self.upd_button = Qw.QPushButton('update')
        self.fts_checkbox = Qw.QCheckBox()

        grid = Qw.QGridLayout()
        grid.setSpacing(10)

        grid.addWidget(self.search_input, 1, 1)
        grid.addWidget(self.fts_checkbox, 1, 3)
        grid.addWidget(self.upd_button, 1, 4)
        grid.addWidget(self.table, 2, 1, 4, 4)
        self.setLayout(grid)

        self.setTabOrder(self.search_input, self.table)
        self.setTabOrder(self.table, self.upd_button)


# THE MAIN APPLICATION WINDOW WITH THE STATUS BAR AND LOGIC
# LOADS AND SAVES QSETTINGS FROM ~/.config/angrysearch
# INITIALIZES AND SETS GUI, WAITING FOR USER INPUTS 
Example #4
Source File: renamewindow.py    From dcc with Apache License 2.0 7 votes vote down vote up
def __init__(self, parent=None, win=None, element="", info=()):
        super(RenameDialog, self).__init__(parent)

        self.sourceWin = parent
        self.info = info
        self.element = element
        title = "Rename: " + element
        self.setWindowTitle(title)

        layout = QtWidgets.QGridLayout()
        question = QtWidgets.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtWidgets.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtWidgets.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtWidgets.QPushButton("Cancel", self)
        layout.addWidget(self.buttonCancel, 1, 0)

        self.lineEdit.setText(self.element)

        self.setLayout(layout)

        self.buttonCancel.clicked.connect(self.cancelClicked)
        self.buttonOK.clicked.connect(self.okClicked) 
Example #5
Source File: input_button_clear.py    From Python_Master_Courses with GNU General Public License v3.0 7 votes vote down vote up
def initUI(self):
        self.inputLabel = QLabel("Input your text")
        self.editLine = QLineEdit()
        self.printButton = QPushButton("Print")
        self.clearButton = QPushButton("Clear")

        self.printButton.clicked.connect(self.printText)
        self.clearButton.clicked.connect(self.clearText)

        inputLayout = QHBoxLayout()
        inputLayout.addWidget(self.inputLabel)
        inputLayout.addWidget(self.editLine)

        buttonLayout = QHBoxLayout()
        buttonLayout.addWidget(self.printButton)
        buttonLayout.addWidget(self.clearButton)

        mainLayout = QVBoxLayout()
        mainLayout.addLayout(inputLayout)
        mainLayout.addLayout(buttonLayout)

        self.setLayout(mainLayout)
        self.setWindowTitle('FristWindow')
        self.show() 
Example #6
Source File: command_line.py    From CHATIMUSMAXIMUS with GNU General Public License v3.0 7 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        prompt = 'user@chatimus ~$'

        self.button = QtWidgets.QPushButton(prompt)
        self.button.setStyleSheet("""color: white; font: bold;
                                     font-size: 18px;""")
        # TODO: intergrate into stylesheet
        # NOTE: setting `outline: None` did not work
        self.button.setFlat(True)

        self.line_edit = LineEdit()
        layout = QtWidgets.QHBoxLayout()
        layout.addWidget(self.button)
        layout.addWidget(self.line_edit)
        layout.setSpacing(0)
        self.setLayout(layout)

        self.listener_signal = self.line_edit.listener_signal
        self.button.clicked.connect(self.give_focus) 
Example #7
Source File: main_gui.py    From simnibs with GNU General Public License v3.0 6 votes vote down vote up
def setButtonBox(self):
        runButton = QtWidgets.QPushButton("Run")
        runButton.setDefault(True)
        runButton.clicked.connect(self.runSimnibs)

        button_box = QtWidgets.QDialogButtonBox()
        button_box.addButton(runButton, QtWidgets.QDialogButtonBox.ActionRole)

        return button_box

    #Creates the menu bar 
Example #8
Source File: toolbar.py    From screenshot with GNU General Public License v3.0 6 votes vote down vote up
def buttonToggled(self, button):
        """
        :type button: QPushButton
        :param button:
        :return:
        """
        if button == self.rectButton:
            self.trigger.emit(ACTION_RECT)
        elif button == self.ellipseButton:
            self.trigger.emit(ACTION_ELLIPSE)
        elif button == self.arrowButton:
            self.trigger.emit(ACTION_ARROW)
        elif button == self.lineButton:
            self.trigger.emit(ACTION_LINE)
        elif button == self.freePenButton:
            self.trigger.emit(ACTION_FREEPEN)
        elif button == self.textButton:
            self.trigger.emit(ACTION_TEXT)
        else:
            pass 
Example #9
Source File: introduction.py    From malss with MIT License 6 votes vote down vote up
def __init__(self, parent=None, button_func=None, params=None):
        super().__init__(parent, 'Introduction', params)

        self.button_func = button_func

        path = os.path.abspath(os.path.dirname(__file__)) + '/static/'
        path += 'introduction'

        text = self.get_text(path)

        self.set_paragraph('MALSS interactive', text=text)

        btn = QPushButton('Next', self.inner)
        btn.setStyleSheet('QPushButton{font: bold; font-size: 15pt; background-color: white;};')
        if self.params.lang == 'en':
            btn.clicked.connect(lambda: self.button_func('Task'))
        else:
            btn.clicked.connect(lambda: self.button_func('分析タスク'))

        self.vbox.addStretch(1)

        self.vbox.addWidget(btn) 
Example #10
Source File: window.py    From visma with GNU General Public License v3.0 6 votes vote down vote up
def wrtVariableButtons(self, variables, operation):
        if isinstance(variables, list):
            varButtons = []
            if len(variables) > 0:
                for variable in variables:
                    varButtons.append(variable)
                varButtons.append("back")
                for i in reversed(range(self.solutionOptionsBox.count())):
                    self.solutionOptionsBox.itemAt(i).widget().setParent(None)
                for i in range(int(len(varButtons) / 2) + 1):
                    for j in range(2):
                        if len(varButtons) > (i * 2 + j):
                            self.solutionButtons[(i, j)] = QtWidgets.QPushButton(
                                varButtons[i * 2 + j])
                            self.solutionButtons[(i, j)].resize(100, 100)
                            self.solutionButtons[(i, j)].clicked.connect(
                                self.onWRTVariablePress(varButtons[i * 2 + j], operation))
                            self.solutionOptionsBox.addWidget(
                                self.solutionButtons[(i, j)], i, j) 
Example #11
Source File: window.py    From visma with GNU General Public License v3.0 6 votes vote down vote up
def onActivated(self, text):
        for i in reversed(range(self.inputBox.count())):
            self.inputBox.itemAt(i).widget().setParent(None)
        for i in range(4):
            for j in range(10):
                if str(text) in "Greek":
                    if (i * 10 + j) < len(self.inputGreek):
                        self.buttons[(i, j)] = QtWidgets.QPushButton(
                            self.inputGreek[i * 10 + j])
                        self.buttons[(i, j)].resize(100, 100)
                        self.buttons[(i, j)].clicked.connect(
                            self.onInputPress(self.inputGreek[i * 10 + j]))
                        self.inputBox.addWidget(self.buttons[(i, j)], i, j)
                elif str(text) in "LaTeX":
                    if (i * 10 + j) < len(self.inputLaTeX):
                        self.buttons[(i, j)] = QtWidgets.QPushButton(
                            self.inputLaTeX[i * 10 + j])
                        self.buttons[(i, j)].resize(100, 100)
                        self.buttons[(i, j)].clicked.connect(
                            self.onInputPress(self.inputLaTeX[i * 10 + j]))
                        self.inputBox.addWidget(self.buttons[(i, j)], i, j)
        self.selectedCombo = str(text) 
Example #12
Source File: first.py    From FIRST-plugin-ida with GNU General Public License v2.0 6 votes vote down vote up
def view_configuration_info(self):
        self.thread_stop = True
        container = QtWidgets.QVBoxLayout()

        label = QtWidgets.QLabel('Configuration Information')
        label.setStyleSheet('font: 18px;')
        container.addWidget(label)

        layout = QtWidgets.QHBoxLayout()
        self.message = QtWidgets.QLabel()
        layout.addWidget(self.message)
        layout.addStretch()
        save_button = QtWidgets.QPushButton('Save')
        layout.addWidget(save_button)

        scroll_layout = FIRSTUI.ScrollWidget(frame=QtWidgets.QFrame.NoFrame)
        FIRSTUI.SharedObjects.server_config_layout(self, scroll_layout, FIRST.config)

        container.addWidget(scroll_layout)
        container.addStretch()
        container.addLayout(layout)

        save_button.clicked.connect(self.save_config)

        return container 
Example #13
Source File: pkwidgets.py    From pkmeter with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, etree, control, parent=None):
        QtWidgets.QPushButton.__init__(self)
        self.setLayout(QtWidgets.QHBoxLayout())
        self.layout().setContentsMargins(0,0,0,0)
        self.layout().setSpacing(0)
        pkmixins.LayoutMixin._init(self, etree, control, parent) 
Example #14
Source File: pkwidgets.py    From pkmeter with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, etree, control, parent=None):
        QtWidgets.QPushButton.__init__(self)
        self.enabled = False                                # Holds switch state
        self.bgcolor_slider = utils.window_bgcolor()        # Background color of the slider
        pkmixins.LayoutMixin._init(self, etree, control, parent) 
Example #15
Source File: ui_about.py    From multibootusb with GNU General Public License v2.0 5 votes vote down vote up
def setupUi(self, About):
        About.setObjectName("About")
        About.resize(498, 369)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(About.sizePolicy().hasHeightForWidth())
        About.setSizePolicy(sizePolicy)
        self.verticalLayout = QtWidgets.QVBoxLayout(About)
        self.verticalLayout.setObjectName("verticalLayout")
        self.gridLayout_11 = QtWidgets.QGridLayout()
        self.gridLayout_11.setObjectName("gridLayout_11")
        self.label_6 = QtWidgets.QLabel(About)
        self.label_6.setObjectName("label_6")
        self.gridLayout_11.addWidget(self.label_6, 1, 1, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem, 1, 2, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem1, 1, 0, 1, 1)
        spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem2, 0, 1, 1, 1)
        spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_11.addItem(spacerItem3, 2, 1, 1, 1)
        self.verticalLayout.addLayout(self.gridLayout_11)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem4)
        self.button_close = QtWidgets.QPushButton(About)
        self.button_close.setObjectName("button_close")
        self.horizontalLayout.addWidget(self.button_close)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(About)
        QtCore.QMetaObject.connectSlotsByName(About) 
Example #16
Source File: main_gui.py    From simnibs with GNU General Public License v3.0 5 votes vote down vote up
def selectFileLayout(self):

        self.select_file = QtWidgets.QGroupBox('')
        layout = QtWidgets.QGridLayout()

        tag_m2m = QtWidgets.QLabel('<b>m2m Folder:<\\b>')
        layout.addWidget(tag_m2m, 1, 0, 1, 3)

        self.m2m_folder_lineEdit = QtWidgets.QLineEdit()
        layout.addWidget(self.m2m_folder_lineEdit, 2, 0, 1, 3)
 
        file_browse_m2m = QtWidgets.QPushButton('Browse')
        file_browse_m2m.clicked.connect(self.m2mFolderDialog)
        layout.addWidget(file_browse_m2m,2,3,1,1)

        tag = QtWidgets.QLabel('<b>Head Mesh:<\\b>')
        layout.addWidget(tag,3,0,1,3)

        self.file_name = QtWidgets.QLineEdit()
        layout.addWidget(self.file_name, 4, 0, 1, 3)
 
        file_browse = QtWidgets.QPushButton('Browse')
        file_browse.clicked.connect(self.fileDialog)
        layout.addWidget(file_browse, 4, 3, 1, 1)

        tag_Out = QtWidgets.QLabel('<b>Output Folder:<\\b>')
        layout.addWidget(tag_Out,5,0,1,3)

        self.out_folder_lineEdit = QtWidgets.QLineEdit()
        layout.addWidget(self.out_folder_lineEdit,6,0,1,3)
 
        file_browse_out = QtWidgets.QPushButton('Browse')
        file_browse_out.clicked.connect(self.outFolderDialog)
        layout.addWidget(file_browse_out,6,3,1,1)



        self.select_file.setLayout(layout) 
Example #17
Source File: main_gui.py    From simnibs with GNU General Public License v3.0 5 votes vote down vote up
def poslistTabs(self):
        poslistsTabs = QtWidgets.QGroupBox("Position Lists:")
        layout = QtWidgets.QGridLayout()
        self.poslistTabWidget = QtWidgets.QTabWidget()
        #elc_table = ElcTable(0,3,self.headModelWidget.glHeadModel,self)
        #self.poslistTabWidget.addTab(elc_table.generateGroupBox(), "tDCS")
        layout.addWidget(self.poslistTabWidget,0,0,3,0)

        add_tDCS_button = QtWidgets.QPushButton("Add tDCS Poslist")
        add_tDCS_button.clicked.connect(self.addTdcsPoslistTab)
        layout.addWidget(add_tDCS_button,3,0)

        add_TMS_button = QtWidgets.QPushButton("Add TMS Poslist")
        add_TMS_button.clicked.connect(self.addTmsPoslistTab)
        layout.addWidget(add_TMS_button,3,1)

        copy_button = QtWidgets.QPushButton("Copy Poslist")
        copy_button.clicked.connect(self.copyPoslist)
        layout.addWidget(copy_button,3,2)

        self.poslistTabWidget.setTabsClosable(True)
        self.poslistTabWidget.tabCloseRequested.connect(self.removePoslistTab)

        self.poslistTabWidget.currentChanged.connect(self.changeGlStimulators)
        #self.pos

        poslistsTabs.setLayout(layout)

        return poslistsTabs

    #Adds a tdcs-type tab to the poslist tabs 
Example #18
Source File: main_gui.py    From simnibs with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, centre, reference, name, glHeadModel):
        super(Position_GUI, self).__init__()
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
        self.centre = centre
        self.reference = reference
        self.glHeadModel = glHeadModel
        self.ogl_object = None
        self.name = name
        glHeadModel.windowClicked.connect(self.getClickedPosition)

        mainLayout = QtWidgets.QGridLayout()

        self.set_position_layout()
        self.set_direction_layout()
        #self.getClickedPosition()

        mainLayout.addWidget(self.position_box,0,0,1,2)
        mainLayout.addWidget(self.direction_box,1,0,1,2)

        self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)

        mainLayout.addWidget(self.button_box,2,1,1,3)


        self.project_button = QtWidgets.QPushButton('Project on scalp') 
        self.project_button.clicked.connect(self.project_points)
        mainLayout.addWidget(self.project_button,2,0,1,1)

        self.setLayout(mainLayout)
        self.setWindowTitle("Position")
        self.el_type = []
        self.el_coords = []
        self.el_name = []
        self.load_cap()
        #self.resize(200,300) 
Example #19
Source File: main_gui.py    From simnibs with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, simulist):
        super(ConductivitiesGui, self).__init__()

        self.simulist = simulist

        mainLayout = QtWidgets.QVBoxLayout()

        self.setCondTable()
        self.tensorBox = self.setTensorThings()
        self.changeCondType()

        mainLayout.addWidget(self.condTable)
        mainLayout.addWidget(self.tensorBox)

        self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.button_box.accepted.connect(self.checkAndAccept)
        #self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)
        self.resetButton = QtWidgets.QPushButton("Reset")
        self.resetButton.clicked.connect(self.reset)
        self.button_box.addButton(self.resetButton, QtWidgets.QDialogButtonBox.ResetRole)

        mainLayout.addWidget(self.button_box)

        self.setLayout(mainLayout)    
        self.setWindowTitle("Conductivities")
        self.resize(450,400) 
Example #20
Source File: simulation_menu.py    From simnibs with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, fname_tensor):
        super(tensorFilesDialog, self).__init__(parent)

        self.fname = fname_tensor

        groupBox = QtWidgets.QGroupBox('Tensor File')
        layout = QtWidgets.QHBoxLayout()

        groupBox.lineEdit = QtWidgets.QLineEdit()
        if self.fname is not None:
            groupBox.lineEdit.setText(self.fname)
        layout.addWidget(groupBox.lineEdit)

        groupBox.selectFile = QtWidgets.QPushButton('&Browse')
        groupBox.selectFile.clicked.connect(lambda: self.selectFile())
        layout.addWidget(groupBox.selectFile)

        groupBox.setLayout(layout)
        self.group_box = groupBox

        self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)

        mainLayout = QtWidgets.QGridLayout()

        mainLayout.addWidget(self.group_box)
        mainLayout.addWidget(self.button_box)

        self.setLayout(mainLayout)  

        self.setWindowTitle('Tensor file names')
        self.resize(400,200) 
Example #21
Source File: simulation_menu.py    From simnibs with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, eeg_cap):
        super(EEGFileDialog, self).__init__(parent)

        self.fname = eeg_cap

        groupBox = QtWidgets.QGroupBox('EEG Cap File')
        layout = QtWidgets.QHBoxLayout()

        groupBox.lineEdit = QtWidgets.QLineEdit()
        if self.fname is not None:
            groupBox.lineEdit.setText(self.fname)
        layout.addWidget(groupBox.lineEdit)

        groupBox.selectFile = QtWidgets.QPushButton('&Browse')
        groupBox.selectFile.clicked.connect(self.selectFile)
        layout.addWidget(groupBox.selectFile)

        groupBox.setLayout(layout)
        self.group_box = groupBox

        self.button_box = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)

        mainLayout = QtWidgets.QGridLayout()

        mainLayout.addWidget(self.group_box)
        mainLayout.addWidget(self.button_box)

        self.setLayout(mainLayout)  

        self.setWindowTitle('Tensor file names')
        self.resize(400,200) 
Example #22
Source File: simulation_menu.py    From simnibs with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        super(SimProgressScreen, self).__init__()

        self.text = ''
        self.simFinished = False

        self.textBox = QtWidgets.QTextEdit()
        self.textBox.setReadOnly(True)
        self.textBox.setAcceptRichText(True)


        self.terminate_btn = QtWidgets.QPushButton('Terminate')
        self.terminate_btn.clicked.connect(self.close)

        mainLayout = QtWidgets.QGridLayout()

        mainLayout.addWidget(self.textBox)
        mainLayout.addWidget(self.terminate_btn)

        self.central_widget = QtWidgets.QWidget()
        self.central_widget.setLayout(mainLayout)


        self.setCentralWidget(self.central_widget)


        self.resize(800,500)

        self.setWindowTitle('Simulation Progress')
        try:
            gui_icon = os.path.join(SIMNIBSDIR,'resources', 'gui_icon.gif')
            self.setWindowIcon(QtGui.QIcon(gui_icon))
        except:
            pass 
Example #23
Source File: static_opaque_analysis.py    From idasec with GNU Lesser General Public License v2.1 5 votes vote down vote up
def make_progress_bar(self, parent):
        horizontalLayout_2 = QtWidgets.QHBoxLayout()
        horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.loading_stat = QtWidgets.QLabel(parent)
        horizontalLayout_2.addWidget(self.loading_stat)
        self.progressbar_loading = QtWidgets.QProgressBar(parent)
        horizontalLayout_2.addWidget(self.progressbar_loading)
        self.stop_button = QtWidgets.QPushButton(parent)
        self.stop_button.setMaximumSize(QtCore.QSize(50, 30))
        self.stop_button.setText("stop")
        horizontalLayout_2.addWidget(self.stop_button)
        self.stop_button.clicked.connect(self.stop_button_clicked)
        return horizontalLayout_2 
Example #24
Source File: xrefwindow.py    From dcc with Apache License 2.0 5 votes vote down vote up
def __init__(self,
                 parent=None,
                 win=None,
                 method_analysis=None):
        super(XrefDialogMethod, self).__init__(parent)
        self.method_analysis = method_analysis

        title = "Xrefs for the method %s" % self.method_analysis.method

        self.setWindowTitle(title)

        xrefs_list = []

        xrefs_from = self.method_analysis.get_xref_from()
        for ref_class, ref_method, _ in xrefs_from:
            xrefs_list.append(('From', ref_method, ref_class.get_vm_class()))

        xrefs_to = self.method_analysis.get_xref_to()
        for ref_class, ref_method, _ in xrefs_to:
            xrefs_list.append(('To', ref_method, ref_class.get_vm_class()))

        closeButton = QtWidgets.QPushButton("Close")
        closeButton.clicked.connect(self.close)

        xreflayout = QtWidgets.QGridLayout()
        xrefwin = XrefListView(self, win=win, xrefs=xrefs_list)
        xreflayout.addWidget(xrefwin, 0, 0)

        buttonsLayout = QtWidgets.QHBoxLayout()
        buttonsLayout.addStretch(1)
        buttonsLayout.addWidget(closeButton)

        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.addLayout(xreflayout)
        mainLayout.addLayout(buttonsLayout)

        self.setLayout(mainLayout) 
Example #25
Source File: xrefwindow.py    From dcc with Apache License 2.0 5 votes vote down vote up
def __init__(self,
                 parent=None,
                 win=None,
                 current_class=None,
                 class_analysis=None,
                 field_analysis=None):
        super(XrefDialogField, self).__init__(parent)
        self.current_class = current_class
        self.class_analysis = class_analysis
        self.field_analysis = field_analysis

        title = "Xrefs for the field %s" % self.field_analysis.field

        self.setWindowTitle(title)

        xrefs_list = []

        xrefs_read = self.field_analysis.get_xref_read()
        for ref_class, ref_method in xrefs_read:
            xrefs_list.append(('Read', ref_method, ref_class.get_vm_class()))

        xrefs_write = self.field_analysis.get_xref_write()
        for ref_class, ref_method in xrefs_write:
            xrefs_list.append(('Write', ref_method, ref_class.get_vm_class()))

        closeButton = QtWidgets.QPushButton("Close")
        closeButton.clicked.connect(self.close)

        xreflayout = QtWidgets.QGridLayout()
        xrefwin = XrefListView(self, win=win, xrefs=xrefs_list)
        xreflayout.addWidget(xrefwin, 0, 0)

        buttonsLayout = QtWidgets.QHBoxLayout()
        buttonsLayout.addStretch(1)
        buttonsLayout.addWidget(closeButton)

        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.addLayout(xreflayout)
        mainLayout.addLayout(buttonsLayout)

        self.setLayout(mainLayout) 
Example #26
Source File: xrefwindow.py    From dcc with Apache License 2.0 5 votes vote down vote up
def __init__(self, parent=None, win=None, string_analysis=None):
        super(XrefDialogString, self).__init__(parent)
        self.string_analysis = string_analysis

        title = "Xrefs for the string %s" % self.string_analysis.value

        self.setWindowTitle(title)

        xrefs_list = []

        xrefs_from = self.string_analysis.get_xref_from()
        for ref_class, ref_method in xrefs_from:
            xrefs_list.append(('From', ref_method, ref_class.get_vm_class()))

        closeButton = QtWidgets.QPushButton("Close")
        closeButton.clicked.connect(self.close)

        xreflayout = QtWidgets.QGridLayout()
        xrefwin = XrefListView(self, win=win, xrefs=xrefs_list)
        xreflayout.addWidget(xrefwin, 0, 0)

        buttonsLayout = QtWidgets.QHBoxLayout()
        buttonsLayout.addStretch(1)
        buttonsLayout.addWidget(closeButton)

        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.addLayout(xreflayout)
        mainLayout.addLayout(buttonsLayout)

        self.setLayout(mainLayout) 
Example #27
Source File: utils.py    From easygui_qt with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def add_button(layout, label, parent):
    btn = qt_widgets.QPushButton(label)
    btn.clicked.connect(parent.button_clicked)
    width = btn.fontMetrics().boundingRect(label).width() + 15
    btn.setMaximumWidth(width)
    layout.addWidget(btn) 
Example #28
Source File: New.py    From Python-GUI with MIT License 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.label = QtWidgets.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(100, 40, 201, 81))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")

        
        self.pushButton = QtWidgets.QPushButton(Form)
        self.pushButton.setGeometry(QtCore.QRect(150, 190, 111, 28))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.pushButton.setFont(font)
        self.pushButton.setObjectName("pushButton")
        
        self.lineEdit = QtWidgets.QLineEdit(Form)
        self.lineEdit.setGeometry(QtCore.QRect(100, 140, 201, 22))
        self.lineEdit.setObjectName("lineEdit")

        
        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #29
Source File: openWindow.py    From Python-GUI with MIT License 5 votes vote down vote up
def setupUi(self, OpenWindow):
        OpenWindow.setObjectName("OpenWindow")
        OpenWindow.resize(535, 389)
        self.centralwidget = QtWidgets.QWidget(OpenWindow)
        self.centralwidget.setObjectName("centralwidget")
        
        self.OpenTeam = QtWidgets.QLabel(self.centralwidget)
        self.OpenTeam.setGeometry(QtCore.QRect(150, 120, 231, 20))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.OpenTeam.setFont(font)
        self.OpenTeam.setObjectName("OpenTeam")

        
        self.OpenTheTeam = QtWidgets.QLineEdit(self.centralwidget)
        self.OpenTheTeam.setGeometry(QtCore.QRect(180, 160, 151, 22))
        self.OpenTheTeam.setObjectName("OpenTheTeam")
        
        self.openButton = QtWidgets.QPushButton(self.centralwidget)
        self.openButton.setGeometry(QtCore.QRect(210, 210, 93, 28))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.openButton.setFont(font)
        self.openButton.setObjectName("openButton")
        
        OpenWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(OpenWindow)
        self.statusbar.setObjectName("statusbar")
        OpenWindow.setStatusBar(self.statusbar)

        self.retranslateUi(OpenWindow)
        QtCore.QMetaObject.connectSlotsByName(OpenWindow) 
Example #30
Source File: intro_dlg.py    From mindfulness-at-the-computer with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        super().__init__()

        self.wizard_qsw_w3 = QtWidgets.QStackedWidget()
        self.prev_qpb = QtWidgets.QPushButton(PREV_STR)
        self.next_qpb = QtWidgets.QPushButton(NEXT_STR)

        self.initial_setup = TimingInitSetupPage()
        self._init_ui()