Python PySide.QtGui.QLineEdit() Examples

The following are 30 code examples of PySide.QtGui.QLineEdit(). 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 PySide.QtGui , or try the search function .
Example #1
Source File: renamewindow.py    From TimeMachine with GNU Lesser General Public License v3.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 = QtGui.QGridLayout()
        question = QtGui.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtGui.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtGui.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtGui.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 #2
Source File: stringswindow.py    From TimeMachine with GNU Lesser General Public License v3.0 7 votes vote down vote up
def __init__(self, parent=None, win=None, session=None):
        super(StringsWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Strings"

        self.filterPatternLineEdit = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter string pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.stringswindow = StringsValueWindow(self, win, session)

        sourceLayout = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.stringswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #3
Source File: xrefwindow.py    From TimeMachine with GNU Lesser General Public License v3.0 7 votes vote down vote up
def __init__(self, parent=None, win=None, xrefs=None, headers=["Origin", "Method"]):
        super(XrefListView, self).__init__(parent)
        self.parent = parent
        self.mainwin = win
        self.xrefs = xrefs
        self.headers = headers

        self.setMinimumSize(600, 400)

        self.filterPatternLineEdit = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter origin pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.xrefwindow = XrefValueWindow(self, win, self.xrefs, self.headers)

        sourceLayout = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.xrefwindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #4
Source File: renamewindow.py    From MARA_Framework with GNU Lesser General Public License v3.0 6 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 = QtGui.QGridLayout()
        question = QtGui.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtGui.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtGui.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtGui.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: stringswindow.py    From MARA_Framework with GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, session=None):
        super(StringsWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Strings"

        self.filterPatternLineEdit = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter string pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.stringswindow = StringsValueWindow(self, win, session)

        sourceLayout = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.stringswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #6
Source File: renamewindow.py    From AndroBugs_Framework with GNU General Public License v3.0 6 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 = QtGui.QGridLayout()
        question = QtGui.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtGui.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtGui.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtGui.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 #7
Source File: stringswindow.py    From AndroBugs_Framework with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, session=None):
        super(StringsWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Strings"

        self.filterPatternLineEdit = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter string pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.stringswindow = StringsValueWindow(self, win, session)

        sourceLayout = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.stringswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #8
Source File: xrefwindow.py    From AndroBugs_Framework with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, xrefs=None, headers=["Origin", "Method"]):
        super(XrefListView, self).__init__(parent)
        self.parent = parent
        self.mainwin = win
        self.xrefs = xrefs
        self.headers = headers

        self.setMinimumSize(600, 400)

        self.filterPatternLineEdit = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter origin pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.xrefwindow = XrefValueWindow(self, win, self.xrefs, self.headers)

        sourceLayout = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.xrefwindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #9
Source File: xrefwindow.py    From MARA_Framework with GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, xrefs=None, headers=["Origin", "Method"]):
        super(XrefListView, self).__init__(parent)
        self.parent = parent
        self.mainwin = win
        self.xrefs = xrefs
        self.headers = headers

        self.setMinimumSize(600, 400)

        self.filterPatternLineEdit = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter origin pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.xrefwindow = XrefValueWindow(self, win, self.xrefs, self.headers)

        sourceLayout = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.xrefwindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #10
Source File: preferences.py    From FreeCAD_drawing_dimensioning with GNU Lesser General Public License v2.1 6 votes vote down vote up
def generateWidget( self, dimensioningProcess, width = 60, height = 30 ):
        self.dimensioningProcess = dimensioningProcess
        colorBox = QtGui.QGraphicsView( self.graphicsScene )
        colorBox.setMaximumWidth( width )
        colorBox.setMaximumHeight( height )
        colorBox.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff )
        colorBox.setVerticalScrollBarPolicy( QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOff )
        self.family_textbox = QtGui.QLineEdit()
        self.size_textbox = QtGui.QLineEdit()

        groupbox = QtGui.QGroupBox(self.label)
        hbox = QtGui.QHBoxLayout()
        hbox.addWidget( self.family_textbox )
        hbox.addStretch(1)
        hbox.addWidget( self.size_textbox )
        hbox.addStretch(1)
        hbox.addWidget( colorBox )
        groupbox.setLayout(hbox)
        self.revertToDefault()
        self.family_textbox.textChanged.connect( self.update_dimensionConstructorKWs )
        self.size_textbox.textChanged.connect( self.update_dimensionConstructorKWs )
        return groupbox 
