Python PyQt5.QtWidgets.QHBoxLayout() Examples

The following are 30 code examples of PyQt5.QtWidgets.QHBoxLayout(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .
Example #1
Source Project: Python_Master_Courses   Author: makelove   File: input_button_clear.py    License: GNU General Public License v3.0 7 votes vote down vote up
def initUI(self):
        self.inputLabel = QLabel("Input your text")
        self.editLine = QLineEdit()
        self.printButton = QPushButton("Print")
        self.clearButton = QPushButton("Clear")

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

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

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

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

        self.setLayout(mainLayout)
        self.setWindowTitle('FristWindow')
        self.show() 
Example #2
Source Project: Computer-graphics   Author: Panda-Lewandowski   File: lab4.py    License: MIT License 7 votes vote down vote up
def __init__(self):
        QtWidgets.QWidget.__init__(self)
        uic.loadUi("window.ui", self)
        self.scene = QtWidgets.QGraphicsScene(0, 0, 511, 511)
        self.mainview.setScene(self.scene)
        self.image = QImage(511, 511, QImage.Format_ARGB32_Premultiplied)
        self.pen = QPen()
        self.color_line = QColor(Qt.black)
        self.color_bground = QColor(Qt.white)
        self.draw_once.clicked.connect(lambda: draw_once(self))
        self.clean_all.clicked.connect(lambda: clear_all(self))
        self.btn_bground.clicked.connect(lambda: get_color_bground(self))
        self.btn_line.clicked.connect(lambda: get_color_line(self))
        self.draw_centr.clicked.connect(lambda: draw_centr(self))
        layout = QtWidgets.QHBoxLayout()
        layout.addWidget(self.what)
        layout.addWidget(self.other)
        self.setLayout(layout)
        self.circle.setChecked(True)
        self.canon.setChecked(True)
        #self.circle.toggled.connect(lambda : change_text(self)) 
Example #3
Source Project: CHATIMUSMAXIMUS   Author: benhoff   File: command_line.py    License: GNU General Public License v3.0 7 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        prompt = 'user@chatimus ~$'

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

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

        self.listener_signal = self.line_edit.listener_signal
        self.button.clicked.connect(self.give_focus) 
Example #4
Source Project: MusicBox   Author: HuberTRoy   File: addition.py    License: MIT License 7 votes vote down vote up
def __init__(self, parent=None):
        super(SearchLineEdit, self).__init__()
        self.setObjectName("SearchLine")
        self.parent = parent
        self.setMinimumSize(218, 20)
        with open('QSS/searchLine.qss', 'r') as f:
            self.setStyleSheet(f.read())

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

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

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

        self.mainLayout = QHBoxLayout()
        self.mainLayout.addSpacerItem(self.spaceItem)
        # self.mainLayout.addStretch(1)
        self.mainLayout.addWidget(self.button)
        self.mainLayout.addSpacing(10)
        self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.mainLayout) 
Example #5
Source Project: Games   Author: CharlesPikachu   File: Game11.py    License: MIT License 6 votes vote down vote up
def initUI(self):
		# 块大小
		self.grid_size = 22
		# 游戏帧率
		self.fps = 200
		self.timer = QBasicTimer()
		# 焦点
		self.setFocusPolicy(Qt.StrongFocus)
		# 水平布局
		layout_horizontal = QHBoxLayout()
		self.inner_board = InnerBoard()
		self.external_board = ExternalBoard(self, self.grid_size, self.inner_board)
		layout_horizontal.addWidget(self.external_board)
		self.side_panel = SidePanel(self, self.grid_size, self.inner_board)
		layout_horizontal.addWidget(self.side_panel)
		self.status_bar = self.statusBar()
		self.external_board.score_signal[str].connect(self.status_bar.showMessage)
		self.start()
		self.center()
		self.setWindowTitle('Tetris-公众号:Charles的皮卡丘')
		self.show()
		self.setFixedSize(self.external_board.width() + self.side_panel.width(),
						  self.side_panel.height() + self.status_bar.height()) 
