Example #1
0
    def getParameterWidget(self):
        """
		Returns a widget with sliders / fields with which properties of this
		volume property can be adjusted.
		:rtype: QWidget
		"""
        layout = QGridLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setAlignment(Qt.AlignTop)

        self.sliders = []
        for index in range(7):
            slider = QSlider(Qt.Horizontal)
            slider.setMinimum(0)
            slider.setMaximum(1000)
            slider.setValue(
                int(
                    math.pow(self.sectionsOpacity[index], 1.0 / 3.0) *
                    slider.maximum()))
            slider.valueChanged.connect(self.valueChanged)
            self.sliders.append(slider)
            label = QLabel(self.sectionNames[index])
            label.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
            layout.addWidget(label, index, 0)
            layout.addWidget(slider, index, 1)

        try:
            from ColumnResizer import ColumnResizer
            columnResizer = ColumnResizer()
            columnResizer.addWidgetsFromLayout(layout, 0)
        except Exception, e:
            print e
    def __init__(self, ftb, atem, parent=None):
        super(FadeToBlackControl, self).__init__(parent)
        self.atem = atem
        self.ftb = ftb

        layout = QGridLayout()

        lblRate = QLabel("Rate")
        lblRate.setAlignment(Qt.AlignHCenter | Qt.AlignBottom)
        layout.addWidget(lblRate, 0, 0)

        self.rate = FrameRateTouchSpinner()
        self.rate.setValue(self.ftb.rate)

        layout.addWidget(self.rate, 1, 0)

        self.btnFade = ExpandingButton()
        self.btnFade.setText("Fade to Black")
        self.btnFade.setCheckable(True)
        self.btnFade.setChecked(self.ftb.active)
        layout.addWidget(self.btnFade, 1, 1)

        self.ftb.rateChanged.connect(self.rate.setValue)
        self.ftb.activeChanged.connect(self.btnFade.setChecked)

        if self.atem:
            self.rate.valueChanged.connect(self.atem.setFadeToBlackRate)
            self.btnFade.clicked.connect(self.atem.performFadeToBlack)

        layout.setRowStretch(0, 1)
        layout.setRowStretch(1, 1)

        self.setLayout(layout)
Example #3
0
    def __init__(self, app, hub, html, debug=False):
        QDialog.__init__(self)
        self.app = app
        self.hub = hub
        self.html = addpool.html
        self.debug = debug
        self.url = "file:///" \
            + os.path.join(self.app.property("ResPath"), "www/", html).replace('\\', '/')

        self.is_first_load = True
        self.view = web_core.QWebView(self)

        if not self.debug:
            self.view.setContextMenuPolicy(qt_core.Qt.NoContextMenu)

        self.view.setCursor(qt_core.Qt.ArrowCursor)
        self.view.setZoomFactor(1)

        self.setWindowTitle("Add/Edit Pool :: %s" % APP_NAME)
        self.icon = self._getQIcon('ombre_64x64.png')
        self.setWindowIcon(self.icon)

        layout = QGridLayout()
        layout.addWidget(self.view)
        self.setLayout(layout)

        self.setFixedSize(qt_core.QSize(660, 480))
        self.center()

        self.view.loadFinished.connect(self._load_finished)
        #         self.view.load(qt_core.QUrl(self.url))
        self.view.setHtml(self.html, qt_core.QUrl(self.url))