Example #11
Source File: GDT.py    From FreeCAD-GDT with GNU Lesser General Public License v2.1 6 votes vote down vote up
def generateWidget( self, idGDT, ContainerOfData ):
        self.idGDT = idGDT
        self.ContainerOfData = ContainerOfData
        self.lineEdit = QtGui.QLineEdit()
        if self.Mask <> None:
            self.lineEdit.setInputMask(self.Mask)
        if self.Dictionary == None:
            self.lineEdit.setText('text')
            self.text = 'text'
        else:
            NumberOfObjects = self.getNumberOfObjects()
            if NumberOfObjects > len(self.Dictionary)-1:
                NumberOfObjects = len(self.Dictionary)-1
            self.lineEdit.setText(self.Dictionary[NumberOfObjects])
            self.text = self.Dictionary[NumberOfObjects]
        self.lineEdit.textChanged.connect(self.valueChanged)
        self.ContainerOfData.textName = self.text.strip()
        return GDTDialog_hbox(self.Text,self.lineEdit) 
Example #12
Source File: CanvasRbfEditor.py    From Fabric-RBF with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def __init__(self,orientation,parent=None):
        super(MetaHeaderView, self).__init__(orientation,parent)
        self.setMovable(True)
        self.setClickable(True)
        # This block sets up the edit line by making setting the parent
        # to the Headers Viewport.
        self.line = QtGui.QLineEdit(parent=self.viewport())  #Create
        self.line.setAlignment(QtCore.Qt.AlignTop) # Set the Alignmnet
        self.line.setHidden(True) # Hide it till its needed
        # This is needed because I am having a werid issue that I believe has
        # to do with it losing focus after editing is done.
        self.line.blockSignals(True)
        self.sectionedit = 0
        # Connects to double click
        self.sectionDoubleClicked.connect(self.editHeader)
        self.line.editingFinished.connect(self.doneEditing) 
Example #13
Source File: mainform.py    From Satori with Artistic License 2.0 6 votes vote down vote up
def fill_bridges_list(self):
        self.bridges_layout = QtGui.QVBoxLayout(self.bridges_scrollarea_widget_contents)
        self.bridges_layout.setContentsMargins(5, 5, 5, 5)
        font = self.get_default_font(8)

        def bridges_factory(bridge):
            edit = QtGui.QLineEdit(bridge)
            edit.setFont(font)
            edit.setStyleSheet("color:white;background:rgba(142, 116, 173, 100);border: 0px;border-radius: 5px;")
            edit.setReadOnly(True)
            return edit

        with open("bridges.json", 'r') as f:
            bridges_list = json.load(f)

        for bridge in bridges_list:
            bridge_widget = bridges_factory(bridge)
            self.bridges_layout.addWidget(bridge_widget)

        self.bridges_layout.addStretch()
        self.software_scrollarea.setWidget(self.software_layout.widget()) 
Example #14
Source File: windowConsole.py    From PySimulator with GNU Lesser General Public License v3.0 6 votes vote down vote up
def keyPressEvent(self, event):
        if event.key() == QtCore.Qt.Key_Up:
            self.current = (self.current + 1) % len(self.history)
            self.setText(self.history[len(self.history) - self.current - 1])
            event.accept()
        elif event.key() == QtCore.Qt.Key_Down:
            self.current = (self.current - 1) % len(self.history)
            self.setText(self.history[len(self.history) - self.current - 1])
            event.accept()
        elif event.key() == QtCore.Qt.Key_Return:
            self.history.append(self.text())
            self.commandEntered.emit(self.text())
            self.clear()
            self.current = -1
            event.accept()
        else:
            QtGui.QLineEdit.keyPressEvent(self, event) 