Example #6
Source Project: Lector   Author: BasioMeusPuga   File: dockwidgets.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent):
        self.parent = parent
        self.parentTab = self.parent.parent

        self.searchThread = BackGroundTextSearch()
        self.searchOptionsLayout = QtWidgets.QHBoxLayout()
        self.searchTabLayout = QtWidgets.QVBoxLayout()
        self.searchTimer = QtCore.QTimer(self.parent)
        self.searchLineEdit = QtWidgets.QLineEdit(self.parent)
        self.searchBookButton = QtWidgets.QToolButton(self.parent)
        self.caseSensitiveSearchButton = QtWidgets.QToolButton(self.parent)
        self.matchWholeWordButton = QtWidgets.QToolButton(self.parent)
        self.searchResultsTreeView = QtWidgets.QTreeView(self.parent)

        self._translate = QtCore.QCoreApplication.translate
        self.search_string = self._translate('SideDock', 'Search')
        self.search_book_string = self._translate('SideDock', 'Search entire book')
        self.case_sensitive_string = self._translate('SideDock', 'Match case')
        self.match_word_string = self._translate('SideDock', 'Match word')

        self.create_widgets() 
Example #7
Source Project: visma   Author: aerospaceresearch   File: window.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.textQVBoxLayout = QtWidgets.QVBoxLayout()
        self.textUpQLabel = QtWidgets.QLabel()
        self.textDownQLabel = QtWidgets.QLabel()
        self.textQVBoxLayout.addWidget(self.textUpQLabel)
        self.textQVBoxLayout.addWidget(self.textDownQLabel)
        self.allQHBoxLayout = QtWidgets.QHBoxLayout()
        self.allQHBoxLayout.addLayout(self.textQVBoxLayout, 1)
        self.setLayout(self.allQHBoxLayout)
        self.textUpQLabel.setStyleSheet('''
        color: black;
        ''')
        self.textDownQLabel.setStyleSheet('''
        color: black;
        ''') 
Example #8
Source Project: FIRST-plugin-ida   Author: vrtadmin   File: first.py    License: GNU General Public License v2.0 6 votes vote down vote up
def view_configuration_info(self):
        self.thread_stop = True
        container = QtWidgets.QVBoxLayout()

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

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

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

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

        save_button.clicked.connect(self.save_config)

        return container 
Example #9
Source Project: qiew   Author: mtivadar   File: qiew.py    License: GNU General Public License v2.0 6 votes vote down vote up
def initUI(self):      

        self.wid = binWidget(self, self._source)
        
        self.hbox = QtWidgets.QHBoxLayout()
        self.hbox.addWidget(self.wid)
        self.setLayout(self.hbox)

        screen = QtWidgets.QDesktopWidget().screenGeometry()
        self.setGeometry(0, 0, screen.width()-100, screen.height()-100)

        self.setWindowTitle(self._title)
        #self.showMaximized()
        self.wid.activateWindow()

        self.raise_()
        self.installEventFilter(self) 
Example #10
Source Project: ddt4all   Author: cedricp   File: ddt4all.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, ecuscanner):
        super(Ecu_finder, self).__init__()
        self.ecuscanner = ecuscanner
        layoutv = widgets.QVBoxLayout()
        layouth = widgets.QHBoxLayout()
        self.setLayout(layoutv)
        layoutv.addLayout(layouth)
        self.ecuaddr = widgets.QLineEdit()
        self.ecuident = widgets.QLineEdit()
        layouth.addWidget(widgets.QLabel("Addr :"))
        layouth.addWidget(self.ecuaddr)
        layouth.addWidget(widgets.QLabel("ID frame :"))
        layouth.addWidget(self.ecuident)
        button = widgets.QPushButton("VALIDATE")
        layouth.addWidget(button)
        button.clicked.connect(self.check) 
Example #11
Source Project: pkmeter   Author: pkkid   File: pkwidgets.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, etree, control, parent=None):
        QtWidgets.QFrame.__init__(self)
        self.setLayout(QtWidgets.QHBoxLayout())
        self.layout().setContentsMargins(0,0,0,0)
        self.layout().setSpacing(0)
        pkmixins.StashMixin._init(self)
        pkmixins.LayoutMixin._init(self, etree, control, parent) 
Example #12
Source Project: pkmeter   Author: pkkid   File: pkwidgets.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def __init__(self, etree, control, parent=None):
        QtWidgets.QPushButton.__init__(self)
        self.setLayout(QtWidgets.QHBoxLayout())
        self.layout().setContentsMargins(0,0,0,0)
        self.layout().setSpacing(0)
        pkmixins.LayoutMixin._init(self, etree, control, parent) 