Example #4
0
    def setLayout(self):
        self.myStatusBar = QStatusBar()
        self.setStatusBar(self.myStatusBar)

        self.duckIcon = QIcon("duck.jpeg")
        self.happyDuckIcon = QIcon("happy-duck.jpeg")
        qWidget = QWidget()
        gridLayout = QGridLayout(qWidget)
        row = 0
        self.setCentralWidget(qWidget)

        row = row + 1
        self.rebootButton = QPushButton("Click to reset")
        #self.rebootButton.setIcon(QIcon("duck.jpeg"))
        self.rebootButton.setIconSize(QSize(200, 200))
        gridLayout.addWidget(self.rebootButton, row, 0)
        self.rebootButton.clicked.connect(self.reboot)

        if filecmp.cmp("wpa_supplicant.conf", "wpa_supplicant.conf.orig"):
            self.myStatusBar.showMessage("Waiting to onboard.")
            self.rebootButton.setIcon(self.duckIcon)
            self.thread = Timer(5, self.checkFiles)
            self.thread.start()
        else:
            self.rebootButton.setIcon(self.happyDuckIcon)
            self.myStatusBar.showMessage("waiting for DHCP address")
            interface = "wlan1"
            p = subprocess.Popen(["/sbin/dhclient", interface],
                                 shell=False,
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
            res, err = p.communicate()
Example #5
0
 def __init__(self, currentGroupNames=[], parent=None):
     super(GroupNameDialog, self).__init__(parent)
     self._current_groupnames = [
         groupname.lower() for groupname in currentGroupNames
     ]
     self.setModal(True)
     self.setWindowTitle(self.tr("Group name"))
     label_prompt = QLabel(self.tr("Enter new launch group name:"))
     self._lineedit__groupname = QLineEdit()
     self._label_warning = QLabel()
     self._label_warning.setStyleSheet("""
   QLabel {
     color: rgb(213, 17, 27);
     font-weight: bold;
   }
 """)
     self._button_ok = QPushButton(self.tr("OK"))
     button_cancel = QPushButton(self.tr("Cancel"))
     self._button_ok.clicked.connect(self._checkGroupName)
     button_cancel.clicked.connect(self.reject)
     layout = QGridLayout()
     row = 0
     col = 0
     layout.addWidget(label_prompt, 0, 0, 1, 4)
     row += 1
     layout.addWidget(self._lineedit__groupname, row, col, 1, 4)
     row += 1
     col += 2
     layout.addWidget(self._button_ok, row, col)
     col += 1
     layout.addWidget(button_cancel, row, col)
     self.setLayout(layout)
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(583, 96)

        self.centralwidget = QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")

        self.verticalLayout = QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")

        self.gridLayout = QGridLayout()
        self.gridLayout.setObjectName("gridLayout")

        self.UI_label = QLabel(self.centralwidget)
        self.UI_label.setObjectName("UI_label")
        self.gridLayout.addWidget(self.UI_label, 0, 0, 1, 1)

        self.seleccionarUI_pushButton = QPushButton(self.centralwidget)
        self.seleccionarUI_pushButton.setObjectName("seleccionarUI_pushButton")
        self.gridLayout.addWidget(self.seleccionarUI_pushButton, 0, 2, 1, 1)

        self.Py_label = QLabel(self.centralwidget)
        self.Py_label.setObjectName("Py_label")
        self.gridLayout.addWidget(self.Py_label, 1, 0, 1, 1)

        self.rutaSalida_pushButton = QPushButton(self.centralwidget)
        self.rutaSalida_pushButton.setObjectName("rutaSalida_pushButton")
        self.gridLayout.addWidget(self.rutaSalida_pushButton, 1, 2, 1, 1)

        self.rutaEntrada_lineEdit = QLineEdit(self.centralwidget)
        self.rutaEntrada_lineEdit.setEnabled(False)
        self.rutaEntrada_lineEdit.setObjectName("rutaEntrada_lineEdit")
        self.gridLayout.addWidget(self.rutaEntrada_lineEdit, 0, 1, 1, 1)

        self.rutaSalida_lineEdit = QLineEdit(self.centralwidget)
        self.rutaSalida_lineEdit.setObjectName("rutaSalida_lineEdit")
        self.gridLayout.addWidget(self.rutaSalida_lineEdit, 1, 1, 1, 1)

        self.verticalLayout.addLayout(self.gridLayout)

        self.horizontalWidget = QWidget(self.centralwidget)
        self.horizontalWidget.setObjectName("horizontalWidget")

        self.horizontalLayout = QHBoxLayout(self.horizontalWidget)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")

        spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding,
                                    QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)

        self.convertir_pushButton = QPushButton(self.horizontalWidget)
        self.convertir_pushButton.setObjectName("convertir_pushButton")
        self.horizontalLayout.addWidget(self.convertir_pushButton)

        self.verticalLayout.addWidget(self.horizontalWidget)
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QMetaObject.connectSlotsByName(MainWindow)
class TeamSelect(QWidget):

    def __init__(self, parent):
        self.parent = parent
        QWidget.__init__(self)
        self.initUI()


    def initUI(self):
        self.grid = QGridLayout()
        self.setLayout(self.grid)

        teamnames = json_reader.readJSON('teams.json')

        i = 0
        j = 0
        for team in teamnames:
            tbutton = QPushButton(team['name'])
            team_pic = QPixmap("%s.jpg"%team['name'])
            tbutton.setIcon(QIcon(team_pic))
            tbutton.setIconSize(team_pic.rect().size())
            tbutton.clicked.connect(lambda t=team: self.chooseTeam(t))
            self.grid.addWidget(tbutton, i % 10, j)
            i += 1
            j = j + 1 if i % 10 == 0 else j # this is the dumb


    def chooseTeam(self, team):
        GAME.setTeam(team)
        self.parent.changeState(GAME.state)
    def __init__(self, switcherState, parent=None):
        super(AllInputsPanel, self).__init__(parent)

        self.switcherState = switcherState
        self.selectedInput = None
        self.page = 0
        self.sources = []

        self.layout = QGridLayout()
        self.input_buttons = QButtonGroup()

        self.btnPageUp = ExpandingButton()
        self.btnPageUp.setIcon(QIcon(":icons/go-up"))
        self.btnPageUp.clicked.connect(lambda: self.setPage(self.page - 1))
        self.layout.addWidget(self.btnPageUp, 0, 5, 3, 1)

        self.btnPageDown = ExpandingButton()
        self.btnPageDown.setIcon(QIcon(":icons/go-down"))
        self.btnPageDown.clicked.connect(lambda: self.setPage(self.page + 1))
        self.layout.addWidget(self.btnPageDown, 3, 5, 3, 1)

        for col in range(5):
            self.layout.setColumnStretch(col, 1)
            for row in range(3):
                btn = InputButton(None)
                self.layout.addWidget(btn, row * 2, col, 2, 1)
                self.input_buttons.addButton(btn)
                btn.clicked.connect(self.selectInput)
                btn.setFixedWidth(120)

        self.setLayout(self.layout)

        self.switcherState.inputsChanged.connect(self.setSources)
        self.setSources()
        self.displayInputs()