Example #15
Source File: edl_importer_UI_pyside.py    From anima with MIT License 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(923, 542)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName("formLayout")
        self.media_files_path_lineEdit = QtGui.QLineEdit(Dialog)
        self.media_files_path_lineEdit.setObjectName("media_files_path_lineEdit")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.media_files_path_lineEdit)
        self.label = QtGui.QLabel(Dialog)
        self.label.setObjectName("label")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label)
        self.label_2 = QtGui.QLabel(Dialog)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_2)
        self.verticalLayout.addLayout(self.formLayout)
        self.edl_preview_plainTextEdit = QtGui.QPlainTextEdit(Dialog)
        self.edl_preview_plainTextEdit.setReadOnly(True)
        self.edl_preview_plainTextEdit.setObjectName("edl_preview_plainTextEdit")
        self.verticalLayout.addWidget(self.edl_preview_plainTextEdit)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.send_pushButton = QtGui.QPushButton(Dialog)
        self.send_pushButton.setObjectName("send_pushButton")
        self.horizontalLayout_2.addWidget(self.send_pushButton)
        self.verticalLayout.addLayout(self.horizontalLayout_2)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
        Dialog.setTabOrder(self.media_files_path_lineEdit, self.edl_preview_plainTextEdit)
        Dialog.setTabOrder(self.edl_preview_plainTextEdit, self.send_pushButton) 
Example #16
Source File: login_dialog_UI_pyside.py    From anima with MIT License 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
        Dialog.resize(364, 138)
        Dialog.setModal(True)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setContentsMargins(-1, 10, -1, -1)
        self.formLayout.setObjectName("formLayout")
        self.login_or_email_label = QtGui.QLabel(Dialog)
        self.login_or_email_label.setObjectName("login_or_email_label")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.login_or_email_label)
        self.login_or_email_lineEdit = QtGui.QLineEdit(Dialog)
        self.login_or_email_lineEdit.setInputMask("")
        self.login_or_email_lineEdit.setObjectName("login_or_email_lineEdit")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.login_or_email_lineEdit)
        self.password_label = QtGui.QLabel(Dialog)
        self.password_label.setObjectName("password_label")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.password_label)
        self.password_lineEdit = QtGui.QLineEdit(Dialog)
        self.password_lineEdit.setInputMask("")
        self.password_lineEdit.setText("")
        self.password_lineEdit.setEchoMode(QtGui.QLineEdit.Password)
        self.password_lineEdit.setObjectName("password_lineEdit")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.password_lineEdit)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.buttonBox)
        self.verticalLayout.addLayout(self.formLayout)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #17
Source File: Shared.py    From cadquery-freecad-module with GNU Lesser General Public License v3.0 5 votes vote down vote up
def populateParameterEditor(parameters):
    """Puts the proper controls in the script variable editor pane based on the parameters found"""

    mw = FreeCADGui.getMainWindow()

    # If the widget is open, we need to close it
    dockWidgets = mw.findChildren(QtGui.QDockWidget)
    for widget in dockWidgets:
        if widget.objectName() == "cqVarsEditor":
            gridLayout = QtGui.QGridLayout()

            line = 1

            # Add controls for all the parameters so that they can be edited from the GUI
            for pKey, pVal in list(parameters.items()):
                label = QtGui.QLabel(pKey)

                # We want to keep track of this parameter value field so that we can pull its value later when executing
                value = QtGui.QLineEdit()
                value.setText(str(pVal.default_value))
                value.setObjectName("pcontrol_" + pKey)

                # Add the parameter control sets, one set per line
                gridLayout.addWidget(label, line, 0)
                gridLayout.addWidget(value, line, 1)

                line += 1

            # Create a widget we can put the layout in and add a scrollbar
            newWidget = QtGui.QWidget()
            newWidget.setLayout(gridLayout)

            # Add a scroll bar in case there are a lot of variables in the script
            scrollArea = QtGui.QScrollArea()
            scrollArea.setBackgroundRole(QtGui.QPalette.Light)
            scrollArea.setStyleSheet("QLabel { color : black; }");
            scrollArea.setWidget(newWidget)

            widget.setWidget(scrollArea) 