Example #13
Source Project: multibootusb   Author: mbusb   File: ui_about.py    License: GNU General Public License v2.0 5 votes vote down vote up
def setupUi(self, About):
        About.setObjectName("About")
        About.resize(498, 369)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(About.sizePolicy().hasHeightForWidth())
        About.setSizePolicy(sizePolicy)
        self.verticalLayout = QtWidgets.QVBoxLayout(About)
        self.verticalLayout.setObjectName("verticalLayout")
        self.gridLayout_11 = QtWidgets.QGridLayout()
        self.gridLayout_11.setObjectName("gridLayout_11")
        self.label_6 = QtWidgets.QLabel(About)
        self.label_6.setObjectName("label_6")
        self.gridLayout_11.addWidget(self.label_6, 1, 1, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem, 1, 2, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem1, 1, 0, 1, 1)
        spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem2, 0, 1, 1, 1)
        spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_11.addItem(spacerItem3, 2, 1, 1, 1)
        self.verticalLayout.addLayout(self.gridLayout_11)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem4)
        self.button_close = QtWidgets.QPushButton(About)
        self.button_close.setObjectName("button_close")
        self.horizontalLayout.addWidget(self.button_close)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(About)
        QtCore.QMetaObject.connectSlotsByName(About) 
Example #14
Source Project: simnibs   Author: simnibs   File: simulation_menu.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, fname_tensor):
        super(tensorFilesDialog, self).__init__(parent)

        self.fname = fname_tensor

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

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

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

        groupBox.setLayout(layout)
        self.group_box = groupBox

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

        mainLayout = QtWidgets.QGridLayout()

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

        self.setLayout(mainLayout)  

        self.setWindowTitle('Tensor file names')
        self.resize(400,200) 
Example #15
Source Project: idasec   Author: RobinDavid   File: static_opaque_analysis.py    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
def make_progress_bar(self, parent):
        horizontalLayout_2 = QtWidgets.QHBoxLayout()
        horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.loading_stat = QtWidgets.QLabel(parent)
        horizontalLayout_2.addWidget(self.loading_stat)
        self.progressbar_loading = QtWidgets.QProgressBar(parent)
        horizontalLayout_2.addWidget(self.progressbar_loading)
        self.stop_button = QtWidgets.QPushButton(parent)
        self.stop_button.setMaximumSize(QtCore.QSize(50, 30))
        self.stop_button.setText("stop")
        horizontalLayout_2.addWidget(self.stop_button)
        self.stop_button.clicked.connect(self.stop_button_clicked)
        return horizontalLayout_2 
Example #16
Source Project: dcc   Author: amimo   File: xrefwindow.py    License: Apache License 2.0 5 votes vote down vote up
def __init__(self,
                 parent=None,
                 win=None,
                 method_analysis=None):
        super(XrefDialogMethod, self).__init__(parent)
        self.method_analysis = method_analysis

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

        self.setWindowTitle(title)

        xrefs_list = []

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

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

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

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

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

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

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

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

        self.setWindowTitle(title)

        xrefs_list = []

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

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

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

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

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

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

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

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

        self.setWindowTitle(title)

        xrefs_list = []

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

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

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

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

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

        self.setLayout(mainLayout) 
Example #19
Source Project: easygui_qt   Author: aroberge   File: utils.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def add_list_of_images_to_layout(layout, images):
    ''' adds a list of images shown in a horizontal layout to an
        already existing layout'''
    h_layout = qt_widgets.QHBoxLayout()
    h_box = qt_widgets.QGroupBox('')
    for image in images:
        add_image_to_layout(h_layout, image)
    h_box.setLayout(h_layout)
    layout.addWidget(h_box) 
Example #20
Source Project: easygui_qt   Author: aroberge   File: utils.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def add_list_of_images_with_captions_to_layout(layout, images):
    ''' adds a list of images shown in a horizontal layout with
        caption underneath to an already existing layout'''
    h_layout = qt_widgets.QHBoxLayout()
    h_box = qt_widgets.QGroupBox('')
    for image, caption in images:
        widget = qt_widgets.QWidget()
        v_layout = qt_widgets.QVBoxLayout()
        add_image_to_layout(v_layout, image)
        add_text_to_layout(v_layout, caption)
        widget.setLayout(v_layout)
        h_layout.addWidget(widget)
    h_box.setLayout(h_layout)
    layout.addWidget(h_box) 
Example #21
Source Project: easygui_qt   Author: aroberge   File: utils.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def add_list_of_images_with_buttons_to_layout(layout, images, parent):
    ''' adds a list of images shown in a horizontal layout with
        button underneath to an already existing layout'''
    h_layout = qt_widgets.QHBoxLayout()
    h_box = qt_widgets.QGroupBox('')
    for image, label in images:
        widget = qt_widgets.QWidget()
        v_layout = qt_widgets.QVBoxLayout()
        add_image_to_layout(v_layout, image)
        add_button(v_layout, label, parent)
        widget.setLayout(v_layout)
        h_layout.addWidget(widget)
    h_box.setLayout(h_layout)
    layout.addWidget(h_box) 
