Ejemplo n.º 1
0
    def __init__(self,parent):
        global dao
        super(FindOrderDialog,self).__init__(parent)

        title = _("Find order")
        self.setWindowTitle(title)
        top_layout = QVBoxLayout()
        self.title_widget = TitleWidget(title,self)
        top_layout.addWidget(self.title_widget)

        hlayout = QHBoxLayout()
        hlayout.addWidget(QLabel(_("Search")))
        self.search_criteria = QLineEdit()
        self.search_criteria.setObjectName("search_criteria")
        hlayout.addWidget(self.search_criteria)
        top_layout.addLayout(hlayout)



        self.search_results_view = QTableView()

        self.headers_view = QHeaderView(Qt.Orientation.Horizontal)
        self.header_model = make_header_model([_("Preorder Nr"),_("Order Nr"),_("Customer Nr"),_("Customer"),_("Order Part")])
        self.headers_view.setModel(self.header_model) # qt's doc : The view does *not* take ownership (bt there's something with the selecion mode

        self.search_results_model = QStandardItemModel()
        self.search_results_view.setModel(self.search_results_model)

        self.search_results_view.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.search_results_view.setHorizontalHeader(self.headers_view)
        self.search_results_view.verticalHeader().hide()
        # self.search_results_view.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
        self.search_results_view.horizontalHeader().setResizeMode(3, QHeaderView.Stretch)
        self.search_results_view.horizontalHeader().setResizeMode(4, QHeaderView.Stretch)

        self.search_results_view.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.buttons = QDialogButtonBox()
        self.buttons.addButton( QDialogButtonBox.StandardButton.Cancel)
        self.buttons.addButton( QDialogButtonBox.Ok)
        self.buttons.button(QDialogButtonBox.Ok).setObjectName("go_search")

        top_layout.addWidget(self.search_results_view)
        top_layout.setStretch(2,1000)
        top_layout.addWidget(self.buttons)
        self.setLayout(top_layout)

        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject)
        self.search_results_view.activated.connect(self.row_activated)
        self.search_criteria.returnPressed.connect(self.search_criteria_submitted)

        self.setMinimumSize(800,640)
Ejemplo n.º 2
0
    def createWidgets(self):
        self.indexLabel = QLabel("&Index ")
        self.view = Views.All.View(self.state)
        self.tooltips.append((self.view, """
<p><b>Index view</b> (Alt+I)</p>
<p>This view shows all the index's entries.</p>
<p>The entries are always shown in the correct order in accordance with
the the chosen <b>Index→Options, Rules, Calculate Sort As Rules</b>, so
there's never a need to explicitly sort.</p>"""))
        self.indexLabel.setBuddy(self.view)
        self.gotoLabel = QLabel("Goto <font color=darkgreen>(Ctrl+T)</font>")
        self.gotoLineEdit = SelectAllLineEdit()
        self.gotoLabel.setBuddy(self.gotoLineEdit)
        self.tooltips.append((self.gotoLineEdit, """
<p><b>Goto (Ctrl+T)</b></p>
<p>Enter a few initial letters to goto the first main entry whose
term begins with those letters.</p>"""))
        self.state.editors.add(self.gotoLineEdit)
        self.helpButton = QToolButton()
        self.helpButton.setIcon(QIcon(":/help.svg"))
        self.helpButton.setFocusPolicy(Qt.NoFocus)
Ejemplo n.º 3
0
    def create(self, mimeType, url, argumentNames, argumentValues):
        if mimeType != 'application/x-dummy':
            return None

        for name, value in zip(argumentNames, argumentValues):
            if name == 'text':
                text = value
        else:
            text = "Webkit plugins!"

        widget = QLabel(text)
        return widget