Example #18
Source File: gui.py    From autopilot with Mozilla Public License 2.0 5 votes vote down vote up
def populate_params(self, params=None):
        """
        Repopulate the widget with fields to edit graduation parameters, fill fields
        if we are passed `params`.

        Each :class:`QtGui.QLineEdit` 's :py:meth:`.QLineEdit.editingFinished` signal is connected
        to :py:meth:`.Graduation_Widget.store_param` .

        TODO:
            For now we assume all parameters are defined with a text edit box, so it's not
            clear how we'd do boolean parameters for example. This will be fixed with refactoring
            the parameter scheme, the first order of business for v0.3.

        Args:
            params (dict): In the case that :class:`.Protocol_Wizard` switches us back to
                a step where we have already defined graduation parameters, it will pass them
                so we can repopulate the relevant widgets with them.
        """
        self.clear_params()
        self.type = self.type_selection.currentText()
        self.param_dict['type'] = self.type

        for k in tasks.GRAD_LIST[self.type].PARAMS:
            edit_box = QtGui.QLineEdit()
            edit_box.setObjectName(k)
            edit_box.editingFinished.connect(self.store_param)
            if isinstance(params, dict):
                if k in params.keys():
                    edit_box.setText(params[k])
            self.param_layout.addRow(QtGui.QLabel(k), edit_box) 
Example #19
Source File: gui.py    From autopilot with Mozilla Public License 2.0 5 votes vote down vote up
def populate_params(self):
            """
            When a sound type is selected, make a :class:`.QtGui.QLineEdit` for each
            `PARAM` in its definition.
            """
            self.clear_params()

            self.type = self.type_selection.currentText()
            self.param_dict['type'] = self.type

            for k in sounds.SOUND_LIST[self.type].PARAMS:
                edit_box = QtGui.QLineEdit()
                edit_box.setObjectName(k)
                edit_box.editingFinished.connect(self.store_param)
                self.param_layout.addRow(QtGui.QLabel(k), edit_box) 
Example #20
Source File: findWidget_UIs.py    From CNCGToolKit with MIT License 5 votes vote down vote up
def setupUi(self, findReplace):
        findReplace.setObjectName("findReplace")
        findReplace.resize(246, 101)
        self.verticalLayout = QtGui.QVBoxLayout(findReplace)
        self.verticalLayout.setObjectName("verticalLayout")
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.replace_le = QtGui.QLineEdit(findReplace)
        self.replace_le.setObjectName("replace_le")
        self.gridLayout.addWidget(self.replace_le, 1, 0, 1, 1)
        self.find_le = QtGui.QLineEdit(findReplace)
        self.find_le.setObjectName("find_le")
        self.gridLayout.addWidget(self.find_le, 0, 0, 1, 1)
        self.find_btn = QtGui.QPushButton(findReplace)
        self.find_btn.setObjectName("find_btn")
        self.gridLayout.addWidget(self.find_btn, 0, 1, 1, 1)
        self.replace_btn = QtGui.QPushButton(findReplace)
        self.replace_btn.setObjectName("replace_btn")
        self.gridLayout.addWidget(self.replace_btn, 1, 1, 1, 1)
        self.replaceAll_btn = QtGui.QPushButton(findReplace)
        self.replaceAll_btn.setObjectName("replaceAll_btn")
        self.gridLayout.addWidget(self.replaceAll_btn, 2, 1, 1, 1)
        self.verticalLayout.addLayout(self.gridLayout)

        self.retranslateUi(findReplace)
        QtCore.QMetaObject.connectSlotsByName(findReplace)
        findReplace.setTabOrder(self.find_le, self.replace_le)
        findReplace.setTabOrder(self.replace_le, self.find_btn)
        findReplace.setTabOrder(self.find_btn, self.replace_btn)
        findReplace.setTabOrder(self.replace_btn, self.replaceAll_btn) 