Example #9
0
    def __init__(self, parent):
        super(ElastixMainDialog, self).__init__(parent)
        self.transformation = None

        self.transformations = AppResources.elastixTemplates()
        self.radioButtons = []
        for transformation in self.transformations:
            self.radioButtons.append(QRadioButton(transformation.name))
        self.radioButtons.append(QRadioButton("Load custom parameter file..."))
        self.radioButtons[0].setChecked(True)

        self.nextButton = QPushButton("Next")
        self.nextButton.clicked.connect(self.next)
        self.cancelButton = QPushButton("Cancel")
        self.cancelButton.clicked.connect(self.cancel)

        groupLayout = QVBoxLayout()
        for radioButton in self.radioButtons:
            groupLayout.addWidget(radioButton)

        self.groupBox = QGroupBox("Choose parameter file")
        self.groupBox.setLayout(groupLayout)

        self.setModal(True)

        layout = QGridLayout()
        layout.setAlignment(Qt.AlignTop)
        layout.addWidget(self.groupBox, 0, 0, 1, 2)
        layout.addWidget(self.cancelButton, 1, 0)
        layout.addWidget(self.nextButton, 1, 1)
        self.setLayout(layout)
    def __init__(self):
        super(TransferFunctionWidget, self).__init__()

        self.nodes = []
        self.lines = []
        self.histogram = Histogram()
        self.histogram.enabled = False

        # Create a histogram widget for the background of the transfer function editor
        self.histogramWidget = HistogramWidget()
        self.histogramWidget.setHistogram(self.histogram)
        self.histogramWidget.setAxeMode(bottom=HistogramWidget.AxeClear,
                                        left=HistogramWidget.AxeLog)
        self.histogramWidget.update()
        self.histogramWidget._histogramItem.delegate = self
        Style.styleWidgetForTab(self.histogramWidget)

        # Invisible item that catches mouse events on top of the histogram
        self.transferfunctionItem = TransferFunctionItem()
        self.transferfunctionItem.setZValue(250)
        self.transferfunctionItem.delegate = self
        self.histogramWidget.addItem(self.transferfunctionItem)

        # Create a widget for editing the selected node of the transfer function
        self.nodeItemWidget = NodeItemWidget()
        self.nodeItemWidget.setEnabled(False)
        self.nodeItemWidget.nodeUpdated.connect(self.updateNode)
        self.nodeItemWidget.removePoint.connect(self.removePoint)

        layout = QGridLayout()
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self.histogramWidget, 0, 0)
        layout.addWidget(self.nodeItemWidget, 1, 0)
        self.setLayout(layout)
    def initUi(self):
        self.grid = QGridLayout()
        self.grid.addWidget(QLabel("Connection name"), 0, 0)
        self.grid.addWidget(QLabel("Username"), 2, 0)
        self.grid.addWidget(QLabel("Password"), 4, 0)
        self.grid.addWidget(QLabel("Hostname"), 6, 0)
        self.grid.addWidget(QLabel("Port"), 8, 0)
        self.connectionNameInput =  QLineEdit(self)
        self.grid.addWidget(self.connectionNameInput, 1, 0)
        self.userNameInput =  QLineEdit(self)
        self.grid.addWidget(self.userNameInput, 3, 0)
        self.passwordInput =  QLineEdit(self)
        self.grid.addWidget(self.passwordInput, 5, 0)
        self.hostnameInput =  QLineEdit(self)
        self.grid.addWidget(self.hostnameInput, 7, 0)
        self.portSpinBox =  QSpinBox(self)
        self.portSpinBox.setMinimum(1)
        self.portSpinBox.setMaximum(65535)
        self.portSpinBox.setValue(22)
        self.grid.addWidget(self.portSpinBox, 9, 0)
        self.addButton = QPushButton("Accept")
        self.grid.addWidget(self.addButton, 10, 0)
        self.setLayout(self.grid)

        self.addButton.clicked.connect(self.clickedAddButton)

        self.show()