Ejemplo n.º 4
0
 def create_main_area(self, layout):
     # Master password
     master_password_label = QLabel("&Master-Passwort:")
     self.master_password_edit = QLineEdit()
     self.master_password_edit.setEchoMode(QLineEdit.EchoMode.Password)
     self.master_password_edit.textChanged.connect(self.masterpassword_changed)
     self.master_password_edit.returnPressed.connect(self.move_focus)
     self.master_password_edit.editingFinished.connect(self.masterpassword_entered)
     self.master_password_edit.setMaximumHeight(28)
     master_password_label.setBuddy(self.master_password_edit)
     layout.addWidget(master_password_label)
     layout.addWidget(self.master_password_edit)
     # Domain
     domain_label = QLabel("&Domain:")
     self.domain_edit = QComboBox()
     self.domain_edit.setEditable(True)
     self.domain_edit.textChanged.connect(self.domain_changed)
     self.domain_edit.currentIndexChanged.connect(self.domain_changed)
     self.domain_edit.lineEdit().editingFinished.connect(self.domain_entered)
     self.domain_edit.lineEdit().returnPressed.connect(self.move_focus)
     self.domain_edit.setMaximumHeight(28)
     domain_label.setBuddy(self.domain_edit)
     layout.addWidget(domain_label)
     layout.addWidget(self.domain_edit)
     # Username
     self.username_label = QLabel("&Username:"******"&Passwortstärke:")
     self.strength_label.setVisible(False)
     self.strength_selector = PasswordStrengthSelector()
     self.strength_selector.set_min_length(4)
     self.strength_selector.set_max_length(36)
     self.strength_selector.setMinimumHeight(60)
     self.strength_selector.set_length(12)
     self.strength_selector.set_complexity(6)
     self.strength_selector.strength_changed.connect(self.strength_changed)
     self.strength_selector.setVisible(False)
     self.strength_label.setBuddy(self.strength_selector)
     layout.addWidget(self.strength_label)
     layout.addWidget(self.strength_selector)
     # Password
     self.password_label = QLabel("&Passwort:")
     self.password_label.setVisible(False)
     self.password = QLabel()
     self.password.setTextFormat(Qt.PlainText)
     self.password.setAlignment(Qt.AlignCenter)
     self.password.setFont(QFont("Helvetica", 18, QFont.Bold))
     self.password.setVisible(False)
     self.password_label.setBuddy(self.password)
     layout.addWidget(self.password_label)
     layout.addWidget(self.password)
Ejemplo n.º 5
0
    def _init_widgets(self):

        # name label

        name_label = QLabel(self)
        name_label.setText('New name')

        name_box = LabelNameBox(self._on_name_changed, self)
        if self._label_addr in self._disasm_view.disasm.kb.labels:
            name_box.setText(self._disasm_view.disasm.kb.labels[self._label_addr])
            name_box.selectAll()
        self._name_box = name_box

        label_layout = QHBoxLayout()
        label_layout.addWidget(name_label)
        label_layout.addWidget(name_box)
        self.main_layout.addLayout(label_layout)

        # status label
        status_label = QLabel(self)
        self.main_layout.addWidget(status_label)
        self._status_label = status_label

        # buttons

        ok_button = QPushButton(self)
        ok_button.setText('OK')
        ok_button.setEnabled(False)
        ok_button.clicked.connect(self._on_ok_clicked)
        self._ok_button = ok_button

        cancel_button = QPushButton(self)
        cancel_button.setText('Cancel')
        cancel_button.clicked.connect(self._on_cancel_clicked)

        buttons_layout = QHBoxLayout()
        buttons_layout.addWidget(ok_button)
        buttons_layout.addWidget(cancel_button)

        self.main_layout.addLayout(buttons_layout)
Ejemplo n.º 6
0
    def __init__(self, *args, **kwargs):

        super(Widget_textEdit_splitter, self).__init__(*args, **kwargs)
        self.installEventFilter(self)
        mainLayout = QVBoxLayout(self)

        w_convertButton = QWidget()
        lay_convertButton = QHBoxLayout(w_convertButton)
        label_orig = QLabel("Original")
        label_orig.setAlignment(QtCore.Qt.AlignCenter)
        label_convert = QLabel("Converted")
        label_convert.setAlignment(QtCore.Qt.AlignCenter)
        button = QPushButton(" >> ")
        lay_convertButton.addWidget(label_orig)
        lay_convertButton.addWidget(button)
        lay_convertButton.addWidget(label_convert)
        w_convertButton.setStyleSheet("font-size:13px")
        sizePolicy = QSizePolicy()
        sizePolicy.setVerticalPolicy(QSizePolicy.Fixed)
        sizePolicy.setHorizontalPolicy(QSizePolicy.Expanding)
        w_convertButton.setSizePolicy(sizePolicy)

        splitter = QSplitter()
        splitter.setStretchFactor(1, 1)

        textEdit_left = QTextEdit()
        textEdit_right = QTextEdit()
        splitter.addWidget(textEdit_left)
        splitter.addWidget(textEdit_right)

        textEdit_left.setLineWrapMode(QTextEdit.NoWrap)
        textEdit_right.setLineWrapMode(QTextEdit.NoWrap)

        mainLayout.addWidget(w_convertButton)
        mainLayout.addWidget(splitter)

        self.textEdit_left = textEdit_left
        self.textEdit_right = textEdit_right

        button.clicked.connect(self.load_convertedText)