Example #21
Source File: preferences.py    From FreeCAD_drawing_dimensioning with GNU Lesser General Public License v2.1 5 votes vote down vote up
def generateWidget( self, dimensioningProcess ):
        self.dimensioningProcess = dimensioningProcess
        textbox = QtGui.QLineEdit()
        #debugPrint(1,self.getDefaultValue() )
        textbox.setText( self.getDefaultValue() )
        textbox.textChanged.connect( self.valueChanged )
        self.textbox = textbox
        return  DimensioningTaskDialog_generate_row_hbox( self.label, textbox ) 
Example #22
Source File: VariablesBrowser.py    From PySimulator with GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, numberedModelName, variable):
        self.numberedModelName = numberedModelName
        self.variable = variable
        QtGui.QLineEdit.__init__(self)
        self.setFrame(True)

        ''' Set background to white as default
        '''
        self._palette = QtGui.QPalette()
        self._palette.setColor(self.backgroundRole(), QtGui.QColor(255, 255, 255))
        self.setPalette(self._palette)

        self.editingFinished.connect(self._relay)
        self.textEdited.connect(self._edited) 
Example #23
Source File: plotWidget.py    From PySimulator with GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, parent):
        QtGui.QDialog.__init__(self, parent)
        self.setWindowTitle("Set Selection")
        layout = QtGui.QGridLayout(self)
        self.setLayout(layout)
        self.minIn = QtGui.QLineEdit(self)
        layout.addWidget(QtGui.QLabel("Min: "), 0, 0)
        layout.addWidget(self.minIn, 0, 1)
        self.maxIn = QtGui.QLineEdit(self)
        layout.addWidget(QtGui.QLabel("Max: "), 1, 0)
        layout.addWidget(self.maxIn, 1, 1)
        done = QtGui.QPushButton("Done", self)
        done.clicked.connect(self.selectionDone)
        layout.addWidget(done) 
Example #24
Source File: windowConsole.py    From PySimulator with GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        QtGui.QLineEdit.__init__(self, parent)

        self.history = list()
        self.current = -1 
Example #25
Source File: toolwidget.py    From LCInterlocking with GNU Lesser General Public License v2.1 5 votes vote down vote up
def create_item(self, widget_config, grid, row_index):
        widget_config.widget_title = QtGui.QLabel(self.form)
        widget_config.widget_title.setText("%s : " % widget_config.show_name)

        if widget_config.type == float and not hasattr(widget_config, 'step'):
            widget_config.widget = QtGui.QLabel(self.form)
            widget_config.widget.setText("%f" % self.get_property_value(widget_config.name))
        elif widget_config.type == float:
            widget_config.widget = QtGui.QDoubleSpinBox(self.form)
            widget_config.widget.setDecimals(widget_config.decimals)
            widget_config.widget.setSingleStep(widget_config.step)
            widget_config.widget.setMinimum(widget_config.interval_value[0])
            widget_config.widget.setMaximum(widget_config.interval_value[-1])
            widget_config.widget.setValue(self.get_property_value(widget_config.name))
        elif widget_config.type == bool:
            widget_config.widget = QtGui.QCheckBox("", self.form)
            state = QtCore.Qt.Checked if self.get_property_value(widget_config.name) == True else QtCore.Qt.Unchecked
            widget_config.widget.setCheckState(state)
        elif widget_config.type == list:
            widget_config.widget = QtGui.QComboBox(self.form)
            widget_config.widget.addItems(widget_config.interval_value)
            default_value_index = 0
            for str_value in widget_config.interval_value:
                if self.get_property_value(widget_config.name) == str_value:
                    break
                default_value_index += 1
            if default_value_index == len(widget_config.interval_value):
                raise ValueError("Default value not found for list" + widget_config.name)
            widget_config.widget.setCurrentIndex(default_value_index)
            widget_config.widget.currentIndexChanged.connect(self.listchangeIndex)
        elif widget_config.type == str:
            widget_config.widget = QtGui.QLineEdit(self.form)
            widget_config.widget.setText(self.get_property_value(widget_config.name))
        else:
            raise ValueError("Undefined widget type")

        grid.addWidget(widget_config.widget_title, row_index, 0)
        grid.addWidget(widget_config.widget, row_index, 1) 