Example #22
Source Project: easygui_qt   Author: aroberge   File: utils.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def add_list_of_buttons_to_layout(layout, button_labels, parent):
    ''' adds a list of buttons shown in a horizontal layout to an
        already existing layout'''
    h_layout = qt_widgets.QHBoxLayout()
    h_box = qt_widgets.QGroupBox('')
    for label in button_labels:
        add_button(h_layout, label, parent)
    h_box.setLayout(h_layout)
    layout.addWidget(h_box) 
Example #23
Source Project: easygui_qt   Author: aroberge   File: wizard_maker.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def create_page(self, page):
        new_page = qt_widgets.QWizardPage()
        layout = qt_widgets.QVBoxLayout()
        for kind, value in page:
            if kind.lower() == "title":
                new_page.setTitle(value)
            elif kind.lower() == "text":
                label = qt_widgets.QLabel(value)
                label.setWordWrap(True)
                layout.addWidget(label)
            elif kind.lower() == "image":
                label =  qt_widgets.QLabel()
                pixmap =  QtGui.QPixmap(value)
                label.setPixmap(pixmap)
                layout.addWidget(label)
            elif kind.lower() == "many images":
                h_layout = qt_widgets.QHBoxLayout()
                h_box = qt_widgets.QGroupBox('')
                for image in value:
                    label =  qt_widgets.QLabel()
                    pixmap =  QtGui.QPixmap(image)
                    label.setPixmap(pixmap)
                    h_layout.addWidget(label)
                h_box.setLayout(h_layout)
                layout.addWidget(h_box)
        new_page.setLayout(layout)
        self.addPage(new_page) 
Example #24
Source Project: qutebrowser   Author: qutebrowser   File: fixtures.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.hbox = QHBoxLayout(self)
        self.hbox.addStretch()
        self.hbox.setContentsMargins(0, 0, 0, 0)
        self.setAttribute(Qt.WA_StyledBackground, True)
        self.setStyleSheet('background-color: red;') 
Example #25
Source Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: general_settings_wt.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _init_ui(self):
        hbox_l2 = QtWidgets.QHBoxLayout()
        hbox_l2.addWidget(self.run_on_startup_qcb)
        settings = mc.model.SettingsM.get()
        self.run_on_startup_qcb.setChecked(settings.run_on_startup)
        self.setLayout(hbox_l2) 
Example #26
Source Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: toggle_switch_wt.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        super().__init__()

        self.updating_gui_bool = False

        self.turn_on_off_qcb = QtWidgets.QCheckBox()
        self.turn_on_off_qcb.toggled.connect(self._on_toggled)
        on_off_qhl = QtWidgets.QHBoxLayout()
        on_off_qhl.setContentsMargins(0,0,0,0)
        on_off_qhl.addWidget(QtWidgets.QLabel(self.tr("Turn the dialog and notifications on or off")))
        on_off_qhl.addStretch(1)
        on_off_qhl.addWidget(self.turn_on_off_qcb)
        self.setLayout(on_off_qhl) 
Example #27
Source Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: intro_dlg.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _init_ui(self):
        welcome = WelcomePage()
        system_tray = SystemTrayPage()
        breathing_notification = BreathingNotificationPage()
        breathing_dialog = BreathingDialogPage()
        breathing_dialog_coming = BreathingDialogComing()

        self.wizard_qsw_w3.addWidget(welcome)
        self.wizard_qsw_w3.addWidget(system_tray)
        self.wizard_qsw_w3.addWidget(breathing_notification)
        self.wizard_qsw_w3.addWidget(breathing_dialog)
        self.wizard_qsw_w3.addWidget(self.initial_setup)
        self.wizard_qsw_w3.addWidget(breathing_dialog_coming)

        self.prev_qpb.clicked.connect(self.on_prev_clicked)
        self.next_qpb.clicked.connect(self.on_next_clicked)

        hbox_l3 = QtWidgets.QHBoxLayout()
        hbox_l3.addStretch(1)
        hbox_l3.addWidget(self.prev_qpb, stretch=1)
        hbox_l3.addWidget(self.next_qpb, stretch=1)
        hbox_l3.addStretch(1)

        vbox_l2 = QtWidgets.QVBoxLayout()
        vbox_l2.addWidget(self.wizard_qsw_w3)
        vbox_l2.addLayout(hbox_l3)

        self.setGeometry(300, 150, 650, 500)
        self.setLayout(vbox_l2)
        self.update_gui()
        self.show() 