Ejemplo n.º 7
0
    def setup_toolbar(self):
        color_widget = ColorWidget()
        color_widget.color_changed.connect(self.fourier.on_color_change)
        self.toolBar.addWidget(QLabel("Color:"))
        self.toolBar.addWidget(color_widget)

        self.toolBar.addWidget(QLabel("Shape:"))
        size_spin = QSpinBox(self.toolBar)
        size_spin.setValue(20)
        size_spin.valueChanged[int].connect(self.fourier.on_size_change)

        shape_combo = QComboBox(self.toolBar)
        shape_combo.activated[str].connect(self.fourier.on_shape_change)
        shape_combo.addItems(brush_shapes)

        self.toolBar.addWidget(shape_combo)
        self.toolBar.addWidget(size_spin)

        self.toolBar.addWidget(QLabel("Symmetry:"))
        x_sym = QCheckBox(self.toolBar)
        x_sym.toggled.connect(self.fourier.on_x_toggle)

        opp_sym = QCheckBox(self.toolBar)
        opp_sym.toggled.connect(self.fourier.on_opp_toggle)
        self.toolBar.addWidget(QLabel("X"))
        self.toolBar.addWidget(x_sym)

        y_sym = QCheckBox(self.toolBar)
        y_sym.toggled.connect(self.fourier.on_y_toggle)
        self.toolBar.addWidget(QLabel("Y"))
        self.toolBar.addWidget(y_sym)
        self.toolBar.addWidget(QLabel("Center"))
        self.toolBar.addWidget(opp_sym)
Ejemplo n.º 8
0
 def __init__(self,
              loadIcon="loading_bar",
              primaryMessage="Please, Wait",
              message='',
              parent=None):
     super(LoadingWidget, self).__init__(parent)
     self.finished.connect(self._updateUI)
     self.setStyleSheet("""
   QWidget {
     background-color: #ffffff
   }
 """)
     self._icon_load = loadIcon
     self._primary_message = primaryMessage
     self._label_message = QLabel(message)
     self._label_message.setWordWrap(True)
     self._label_message.setAlignment(Qt.AlignCenter)
     self._label_primary_message = QLabel(self._primary_message)
     self._label_primary_message.setStyleSheet("""
   QLabel {
     font-size: 20px;
     font-weight:bold;
     color: rgb(65,65,65);
   }
 """)
     self._label_primary_message.setAlignment(Qt.AlignCenter)
     self._label_movie = QLabel()
     self._label_movie.setAlignment(Qt.AlignCenter)
     self._movie = QMovie(self._icon_load)
     self._label_movie.setMovie(self._movie)
     self._movie.start()
     layout = QVBoxLayout()
     layout.addWidget(self._label_primary_message)
     layout.addSpacing(5)
     layout.addWidget(self._label_message)
     layout.addSpacing(5)
     layout.addWidget(self._label_movie)
     layout.addStretch()
     #self._setupAnimation() # this should be done after showing everything to get correct geometries
     self.setLayout(layout)
    def setupUI(self):
        """Arranges GUI elements inside the widget properly"""

        layout = QVBoxLayout()
        layout.setContentsMargins(20, 20, 20, 10)
        form = QFormLayout()
        form.setSpacing(20)

        form.addRow(QLabel("Deignation"), self.designation)
        form.addRow(QLabel("Dearness Allowance"), self.da)
        form.addRow(QLabel("House Rent Allowance"), self.hra)
        form.addRow(QLabel("Transport Allowance"), self.ta)
        form.addRow(QLabel("Income Tax"), self.it)
        form.addRow(QLabel("Professional Tax"), self.pt)

        layout.addLayout(form)
        layout.addStretch()
        bttnLayout = QHBoxLayout()
        bttnLayout.addStretch()
        bttnLayout.addWidget(self.bttnCancel)
        bttnLayout.addWidget(self.bttnAddDesignation)


        layout.addLayout(bttnLayout)
        self.setLayout(layout)