class MainFrame(QWidget):

    def __init__(self, parent):
        self.parent = parent
        QWidget.__init__(self)
        self.state = "Opening Screen"
        self.setAutoFillBackground(True)
        self.layout = QGridLayout(self)
        self.setLayout(self.layout)
        self.currentWidget = Header(self)
        self.setPalette(self.currentWidget.palette())
        self.layout.addWidget(self.currentWidget, 0, 0, 2, 2)
        #self.layout.setSizeConstraint(QLayout.SetFixedSize)
        self.currentWidget.show()
        self.show()
        self.raise_()

    def changeState(self, newWidgetState):
        if not validateState():
            newWidgetState = GAME.state
        self.setPalette(newWidgetState.palette())
        self.currentWidget.hide()
        self.layout.addWidget(newWidgetState, 0, 0)
        self.currentWidget = newWidgetState
        newWidgetState.show()
        self.center()

    def center(self):
        # Center window
        qr = self.frameGeometry()
        qr.moveCenter(QDesktopWidget().availableGeometry().center())
        self.move(qr.topLeft())
Example #13
0
    def __init__(self, parent):
        super(LabelWindow, self).__init__(parent)

        self.test_layout = QGridLayout()
        label = QLabel("Label")
        self.test_layout.addWidget(label, 0, 0)
        self.setLayout(self.test_layout)
        self._destroyCalled = False