Example #28
Source Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: intro_dlg.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _init_ui(self):
        title_qll = QtWidgets.QLabel("The system tray")
        title_qll.setFont(mc.mc_global.get_font_xxlarge(i_bold=True))
        title_qll.setAlignment(QtCore.Qt.AlignHCenter)

        description_qll = QtWidgets.QLabel(
            "When you run Mindfulness at the computer it is accessible via the system tray. "
            "From the menu that opens when clicking on this icon "
            "you can adjust settings or invoke a breathing or rest session"
        )
        description_qll.setWordWrap(True)
        description_qll.setFont(mc.mc_global.get_font_xlarge())

        system_tray_qll = QtWidgets.QLabel()
        system_tray_qll.setPixmap(QtGui.QPixmap(mc.mc_global.get_app_icon_path("icon-br.png")))
        system_tray_qll.setAlignment(QtCore.Qt.AlignHCenter)

        vbox_l3 = QtWidgets.QVBoxLayout()
        vbox_l3.addSpacing(MARGIN_TOP_INT)
        vbox_l3.addWidget(title_qll)
        vbox_l3.addStretch(1)
        vbox_l3.addWidget(description_qll)
        vbox_l3.addStretch(1)
        vbox_l3.addWidget(system_tray_qll)
        vbox_l3.addStretch(1)

        hbox_l2 = QtWidgets.QHBoxLayout()
        hbox_l2.addStretch(1)
        hbox_l2.addLayout(vbox_l3)
        hbox_l2.addStretch(1)

        self.setLayout(hbox_l2) 
Example #29
Source Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: intro_dlg.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _init_ui(self):
        title_qll = QtWidgets.QLabel("The breathing notification")
        title_qll.setFont(mc.mc_global.get_font_xxlarge(i_bold=True))
        title_qll.setAlignment(QtCore.Qt.AlignHCenter)

        description_qll = QtWidgets.QLabel(
            "This notification pops up every once in a while. "
            "You can adjust how often you would like to get notified. "
            "If you like, you can start a breathing session from here"
        )
        description_qll.setWordWrap(True)
        description_qll.setFont(mc.mc_global.get_font_xlarge())

        breathing_notification = mc.gui.breathing_notification.BreathingNotification()
        breathing_notification.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
        breathing_notification.breathe_qpb.setDisabled(True)

        vbox_l3 = QtWidgets.QVBoxLayout()
        vbox_l3.addSpacing(MARGIN_TOP_INT)
        vbox_l3.addWidget(title_qll)
        vbox_l3.addStretch(1)
        vbox_l3.addWidget(description_qll)
        vbox_l3.addStretch(1)
        vbox_l3.addWidget(breathing_notification)
        vbox_l3.addStretch(1)

        hbox_l2 = QtWidgets.QHBoxLayout()
        hbox_l2.addStretch(1)
        hbox_l2.addLayout(vbox_l3)
        hbox_l2.addStretch(1)

        self.setLayout(hbox_l2) 
Example #30
Source Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: intro_dlg.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _init_ui(self):
        title_qll = QtWidgets.QLabel("The breathing dialog")
        title_qll.setFont(mc.mc_global.get_font_xxlarge(i_bold=True))
        title_qll.setAlignment(QtCore.Qt.AlignHCenter)

        description_qll = QtWidgets.QLabel(
            "This dialog helps you to relax and return to your breathing. "
            "Try it out, it is interactive!"
        )
        description_qll.setWordWrap(True)
        description_qll.setFont(mc.mc_global.get_font_xlarge())

        breathing_dlg = mc.gui.breathing_dlg.BreathingDlg()
        breathing_dlg.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
        breathing_dlg._close_qpb.setDisabled(True)

        vbox_l3 = QtWidgets.QVBoxLayout()
        vbox_l3.addSpacing(MARGIN_TOP_INT)
        vbox_l3.addWidget(title_qll)
        vbox_l3.addWidget(description_qll)
        vbox_l3.addStretch(1)
        vbox_l3.addWidget(breathing_dlg)
        vbox_l3.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)

        hbox_l2 = QtWidgets.QHBoxLayout()
        hbox_l2.addStretch(1)
        hbox_l2.addLayout(vbox_l3)
        hbox_l2.addStretch(1)

        self.setLayout(hbox_l2)