Ejemplo n.º 10
0
    def __init__(self,
                 parent=None,
                 format=settings.log_fmt,
                 level=logging.INFO):
        logging.Handler.__init__(self)
        # Initialize a log handler as the super class
        self.setFormatter(logging.Formatter(format))
        # Set the formatter for the logger
        self.setLevel(level)
        # Set the logging level
        self.frame = QFrame(parent)
        # Initialize a QFrame to place other widgets in

        self.frame2 = QFrame(parent)
        # Initialize frame2 for the label and checkbox
        self.label = QLabel('Logs')
        # Define a label for the frame
        self.check = QCheckBox('Debugging')
        # Checkbox to enable debugging logging
        self.check.clicked.connect(self.__changeLevel)
        # Connect checkbox clicked to the __changeLevel method

        self.log_widget = QTextEdit()
        # Initialize a QPlainTextWidget to write logs to
        self.log_widget.verticalScrollBar().minimum()
        # Set a vertical scroll bar on the log widget
        self.log_widget.horizontalScrollBar().minimum()
        # Set a horizontal scroll bar on the log widget
        self.log_widget.setLineWrapMode(self.log_widget.NoWrap)
        # Set line wrap mode to no wrapping
        self.log_widget.setFont(QFont("Courier", 12))
        # Set the font to a monospaced font
        self.log_widget.setReadOnly(True)
        # Set log widget to read only

        layout = QHBoxLayout()
        # Initialize a horizontal layout scheme for the label and checkbox frame
        layout.addWidget(self.label)
        # Add the label to the layout scheme
        layout.addWidget(self.check)
        # Add the checkbox to the layout scheme
        self.frame2.setLayout(layout)
        # Set the layout for frame to the horizontal layout

        layout = QVBoxLayout()
        # Initialize a layout scheme for the widgets
        layout.addWidget(self.frame2)
        # Add the label/checkbox frame to the layout scheme
        layout.addWidget(self.log_widget)
        # Add the text widget to the layout scheme

        self.frame.setLayout(layout)
Ejemplo n.º 11
0
    def replace(self, unit):
        old_item = self.test_layout.itemAtPosition(0, 0)
        old_label = old_item.widget()
        ref = weakref.ref(old_item, self._destroyed)

        self.test_layout.removeWidget(old_label)
        unit.assertRaises(RuntimeError, old_item.widget)
        del old_item

        label = QLabel("Label New")
        old_label.deleteLater()
        label.setAlignment(Qt.AlignCenter)
        self.test_layout.addWidget(label, 0, 0)
Ejemplo n.º 12
0
    def _init_widgets(self):

        layout = QHBoxLayout()

        ast_label = QLabel(self)
        self._ast_label = ast_label

        if self._display_size:
            size_label = QLabel(self)
            size_label.setProperty('class', 'ast_viewer_size')
            size_label.setAlignment(Qt.AlignRight)
            size_label.setMaximumSize(QSize(24, 65536))
            self._size_label = size_label
            layout.addWidget(self._size_label)

        if self._ast is not None:
            self.reload()

        layout.addWidget(ast_label)
        layout.setContentsMargins(0, 0, 0, 0)

        self.setLayout(layout)
Ejemplo n.º 13
0
    def __init__(self, parent):
        super(AskIPAddress, self).__init__()

        layout = QVBoxLayout(self)
        layout.addWidget(QLabel("Please enter a valid address"))

        glayout = QGridLayout()

        self.address = QLineEdit()
        glayout.addWidget(QLabel("IP Address"), 0, 0)
        glayout.addWidget(self.address, 0, 1)

        self.address.setText(guess_server_public_ip())
        layout.addLayout(glayout)

        self.buttons = QDialogButtonBox()
        self.buttons.addButton(QDialogButtonBox.Ok)
        layout.addWidget(self.buttons)

        self.setLayout(layout)

        self.buttons.accepted.connect(self.accept)