Example #26
Source File: dataxrefcounter.py    From idapyscripts with MIT License 5 votes vote down vote up
def OnCreate(self, form):
        self.parent = self.FormToPySideWidget(form)
        self.tableWidget = QtGui.QTableWidget()
        self.seg_combo = QtGui.QComboBox()
        self.refcount_box = QtGui.QLineEdit()
        self.export_btn = QtGui.QPushButton("Export")
        self.export_btn.setDisabled(True)
        self.scan_btn = QtGui.QPushButton("Scan")
        self.minfilter_box = QtGui.QLineEdit()
        self.maxfilter_box = QtGui.QLineEdit()
        self.filter_btn = QtGui.QPushButton("Filter")
        self.filter_btn.setDisabled(True)
        self.sort_order = [QtCore.Qt.AscendingOrder, QtCore.Qt.AscendingOrder]
        self.PopulateForm() 
Example #27
Source File: QtShim.py    From grap with MIT License 5 votes vote down vote up
def get_QLineEdit():
    """QLineEdit getter."""

    try:
        import PySide.QtGui as QtGui
        return QtGui.QLineEdit
    except ImportError:
        import PyQt5.QtWidgets as QtWidgets
        return QtWidgets.QLineEdit 
Example #28
Source File: vfpfunc.py    From vfp2py with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
            QtGui.QLineEdit.__init__(self)
            Custom.__init__(self, *args, **kwargs) 
Example #29
Source File: animate_constraint.py    From FreeCAD_assembly2 with GNU Lesser General Public License v2.1 5 votes vote down vote up
def generateWidget( self, parameterDict, constraint_to_animate ):
        self.parameterDict = parameterDict
        self.constraint_to_animate = constraint_to_animate
        textbox = QtGui.QLineEdit()
        textbox.setText( self.getDefaultValue() )
        self.textbox = textbox
        return  Qt_label_widget( self.label, textbox, self.info_button_text ) 
Example #30
Source File: importDatumCmd.py    From FreeCAD_Assembly4 with GNU Lesser General Public License v2.1 5 votes vote down vote up
def drawUI(self):
        # Our main layoyt will be vertical
        self.mainLayout = QtGui.QVBoxLayout(self.form)

        # Define the fields for the form ( label + widget )
        self.formLayout = QtGui.QFormLayout()
        # Datum Type
        self.datumType = QtGui.QLineEdit()
        self.datumType.setReadOnly(True)
        self.formLayout.addRow(QtGui.QLabel('Datum Type'),self.datumType)
        # Datum Object
        self.datumOrig = QtGui.QLineEdit()
        self.datumOrig.setReadOnly(True)
        self.formLayout.addRow(QtGui.QLabel('Orig. Datum'),self.datumOrig)
        # Link instance
        self.linkName = QtGui.QLineEdit()
        self.linkName.setReadOnly(True)
        self.formLayout.addRow(QtGui.QLabel('Orig. Instance'),self.linkName)
        # Orig Part
        self.partName = QtGui.QLineEdit()
        self.partName.setReadOnly(True)
        self.formLayout.addRow(QtGui.QLabel('Orig. Doc#Part'),self.partName)
        # apply the layout
        self.mainLayout.addLayout(self.formLayout)
        
        # empty line
        self.mainLayout.addWidget(QtGui.QLabel())
        # the name as seen in the tree of the selected link
        self.datumName = QtGui.QLineEdit()
        self.mainLayout.addWidget(QtGui.QLabel("Enter the imported Datum's name :"))
        self.mainLayout.addWidget(self.datumName)

        # set main window widgets
        self.form.setLayout(self.mainLayout)