Example #14
0
 def __init__(self):
     ####
     logger.info('Inside MenuDetails')
     self.menudetail_tab_1 = QWidget()
     self.menudetail_tab_1.setObjectName("menudetail_tab_1")
     self.gridLayout_20 = QGridLayout(self.menudetail_tab_1)
     self.gridLayout_20.setObjectName("gridLayout_20")
     self.menu_table = QTableWidget(self.menudetail_tab_1)
     self.menu_table.setSortingEnabled(True)
     self.menu_table.setObjectName("menu_table")
     self.menu_table.setColumnCount(4)
     self.menu_table.setRowCount(0)
     item = QTableWidgetItem()
     self.menu_table.setHorizontalHeaderItem(0, item)
     item = QTableWidgetItem()
     self.menu_table.setHorizontalHeaderItem(1, item)
     item = QTableWidgetItem()
     self.menu_table.setHorizontalHeaderItem(2, item)
     item = QTableWidgetItem()
     self.menu_table.setHorizontalHeaderItem(3, item)
     self.menu_table.horizontalHeader().setCascadingSectionResizes(False)
     self.menu_table.horizontalHeader().setStretchLastSection(True)
     self.menu_table.verticalHeader().setVisible(True)
     self.menu_table.verticalHeader().setCascadingSectionResizes(True)
     self.gridLayout_20.addWidget(self.menu_table, 0, 0, 1, 2)
     spacerItem22 = QSpacerItem(612, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
     self.gridLayout_20.addItem(spacerItem22, 1, 0, 1, 1)
     self.menu_table_add_button = QPushButton(self.menudetail_tab_1)
     self.menu_table_add_button.setObjectName("menu_table_add_button")
     self.gridLayout_20.addWidget(self.menu_table_add_button, 1, 1, 1, 1)
     ####retranslate
     self.menu_table.horizontalHeaderItem(0).setText(
         QApplication.translate("MainWindow", "Code", None, QApplication.UnicodeUTF8))
     self.menu_table.horizontalHeaderItem(1).setText(
         QApplication.translate("MainWindow", "Item", None, QApplication.UnicodeUTF8))
     self.menu_table.horizontalHeaderItem(2).setText(
         QApplication.translate("MainWindow", "Category", None, QApplication.UnicodeUTF8))
     self.menu_table.horizontalHeaderItem(3).setText(
         QApplication.translate("MainWindow", "Rate", None, QApplication.UnicodeUTF8))
     self.menu_table_add_button.setText(
         QApplication.translate("MainWindow", "Add New Dish", None, QApplication.UnicodeUTF8))
     # self.menu_table_add_button.setShortcut(
     # QApplication.translate("MainWindow", "Ctrl+E", None, QApplication.UnicodeUTF8))
     ###signals and slots && other stuffs
     # self.mainwindow = Ui_MainWindow  # just for the ease of finding the attributes in pycharm
     self.menu = MenuProduct()
     self.menu_table_add_button.clicked.connect(self.add_menu)
     self.menu_table.itemDoubleClicked.connect(self.popup_edit)
     self.menu_table.setSelectionBehavior(QAbstractItemView.SelectRows)
     self.menu_table.setEditTriggers(QAbstractItemView.NoEditTriggers)
     self.menu_table.setShowGrid(False)
     self.menu_table.setAlternatingRowColors(True)
     self.update_menu()
     self.popup = object
     self.menudetail_tab_1.setFocusPolicy(Qt.StrongFocus)
     self.menudetail_tab_1.focusInEvent = self.load_rows
     self.assign_shortcuts()
Example #15
0
    def initUI(self):
        self.parent.setWindowTitle("1972 Sports Illustrated Football")

        self.grid = QGridLayout()
        self.setLayout(self.grid)

        imageLabel = QLabel(self)
        logo = QPixmap(json_reader.buildPath("homescreen.png"))
        imageLabel.setPixmap(logo)
        self.grid.addWidget(imageLabel, 0, 0)
Example #16
0
    def __init__(self):
        QWidget.__init__(self)

        self.layout = QVBoxLayout()

        self.grid = QGridLayout()

        self.service_title = QLabel("NIVEL DE SERVICIO")
        self.service_title.setStyleSheet("""
            QLabel {
            font: bold "Arial";
            font-size: 16px;
            } 
            """)

        self.service_level = QLabel("")
        self.service_level.setStyleSheet("""
            QLabel {
            font: "Arial";
            font-size: 16px;
            } 
            """)

        self.cost_title = QLabel("COSTO")
        self.cost_title.setStyleSheet("""
            QLabel {
            font: bold "Arial";
            font-size: 16px;
            } 
            """)

        self.inventory_cost = QLabel("")
        self.inventory_cost.setStyleSheet("""
            QLabel {
            font: "Arial";
            font-size: 16px;
            text-align: center;
            } 
            """)

        # img_icon = QIcon("table.png")
        # self.table_btn = QPushButton(img_icon, "",self)
        # self.table_btn.setFlat(True)
        # self.table_btn.setToolTip("Muestra resultados")

        self.grid.addWidget(self.cost_title, 0, 0)
        self.grid.addWidget(self.inventory_cost, 1, 0)

        self.grid.addWidget(self.service_title, 0, 1)
        self.grid.addWidget(self.service_level, 1, 1)

        #self.grid.addWidget(self.table_btn, 0, 2)
        #self.grid.addWidget(self.service_level, 1, 2)

        self.setLayout(self.grid)
Example #17
0
    def initUI(self):
        programIcon = QIcon('img/download.png')
        infoIcon = QIcon('img/info.png')

        if is_keyplus_device(self.device):
            self.setup_keyplus_label()
        elif is_xusb_bootloader_device(self.device):
            self.setup_xusb_bootloader_label()
        elif is_nrf24lu1p_bootloader_device(self.device):
            self.setup_nrf24lu1p_label()
        else:
            raise Exception("Unsupported USB device {}:{}".format(
                self.device.vendor_id, self.device.product_id))

        if self.label == None:
            return

        self.label.setTextInteractionFlags(Qt.TextSelectableByMouse)
        self.label.setStyleSheet("""
        QLabel {
            background: #FFF;
            border: 1px solid;
            padding: 2px;
            font: 11pt;
        }
        """)
        self.label.setFixedHeight(90)
        self.label.setMinimumWidth(390)

        self.programButton = QPushButton(' Program')
        self.programButton.setIcon(programIcon)
        self.programButton.clicked.connect(self.programSignal)

        if is_bootloader_device(self.device):
            self.secondaryButton = QPushButton('Reset')
            self.secondaryButton.clicked.connect(self.resetSignal)
        else:
            self.secondaryButton = QPushButton('Info')
            self.secondaryButton.setIcon(infoIcon)
            self.secondaryButton.clicked.connect(self.infoSignal)

        self.layout = QGridLayout()
        self.layout.addWidget(self.label, 0, 0, 2, 1)
        self.layout.addWidget(self.programButton, 0, 1)
        self.layout.addWidget(self.secondaryButton, 1, 1)
        self.setLayout(self.layout)

        self.setMaximumHeight(150)
        self.setContentsMargins(0, 0, 0, 0)

        self.setStyleSheet("""
            QGroupBox {
                border: 1px solid #CCC;
            }
        """)
Example #18
0
    def __init__(self, playersOut, playersIn, parent=None):
        super(confirmSubsDialog, self).__init__(parent)

        self.now = QDateTime.currentDateTime()
        self.now.setTime(
            QTime(self.now.time().hour(),
                  self.now.time().minute()))

        self.setWindowTitle("Confirm Subs")
        mainVerticalLayout = QVBoxLayout(self)

        subsLayout = QGridLayout()
        mainVerticalLayout.addLayout(subsLayout)

        subsLayout.addWidget(QLabel("<b>Players Out</b>"), 0, 0)
        subsLayout.addWidget(QLabel("<b>Players In</b>"), 0, 1)

        for i, (playerOut, playerIn) in enumerate(zip(playersOut, playersIn)):
            playerOutLabel = QLabel()
            playerOutLabel.setText("<font color=red>{0}</font>".format(
                playerOut.name))
            subsLayout.addWidget(playerOutLabel, i + 1, 0)

            playerInLabel = QLabel()
            playerInLabel.setText("<font color=green>{0}</font>".format(
                playerIn.name))
            subsLayout.addWidget(playerInLabel, i + 1, 1)

        mainVerticalLayout.addItem(
            QSpacerItem(0, 15, QSizePolicy.Minimum, QSizePolicy.Expanding))

        dateTimeLayout = QHBoxLayout()
        mainVerticalLayout.addLayout(dateTimeLayout)
        dateTimeLayout.addWidget(QLabel("Date and time"))

        self.dateTimeEdit = QDateTimeEdit(self.now)
        self.dateTimeEdit.setMaximumDateTime(self.now)
        self.dateTimeEdit.setCalendarPopup(True)
        self.dateTimeEdit.setDisplayFormat("d MMM yy h:mm AP")

        dateTimeLayout.addWidget(self.dateTimeEdit)
        dateTimeLayout.addStretch()

        mainVerticalLayout.addItem(
            QSpacerItem(0, 10, QSizePolicy.Minimum, QSizePolicy.Expanding))

        buttonBox = QDialogButtonBox(self)
        buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                     | QDialogButtonBox.Ok)
        buttonBox.button(QDialogButtonBox.Ok).setText("&Accept")
        mainVerticalLayout.addWidget(buttonBox)

        buttonBox.accepted.connect(self.accept)
        buttonBox.rejected.connect(self.reject)