Ejemplo n.º 14
0
 def Flabel(self, glo):
     fontt = self.Arial
     if os.name == 'nt':
         self.ic1 = QIcon(r_path('static\\images\\pause.png'))
     else:
         self.ic1 = QIcon(r_path('static/images/pause.png'))
     self.l = QLabel('Icond', self)
     self.ic1 = self.ic1.pixmap(70, 70, QIcon.Active, QIcon.On)
     self.l.setPixmap(self.ic1)
     self.l.setAlignment(Qt.AlignCenter | Qt.AlignHCenter)
     self.l.setFont(fontt)
     self.t = QLabel('Texted', self)
     self.t.setText("Server is <u> Not running </u> <br>")
     self.t.setOpenExternalLinks(True)
     self.t.setAlignment(Qt.AlignCenter | Qt.AlignHCenter)
     self.t.setFont(fontt)
     self.t.setToolTip('Status of the server')
     self.l.setToolTip('Status of the server')
     glo.addStretch()
     glo.addWidget(self.l)
     glo.addWidget(self.t)
     glo.addStretch()
Ejemplo n.º 15
0
    def _init_path_layout(self):
        path_layout = QHBoxLayout()
        self.input_path = QLineEdit(self)
        self.input_path.setFixedHeight(35)
        self.input_path.setPlaceholderText('Type search path here')
        self.button_path = QPushButton('Scan', self)
        self.button_path.setFixedHeight(35)
        self.button_path.setFocus()

        path_layout.addWidget(QLabel('Path:', self))
        path_layout.addWidget(self.input_path, stretch=True)
        path_layout.addWidget(self.button_path)
        return path_layout
Ejemplo n.º 16
0
    def testReference(self):
        l = QLabel()
        p = QPixmap()
        l.setPixmap(
            p)  # doesn't increment pixmap ref because this makes a copy
        self.assertEqual(sys.getrefcount(p), 2)

        p = l.pixmap(
        )  # this increment the reference because this is an internal pointer
        self.assertEqual(sys.getrefcount(p), 3)

        p2 = l.pixmap()
        self.assertEqual(p, p2)
Ejemplo n.º 17
0
 def showProgressbar(self):
     if self.progressText:
         if not self.pb_widget:
             self.pb_widget = QDialog(self.parent())
             self.pb_widget.setWindowFlags(Qt.SplashScreen)
             self.pb_widget.setModal(True)
         hl = QHBoxLayout()
         pb = QProgressBar()
         pb.setRange(0, 0)
         hl.addWidget(pb)
         hl.addWidget(QLabel(self.progressText))
         self.pb_widget.setLayout(hl)
         self.pb_widget.show()
Ejemplo n.º 18
0
    def initUI(self):
        # container = QWidget(self)
        # container.resize(200, 100);
        # container.setStyleSheet("background-color:black;")

        font_size = QLabel('Font Size')
        font_size.fillColor = QColor(30, 30, 30, 120)
        font_size.penColor = QColor("#333333")

        grid = QGridLayout()
        grid.setContentsMargins(50, 10, 10, 10)
        grid.addWidget(font_size, 0, 0)
        self.setLayout(grid)
Ejemplo n.º 19
0
 def setupStatusBar(self):
     """Ajoute une barre de status"""
     self.progressBar = QProgressBar()
     self.statusLabel = QLabel('Progression ...')
     self.progressBar.setMaximum(100)
     self.progressBar.setMinimum(0)
     self.statusBar = QStatusBar()
     # # Affiche un message durant 2 sec après ouverture de l'application
     # self.statusBar.showMessage('Please Wait ...', 2000)
     self.progressBar.setValue(10)
     self.statusBar.addWidget(self.statusLabel, 1)
     self.statusBar.addWidget(self.progressBar, 2)
     self.setStatusBar(self.statusBar)
Ejemplo n.º 20
0
    def __init__(self, parent=None):
        super(PowerNotificationDialog, self).__init__(parent)
        self.setWindowFlags(Qt.Dialog | Qt.FramelessWindowHint)

        layout = QGridLayout()

        spinBox = QLabel()
        spinner = QMovie(":icons/spinner")
        spinner.start()
        spinBox.setMovie(spinner)
        layout.addWidget(spinBox, 0, 0)

        self.textBox = QLabel()

        layout.addWidget(self.textBox, 0, 1, 1, 3)

        btnOK = ExpandingButton()
        btnOK.setText("OK")
        btnOK.clicked.connect(self.accept)
        layout.addWidget(btnOK, 1, 1, 1, 2)

        self.setLayout(layout)
Ejemplo n.º 21
0
    def __init__(self, res):
        QWidget.__init__(self)
        self.res = res
        layout = QVBoxLayout()
        self.setLayout(layout)
        preview = QLabel()
        if 'image' in res.mime:
            pixmap = QPixmap(res.file_path).scaledToWidth(32)

        else:
            info = QFileInfo(res.file_path)
            pixmap = QFileIconProvider().icon(info).pixmap(32, 32)
        preview.setPixmap(pixmap)
        preview.setMask(pixmap.mask())
        preview.setMaximumHeight(32)
        label = QLabel()
        label.setText(res.file_name)
        layout.addWidget(preview)
        layout.addWidget(label)
        layout.setAlignment(Qt.AlignHCenter)
        self.setFixedWidth(64)
        self.setFixedHeight(64)
Ejemplo n.º 22
0
    def Layout(self):
        #LAYOUT
        self.directory_prompt = QLabel(self)
        self.directory_prompt.setText("Directory Selected:")
        self.directory_prompt.move(25, 50)
        self.directory_prompt.resize(150, 30)

        self.browse_btn = QPushButton("Browse", self)
        self.browse_btn.move(130, 50)
        self.browse_btn.setStatusTip(" Browse Folder")
        # self.browse_btn.setStyleSheet("background-color: rgb(186, 186, 186); border-radius: 15px;border-style: solid;border-width: 2px;border-color: black;");
        self.browse_btn.clicked.connect(self.browse)

        self.dir_shower = QLabel(self)
        self.dir_shower.setText("Directory")

        self.run_mars = QPushButton("Dump BENTO", self)
        self.run_mars.setVisible(True)
        self.run_mars.move(25, 160)
        self.run_mars.resize(self.screen_w / 2 - 150, 50)
        self.run_mars.setStatusTip('')
        self.run_mars.setStyleSheet(
            "background-color: rgb(142, 229, 171); border-radius: 15px;")
        self.run_mars.clicked.connect(self.run_event)

        self.menu_layout = QtGui.QHBoxLayout()
        self.menu_layout.addWidget(self.browse_btn)
        self.menu_layout.addWidget(self.directory_prompt)
        self.menu_layout.addWidget(self.dir_shower)
        self.menu_layout.addStretch()

        self.run_layout = QtGui.QHBoxLayout()
        self.run_layout.addWidget(self.run_mars)

        self.main_layout = QtGui.QVBoxLayout()
        self.main_layout.addLayout(self.menu_layout)
        self.main_layout.addLayout(self.run_layout)

        self.main_layout.addStretch()
Ejemplo n.º 23
0
    def __init__(self, *args, **kwargs):

        self.transInfo = ImageBaseTranslateInfo()

        super(ImageBase, self).__init__(*args, **kwargs)
        self.installEventFilter(self)

        self.image = QImage()
        self.imageTransformed = QImage()
        self.pixmap = QPixmap()
        self.label = QLabel(self)
        self.imagePath = ""
        self.aspect = 1