Example #19
0
    def __init__(self, graphs, parent=None):
        QGridLayout.__init__(self, parent)
        self.startTime = None
        self.graphs = []

        for index, graph in enumerate(graphs):
            graph = QGraph(graph, parent)

            self.graphs.append(graph)
            self.addWidget(graph, int(index / constants.GRAPHS_PER_ROW),
                           index % constants.GRAPHS_PER_ROW)
    def getParameterWidget(self):
        """
		Returns a widget with sliders / fields with which properties of this
		volume property can be adjusted.
		:rtype: QWidget
		"""
        layout = QGridLayout()
        layout.setAlignment(Qt.AlignTop)

        widget = QWidget()
        widget.setLayout(layout)
        return widget
Example #21
0
File: app.py Project: lite/pystut
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        #        self.setObjectName("MainWindow")
        self.resize(731, 475)
        centralwidget = QWidget(self)
        #        centralwidget.setObjectName("centralwidget")
        gridLayout = QGridLayout(centralwidget)
        #        gridLayout.setObjectName("gridLayout")
        # textEdit needs to be a class variable.
        self.textEdit = QTextEdit(centralwidget)
        #        self.textEdit.setObjectName("textEdit")
        gridLayout.addWidget(self.textEdit, 0, 0, 1, 1)
        self.setCentralWidget(centralwidget)
        menubar = QMenuBar(self)
        menubar.setGeometry(QRect(0, 0, 731, 29))
        #        menubar.setObjectName("menubar")
        menu_File = QMenu(menubar)
        #        menu_File.setObjectName("menu_File")
        self.setMenuBar(menubar)
        statusbar = QStatusBar(self)
        #        statusbar.setObjectName("statusbar")
        self.setStatusBar(statusbar)
        actionShow_GPL = QAction(self)
        #        actionShow_GPL.setObjectName("actionShow_GPL")
        actionShow_GPL.triggered.connect(self.showGPL)
        action_About = QAction(self)
        #        action_About.setObjectName("action_About")
        action_About.triggered.connect(self.about)
        iconToolBar = self.addToolBar("iconBar.png")
        #------------------------------------------------------
        # Add icons to appear in tool bar - step 1
        actionShow_GPL.setIcon(QIcon(":/showgpl.png"))
        action_About.setIcon(QIcon(":/about.png"))
        action_Close = QAction(self)
        action_Close.setCheckable(False)
        action_Close.setObjectName("action_Close")
        action_Close.setIcon(QIcon(":/quit.png"))
        #------------------------------------------------------
        # Show a tip on the Status Bar - step 2
        actionShow_GPL.setStatusTip("Show GPL Licence")
        action_About.setStatusTip("Pop up the About dialog.")
        action_Close.setStatusTip("Close the program.")
        #------------------------------------------------------
        menu_File.addAction(actionShow_GPL)
        menu_File.addAction(action_About)
        menu_File.addAction(action_Close)
        menubar.addAction(menu_File.menuAction())

        iconToolBar.addAction(actionShow_GPL)
        iconToolBar.addAction(action_About)
        iconToolBar.addAction(action_Close)
        action_Close.triggered.connect(self.close)
 def __init__(self, parent):
     self.parent = parent
     QWidget.__init__(self)
     self.state = "Opening Screen"
     self.setAutoFillBackground(True)
     self.layout = QGridLayout(self)
     self.setLayout(self.layout)
     self.currentWidget = Header(self)
     self.setPalette(self.currentWidget.palette())
     self.layout.addWidget(self.currentWidget, 0, 0, 2, 2)
     #self.layout.setSizeConstraint(QLayout.SetFixedSize)
     self.currentWidget.show()
     self.show()
     self.raise_()