Ejemplo n.º 24
0
    def updateList(self):
        self.updateCounter += 1

        deviceInfoList = list(
            filter(is_supported_device,
                   easyhid.Enumeration().find()))

        deleteList = []
        deviceIds = [dev.path for dev in deviceInfoList]
        oldDevices = []
        newDevices = []

        # look at the list of connected devices and find out which devices are
        # no longer connected and remove them
        i = 0
        while i < self.layout.count():
            devItem = self.layout.itemAt(i).widget()
            if hasattr(devItem, "device") and (devItem.device.path
                                               in deviceIds):
                oldDevices.append(devItem.device)
                i += 1
            else:
                self.layout.takeAt(i).widget().deleteLater()

        # Now find the list of new devices
        oldDeviceIds = [dev.path for dev in oldDevices]
        for dev in deviceInfoList:
            if dev.path in oldDeviceIds:
                continue
            else:
                newDevices.append(dev)

        for devInfo in newDevices:
            devWidget = DeviceWidget(devInfo)
            if devWidget.label:
                self.deviceWidgets.append(devWidget)
                self.layout.addWidget(devWidget)
                devWidget.program.connect(self.programming_handler)
                devWidget.show_info.connect(self.info_handler)
                devWidget.reset.connect(self.reset_handler)

        # if len(self.deviceWidgets) == 0:
        if len(oldDevices) == 0 and len(newDevices) == 0:
            n = self.updateCounter % 4
            label = QLabel("Scanning for devices" + "." * n + " " * (4 - n))
            self.layout.setAlignment(Qt.AlignCenter)
            self.layout.addWidget(label)
            self.deviceWidgets = []
        else:
            self.layout.setAlignment(Qt.AlignTop)
            self.updateCounter = 0
Ejemplo n.º 25
0
 def create_main_area(self, layout, url, username, password):
     url_label = QLabel("&URL des c't SESAM Sync Server:")
     self.url_edit = QLineEdit()
     if url:
         self.url_edit.setText(url)
     self.url_edit.setMaximumHeight(28)
     self.url_edit.textChanged.connect(self.url_changed)
     url_label.setBuddy(self.url_edit)
     layout.addWidget(url_label)
     layout.addWidget(self.url_edit)
     username_label = QLabel("&Benutzername:")
     self.username_edit = QLineEdit()
     if username:
         self.username_edit.setText(username)
     self.username_edit.setMaximumHeight(28)
     self.username_edit.textChanged.connect(self.save_settings)
     username_label.setBuddy(self.username_edit)
     layout.addWidget(username_label)
     layout.addWidget(self.username_edit)
     password_label = QLabel("&Passwort:")
     self.password_edit = QLineEdit()
     if password:
         self.password_edit.setText(password)
     self.password_edit.setEchoMode(QLineEdit.EchoMode.Password)
     self.password_edit.setMaximumHeight(28)
     self.password_edit.textChanged.connect(self.save_settings)
     password_label.setBuddy(self.password_edit)
     layout.addWidget(password_label)
     layout.addWidget(self.password_edit)
     self.test_button = QPushButton("Verbindung testen")
     self.test_button.clicked.connect(self.test_connection)
     layout.addWidget(self.test_button)
     self.message = QLabel("")
     if not self.certificate:
         self.message.setText(
             '<span style="font-size: 10px; color: #aa0000;">' +
             'Kein Zertifikat vorhanden.' + '</span>')
     layout.addWidget(self.message)
Ejemplo n.º 26
0
 def secondPage(self):
     
     for i in range( self.mainLayout.count() ):
         item = self.mainLayout.itemAt(0)
         item.widget().setParent( None )
     
     title = QLabel( "설치할 플러그인을 선택하십시오.".decode( 'utf-8' ) )
     title.setFixedHeight( 50 )
     
     listWidget = QListWidget()
     listWidget.setFixedHeight( 273 )
     widgetItem_for2015 = QListWidgetItem("PingoTools for Maya2015", listWidget )
     widgetItem_for2016 = QListWidgetItem("PingoTools for Maya2016", listWidget )
     widgetItem_for2017 = QListWidgetItem("PingoTools for Maya2017", listWidget )
     
     widgetItem_for2015.setCheckState( QtCore.Qt.Checked )
     widgetItem_for2016.setCheckState( QtCore.Qt.Checked )
     widgetItem_for2017.setCheckState( QtCore.Qt.Checked )
     #widgetItem_for2015.setFlags( not QtCore.Qt.ItemIsSelectable )
     
     buttonsWidget = QWidget(); buttonsWidget.setMaximumHeight( 50 )
     buttonsLayout = QHBoxLayout( buttonsWidget )
     emptyArea = QLabel()
     buttonBack = QPushButton( 'Back < ' )
     buttonNext = QPushButton( 'Install' )
     buttonCancel = QPushButton( 'Cancel' )
     buttonsLayout.addWidget( emptyArea )
     buttonsLayout.addWidget( buttonBack ); buttonBack.setFixedWidth( 100 )
     buttonsLayout.addWidget( buttonNext ); buttonNext.setFixedWidth( 100 )
     buttonsLayout.addWidget( buttonCancel ); buttonCancel.setFixedWidth( 100 )
     
     self.mainLayout.addWidget( title )
     self.mainLayout.addWidget( listWidget )
     self.mainLayout.addWidget( buttonsWidget )
     
     QtCore.QObject.connect( buttonBack, QtCore.SIGNAL( 'clicked()' ), self.firstPage )
     QtCore.QObject.connect( buttonNext, QtCore.SIGNAL( 'clicked()' ), self.lastPage )
     QtCore.QObject.connect( buttonCancel, QtCore.SIGNAL( 'clicked()' ), self.cmd_cancel )
    def __init__(self):
        super(NodeItemWidget, self).__init__()
        self.node = None

        self.valueEdit = QLineEdit()
        self.opacityEdit = QLineEdit()
        self.colorButton = ColorButton()
        self.colorButton.setMaximumWidth(100)
        self.deleteButton = QPushButton("x")

        layout = QGridLayout()
        layout.addWidget(QLabel("Value:"), 0, 0)
        layout.addWidget(QLabel("Opacity:"), 0, 1)
        layout.addWidget(QLabel("Color:"), 0, 2)
        layout.addWidget(self.valueEdit, 1, 0)
        layout.addWidget(self.opacityEdit, 1, 1)
        layout.addWidget(self.colorButton, 1, 2)
        layout.addWidget(self.deleteButton, 1, 3)

        self.colorButton.clicked.connect(self.showColorDialog)
        self.deleteButton.clicked.connect(self.deleteNode)

        self.setLayout(layout)
Ejemplo n.º 28
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.setWindowTitle("PyQt4 PV Probe:")

        self.pv1name = QLineEdit()
        self.pv2name = QLineEdit()
        self.value = PVText(None)
        self.pvedit = PVLineEdit()

        grid = QGridLayout()
        grid.addWidget(QLabel("PV1 Name (Read-only):"), 0, 0)
        grid.addWidget(QLabel("PV1 Value (Read-only):"), 1, 0)
        grid.addWidget(QLabel("PV2 Name: (Read-write):"), 2, 0)
        grid.addWidget(QLabel("PV2 Value (Read-write):"), 3, 0)
        grid.addWidget(self.pv1name, 0, 1)
        grid.addWidget(self.value, 1, 1)
        grid.addWidget(self.pv2name, 2, 1)
        grid.addWidget(self.pvedit, 3, 1)

        self.pv1name.returnPressed.connect(self.onPV1NameReturn)
        self.pv2name.returnPressed.connect(self.onPV2NameReturn)

        self.setLayout(grid)
 def __init__(self, parent = None):
    super(Form,self).__init__(parent)

    self.usernamelabel = QLabel("Username : "******"Password : "******"Login")
    self.username.setPlaceholderText("Enter Username Here")
    self.password.setPlaceholderText("Enter Password Here")

    layout = QGridLayout()
    layout.addWidget(self.usernamelabel,0,0)
    layout.addWidget(self.passwordlabel,1,0)
    layout.addWidget(self.username,0,1)
    layout.addWidget(self.password,1,1)
    layout.addWidget(self.okbutton)
    self.setLayout(layout)

    self.usernamelist = ['priyank','stupendo','ayaan']
    self.passwordlist = ['priyank','stupendo','ayaan']

    self.connect(self.okbutton, SIGNAL("clicked()"),self.loginfunction)
Ejemplo n.º 30
0
	def getParameterWidget(self):
		self.hueSlider = QSlider(Qt.Horizontal)
		self.hueSlider.setMaximum(360)
		self.hueSlider.setValue(self.fixedHue)
		self.hueSlider.valueChanged.connect(self.valueChanged)

		layout = QGridLayout()
		layout.setAlignment(Qt.AlignTop)
		layout.addWidget(QLabel("Base hue"), 0, 0)
		layout.addWidget(self.hueSlider, 0, 1)

		widget = QWidget()
		widget.setLayout(layout)
		return widget