Example #23
0
    def __init__(self, parent, title=""):
        """Construct a TabDialog with the ModuleFrame parent and the
           given title.
        """
        super(TabDialog, self).__init__(parent)

        self.setWindowTitle(title)
        self.tabs = QTabWidget(self)
        self.setModal(True)

        # Need a layout to get resizing to work
        layout = QGridLayout()
        layout.addWidget(self.tabs, 0, 0)
        self.setLayout(layout)
Example #24
0
    def __init__(self, renderController, parent=None):
        super(RenderParameterWidget, self).__init__(parent=parent)

        self.renderController = renderController
        self.renderController.visualizationChanged.connect(
            self.visualizationLoaded)

        self.paramWidget = None

        self.visTypeComboBox = QComboBox()
        for visualizationType in self.renderController.visualizationTypes:
            self.visTypeComboBox.addItem(visualizationType)

        layout = QGridLayout()
        layout.setAlignment(Qt.AlignTop)
        layout.addWidget(QLabel("Visualization type"), 0, 0)
        layout.addWidget(self.visTypeComboBox, 0, 1)
        self.setLayout(layout)

        self.scrollArea = QScrollArea()
        self.scrollArea.setFrameShape(QFrame.NoFrame)
        self.scrollArea.setAutoFillBackground(False)
        self.scrollArea.setAttribute(Qt.WA_TranslucentBackground)
        self.scrollArea.setWidgetResizable(True)

        self.visTypeComboBox.currentIndexChanged.connect(
            self.visTypeComboBoxChanged)
 def initUI(self):
     self.dateEdit = QDateEdit()
     layout = QGridLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     layout.addWidget(self.dateEdit, 0, 0)
     layout.addItem(QSpacerItem(20, 20, QSizePolicy.Minimum, QSizePolicy.Expanding))
     self.setLayout(layout)
Example #26
0
 def __init__(self, *args, **kwargs ):
     
     self.uiInfoPath = Window.infoBaseDir + '/Widget_ctlListGroup.json'
     
     QWidget.__init__( self, *args, **kwargs )
     mainLayout = QVBoxLayout( self )
     buttonLayout = QHBoxLayout()
     gridLayout = QGridLayout()
     mainLayout.addLayout( buttonLayout )
     mainLayout.addLayout( gridLayout )
     
     gridLayout.setSpacing(5)
     gridLayout.setVerticalSpacing(5)
     
     b_addList = QPushButton( "Add List" )
     b_removeList = QPushButton( "Remove List" )
     buttonLayout.addWidget( b_addList )
     buttonLayout.addWidget( b_removeList )
     
     w_ctlList = Widget_ctlList()
     gridLayout.addWidget( w_ctlList )
 
     self.__gridLayout = gridLayout
     
     QtCore.QObject.connect( b_addList,    QtCore.SIGNAL( "clicked()" ), self.addList )
     QtCore.QObject.connect( b_removeList, QtCore.SIGNAL( "clicked()" ), self.removeList )
     
     self.loadInfo()
Example #27
0
    def __init__(self, width, height, grid):
        super(GameOfLifeWidget, self).__init__()
        self.setWindowTitle('Game Of Life')
        layout = QGridLayout()
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        main_layout = QVBoxLayout()
        self.buttons = []
        self.grid = grid
        self.width = width
        self.height = height
        self.timer = QTimer()
        self.timer.setInterval(INTERVAL)
        self.timer.timeout.connect(self._handle_timeout)

        self.start_button = QPushButton("Start")
        self.start_button.clicked.connect(self._handle_start)
        self.clear_button = QPushButton("Clear")
        self.clear_button.clicked.connect(self._handle_clear)

        main_layout.addLayout(layout)
        main_layout.addWidget(self.start_button)
        main_layout.addWidget(self.clear_button)
        self.setLayout(main_layout)
        for y_pos in range(height):
            row = []
            self.buttons.append(row)
            for x_pos in range(width):
                button = QPushButton()
                row.append(button)
                button.setMaximumWidth(20)
                button.setMaximumHeight(20)
                button.clicked.connect(self._handle_click)
                layout.addWidget(button, y_pos, x_pos)
        self._update_gui()
    def __init__(self, currentValue):
        super(HexPageChooser, self).__init__()
        self._result = None

        self.setWindowTitle('Choose Page')
        grid = QGridLayout()
        self.setLayout(grid)
        for column in range(16):
            for row in range(16):
                value = row * 0x1000 + column * 0x0100
                label = ClickableLabel('0x%04X' % value, value)
                label.clicked.connect(self._click_handler)
                grid.addWidget(label, row, column)
                if value == currentValue:
                    self._style_as_current(label)
Example #29
0
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        self.setWindowTitle("PySide PV Probe:")

        self.pvname = QLineEdit()
        self.pvname.returnPressed.connect(self.onPVNameReturn)
        self.value = QLabel(" ")
        self.pv = None

        grid = QGridLayout()
        grid.addWidget(QLabel("PV Name:"), 0, 0)
        grid.addWidget(QLabel("PV Value:"), 1, 0)
        grid.addWidget(self.pvname, 0, 1)
        grid.addWidget(self.value, 1, 1)

        self.setLayout(grid)
Example #30
0
    def initUI(self):
        programIcon = QIcon('img/download.png')
        infoIcon = QIcon('img/info.png')

        self.updateLabel()

        if self.label.text() == "":
            return

        self.label.setTextInteractionFlags(Qt.TextSelectableByMouse)
        self.label.setStyleSheet("""
        QLabel {
            background: #FFF;
            border: 1px solid;
            padding: 2px;
            font: 11pt;
        }
        """)
        self.label.setFixedHeight(90)
        self.label.setMinimumWidth(390)

        self.programButton = QPushButton(' Program')
        self.programButton.setIcon(programIcon)
        self.programButton.clicked.connect(self.programSignal)

        if is_bootloader_device(self.device):
            self.secondaryButton = QPushButton('Reset')
            self.secondaryButton.clicked.connect(self.resetSignal)
        else:
            self.secondaryButton = QPushButton('Info')
            self.secondaryButton.setIcon(infoIcon)
            self.secondaryButton.clicked.connect(self.infoSignal)

        self.layout = QGridLayout()
        self.layout.addWidget(self.label, 0, 0, 2, 1)
        self.layout.addWidget(self.programButton, 0, 1)
        self.layout.addWidget(self.secondaryButton, 1, 1)
        self.setLayout(self.layout)

        self.setMaximumHeight(150)
        self.setContentsMargins(0, 0, 0, 0)

        self.setStyleSheet("""
            QGroupBox {
                border: 1px solid #CCC;
            }
        """)