Python PyQt5.QtWidgets.QVBoxLayout() Examples

The following are 30 code examples of PyQt5.QtWidgets.QVBoxLayout(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .
Example #1
Source File: window.py    From visma with GNU General Public License v3.0 8 votes vote down vote up
def buttonsLayout(self):
        self.matrix = False
        vbox = QVBoxLayout()
        interactionModeLayout = QVBoxLayout()
        self.interactionModeButton = QtWidgets.QPushButton('visma')
        self.interactionModeButton.clicked.connect(self.interactionMode)
        interactionModeLayout.addWidget(self.interactionModeButton)
        interactionModeWidget = QWidget(self)
        interactionModeWidget.setLayout(interactionModeLayout)
        interactionModeWidget.setFixedSize(275, 50)
        topButtonSplitter = QSplitter(Qt.Horizontal)
        topButtonSplitter.addWidget(interactionModeWidget)
        permanentButtons = QWidget(self)
        topButtonSplitter.addWidget(permanentButtons)
        self.bottomButton = QFrame()
        self.buttonSplitter = QSplitter(Qt.Vertical)
        self.buttonSplitter.addWidget(topButtonSplitter)
        self.buttonSplitter.addWidget(self.bottomButton)
        vbox.addWidget(self.buttonSplitter)
        return vbox 
Example #2
Source File: resourceswindow.py    From dcc with Apache License 2.0 8 votes vote down vote up
def __init__(self, parent=None, win=None, session=None):
        super(ResourcesWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Resources"

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter resource integer pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.resourceswindow = ResourcesValueWindow(self, win, session)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.resourceswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

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

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

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

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

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

        self.setLayout(mainLayout)
        self.setWindowTitle('FristWindow')
        self.show() 
Example #4
Source File: postinstall_simnibs.py    From simnibs with GNU General Public License v3.0 7 votes vote down vote up
def __init__(self):
            super().__init__()
            button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel)
            button_box.accepted.connect(self.accept)
            button_box.rejected.connect(self.reject)
            mainLayout = QtWidgets.QVBoxLayout()
            mainLayout.addWidget(
                QtWidgets.QLabel(
                    f'SimNIBS version {__version__} will be uninstalled. '
                    'Are you sure?'))
            mainLayout.addWidget(button_box)
            self.setLayout(mainLayout)
            self.setWindowTitle('SimNIBS Uninstaller')
            gui_icon = os.path.join(SIMNIBSDIR,'resources', 'gui_icon.ico')
            self.setWindowIcon(QtGui.QIcon(gui_icon)) 
Example #5
Source File: methodswindow.py    From dcc with Apache License 2.0 7 votes vote down vote up
def __init__(self, parent=None, win=None, session=None):
        super(MethodsWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Methods"

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter method name pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.methodswindow = MethodsValueWindow(self, win, session)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.methodswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #6
Source File: safe_delete_dlg.py    From mindfulness-at-the-computer with GNU General Public License v3.0 7 votes vote down vote up
def __init__(self, i_description_str: str, i_parent=None) -> None:
        super(SafeDeleteDlg, self).__init__(i_parent)

        vbox = QtWidgets.QVBoxLayout(self)

        self.description_qll = QtWidgets.QLabel(i_description_str)
        vbox.addWidget(self.description_qll)

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal,
            self
        )
        vbox.addWidget(self.button_box)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)
        # -accept and reject are "slots" built into Qt 
Example #7
Source File: cli.py    From visma with GNU General Public License v3.0 7 votes vote down vote up
def __init__(self, parent, tokens):
        super(QWidget, self).__init__(parent)
        self.layout = QVBoxLayout(self)
        self.tabPlot = QTabWidget()
        self.tabPlot.tab1 = QWidget()
        self.tabPlot.tab2 = QWidget()
        self.tabPlot.resize(300, 200)
        self.tabPlot.addTab(self.tabPlot.tab1, "2D-Plot")
        self.tabPlot.addTab(self.tabPlot.tab2, "3D-Plot")
        self.tabPlot.tab1.setLayout(plotFigure2D(self))
        self.tabPlot.tab2.setLayout(plotFigure3D(self))
        self.layout.addWidget(self.tabPlot)
        plot(self, tokens) 
Example #8
Source File: first.py    From FIRST-plugin-ida with GNU General Public License v2.0 6 votes vote down vote up
def view_configuration_info(self):
        self.thread_stop = True
        container = QtWidgets.QVBoxLayout()

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

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

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

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

        save_button.clicked.connect(self.save_config)

        return container 
Example #9
Source File: ui_qhangupsconversationslist.py    From qhangups with GNU General Public License v3.0 6 votes vote down vote up
def setupUi(self, QHangupsConversationsList):
        QHangupsConversationsList.setObjectName("QHangupsConversationsList")
        QHangupsConversationsList.resize(250, 500)
        self.centralwidget = QtWidgets.QWidget(QHangupsConversationsList)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.conversationsListWidget = QtWidgets.QListWidget(self.centralwidget)
        self.conversationsListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.conversationsListWidget.setObjectName("conversationsListWidget")
        self.verticalLayout.addWidget(self.conversationsListWidget)
        QHangupsConversationsList.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(QHangupsConversationsList)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 250, 27))
        self.menubar.setObjectName("menubar")
        QHangupsConversationsList.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(QHangupsConversationsList)
        self.statusbar.setObjectName("statusbar")
        QHangupsConversationsList.setStatusBar(self.statusbar)

        self.retranslateUi(QHangupsConversationsList)
        QtCore.QMetaObject.connectSlotsByName(QHangupsConversationsList) 
Example #10
Source File: messageview.py    From qutebrowser with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self._messages = []  # type: typing.MutableSequence[Message]
        self._vbox = QVBoxLayout(self)
        self._vbox.setContentsMargins(0, 0, 0, 0)
        self._vbox.setSpacing(0)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)

        self._clear_timer = QTimer()
        self._clear_timer.timeout.connect(self.clear_messages)
        config.instance.changed.connect(self._set_clear_timer_interval)

        self._last_text = None 
Example #11
Source File: experimental_list_widget.py    From mindfulness-at-the-computer with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, i_description_str, i_parent = None):
        super(SafeDeleteDialog, self).__init__(i_parent)

        vbox = QtWidgets.QVBoxLayout(self)

        self.description_qll = QtWidgets.QLabel(i_description_str)
        vbox.addWidget(self.description_qll)

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal,
            self
        )
        vbox.addWidget(self.button_box)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)
        # -accept and reject are "slots" built into Qt 
Example #12
Source File: window.py    From visma with 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 #13
Source File: apiwindow.py    From dcc with Apache License 2.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, session=None):
        super(APIWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "API"

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter method name pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.methodswindow = APIValueWindow(self, win, session)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.methodswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #14
Source File: qsolver.py    From visma with GNU General Public License v3.0 6 votes vote down vote up
def qSolveFigure(workspace):
    """GUI layout for quick simplifier

    Arguments:
        workspace {QtWidgets.QWidget} -- main layout

    Returns:
        qSolLayout {QtWidgets.QVBoxLayout} -- quick simplifier layout
    """

    bg = workspace.palette().window().color()
    bgcolor = (bg.redF(), bg.greenF(), bg.blueF())
    workspace.qSolveFigure = Figure(edgecolor=bgcolor, facecolor=bgcolor)
    workspace.solcanvas = FigureCanvas(workspace.qSolveFigure)
    workspace.qSolveFigure.clear()
    qSolLayout = QtWidgets.QVBoxLayout()
    qSolLayout.addWidget(workspace.solcanvas)

    return qSolLayout 
Example #15
Source File: plotter.py    From visma with GNU General Public License v3.0 6 votes vote down vote up
def plotFigure3D(workspace):
    """GUI layout for plot figure

    Arguments:
        workspace {QtWidgets.QWidget} -- main layout

    Returns:
        layout {QtWidgets.QVBoxLayout} -- contains matplot figure
    """
    workspace.figure3D = Figure()
    workspace.canvas3D = FigureCanvas(workspace.figure3D)
    # workspace.figure3D.patch.set_facecolor('white')

    class NavigationCustomToolbar(NavigationToolbar):
        toolitems = [t for t in NavigationToolbar.toolitems if t[0] in ()]

    workspace.toolbar3D = NavigationCustomToolbar(workspace.canvas3D, workspace)
    layout = QVBoxLayout()
    layout.addWidget(workspace.canvas3D)
    layout.addWidget(workspace.toolbar3D)
    return layout 
Example #16
Source File: steps.py    From visma with GNU General Public License v3.0 6 votes vote down vote up
def stepsFigure(workspace):
    """GUI layout for step-by-step solution

    Arguments:
        workspace {QtWidgets.QWidget} -- main layout

    Returns:
        stepslayout {QtWidgets.QVBoxLayout} -- step-by-step solution layout
    """
    workspace.stepsfigure = Figure()
    workspace.stepscanvas = FigureCanvas(workspace.stepsfigure)
    workspace.stepsfigure.clear()
    workspace.scroll = QScrollArea()
    workspace.scroll.setWidget(workspace.stepscanvas)
    stepslayout = QVBoxLayout()
    stepslayout.addWidget(workspace.scroll)
    return stepslayout 
Example #17
Source File: idasec.py    From idasec with GNU Lesser General Public License v2.1 6 votes vote down vote up
def setupUi(self, Master):
        Master.setObjectName("Master")
        Master.resize(718, 477)
        self.verticalLayout = QtWidgets.QVBoxLayout(Master)
        self.verticalLayout.setObjectName("verticalLayout")
        self.splitter = QtWidgets.QSplitter(Master)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName("splitter")
        self.tab_widget = QtWidgets.QTabWidget(self.splitter)
        self.tab_widget.setObjectName("tab_widget")

        self.docker = QtWidgets.QDockWidget(self.splitter)
        self.docker.setObjectName("docker")
        self.docker.setAllowedAreas(QtCore.Qt.BottomDockWidgetArea)

        self.log_widget = QtWidgets.QTreeWidget(self.docker)
        self.log_widget.setHeaderItem(QtWidgets.QTreeWidgetItem(["date", "origin", "type", "message"]))
        self.docker.setWidget(self.log_widget)

        self.verticalLayout.addWidget(self.splitter)
        self.tab_widget.setCurrentIndex(-1)
        QtCore.QMetaObject.connectSlotsByName(Master)
        Master.setWindowTitle("IDASec") 
Example #18
Source File: simulation_menu.py    From simnibs with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent, session):
        super(SimulationOptionsDialog, self).__init__(parent)

        self.session = session


        self.fields_box = self.selectFields()

        self.options_box = self.selectOtherOptions()
        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.QVBoxLayout()

        mainLayout.addWidget(self.fields_box)
        mainLayout.addWidget(self.options_box)
        mainLayout.addWidget(self.button_box)

        self.setLayout(mainLayout)  

        self.setWindowTitle('Simulation Options') 
Example #19
Source File: breathing_phrase_list_wt.py    From mindfulness-at-the-computer with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, i_parent=None):
        super(EditDialog, self).__init__(i_parent)

        self.setModal(True)

        self.setMinimumWidth(250)

        self.updating_gui_bool = False

        # If a phrase is not selected, default to phrase with id 1
        if mc.mc_global.active_phrase_id_it == mc.mc_global.NO_PHRASE_SELECTED_INT:
            mc.mc_global.active_phrase_id_it = 1

        active_phrase = mc.model.PhrasesM.get(mc.mc_global.active_phrase_id_it)

        vbox = QtWidgets.QVBoxLayout(self)

        self.breath_title_qle = QtWidgets.QLineEdit(active_phrase.title)
        vbox.addWidget(QtWidgets.QLabel(self.tr("Title")))
        vbox.addWidget(self.breath_title_qle)

        vbox.addWidget(QtWidgets.QLabel("Phrase(s)"))
        self.in_breath_phrase_qle = QtWidgets.QLineEdit(active_phrase.ib)
        vbox.addWidget(self.in_breath_phrase_qle)

        self.out_breath_phrase_qle = QtWidgets.QLineEdit(active_phrase.ob)
        vbox.addWidget(self.out_breath_phrase_qle)

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal,
            self
        )
        vbox.addWidget(self.button_box)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)
        # -accept and reject are "slots" built into Qt

        self.update_gui() 
Example #20
Source File: sysinfo_dlg.py    From mindfulness-at-the-computer with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, i_parent=None):
        super(SysinfoDialog, self).__init__(i_parent)
        self.setModal(True)

        vbox_l2 = QtWidgets.QVBoxLayout(self)

        self._system_info_str = '\n'.join([
            descr_str + ": " + str(value) for (descr_str, value) in mc.mc_global.sys_info_telist
        ])

        self.system_info_qll = QtWidgets.QLabel(self._system_info_str)
        vbox_l2.addWidget(self.system_info_qll)

        self.copy_qpb = QtWidgets.QPushButton(self.tr("Copy to clipboard"))
        self.copy_qpb.clicked.connect(self.on_copy_button_clicked)
        vbox_l2.addWidget(self.copy_qpb)

        self.button_box = QtWidgets.QDialogButtonBox(
            QtCore.Qt.Horizontal,
            self
        )
        self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Close)

        vbox_l2.addWidget(self.button_box)
        self.button_box.rejected.connect(self.reject)
        # -accepted and rejected are "slots" built into Qt 
Example #21
Source File: textinput.py    From screenshot with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(TextInput, self).__init__(parent)

        self.setWindowFlags(Qt.Dialog | Qt.FramelessWindowHint)

        self.mainLayout = QVBoxLayout()
        self.textArea = QTextEdit(self)

        self.buttonArea = QWidget(self)
        self.buttonLayout = QHBoxLayout()
        self.cancelButton = QPushButton('Cancel', self)
        self.okButton = QPushButton('Ok', self)
        self.buttonLayout.addWidget(self.cancelButton)
        self.buttonLayout.addWidget(self.okButton)
        self.buttonArea.setLayout(self.buttonLayout)

        self.mainLayout.addWidget(self.textArea)
        self.mainLayout.addWidget(self.buttonArea)
        self.setLayout(self.mainLayout)

        self.textArea.textChanged.connect(self.textChanged_)
        self.okButton.clicked.connect(self.okButtonClicked)
        self.cancelButton.clicked.connect(self.cancelPressed) 
Example #22
Source File: LoggingDialog.py    From pyweed with GNU Lesser General Public License v3.0 5 votes vote down vote up
def setupUi(self, LoggingDialog):
        LoggingDialog.setObjectName("LoggingDialog")
        LoggingDialog.resize(697, 474)
        self.verticalLayout = QtWidgets.QVBoxLayout(LoggingDialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.loggingPlainTextEdit = QtWidgets.QPlainTextEdit(LoggingDialog)
        self.loggingPlainTextEdit.setObjectName("loggingPlainTextEdit")
        self.verticalLayout.addWidget(self.loggingPlainTextEdit)

        self.retranslateUi(LoggingDialog)
        QtCore.QMetaObject.connectSlotsByName(LoggingDialog) 
Example #23
Source File: SpinnerWidget.py    From pyweed with GNU Lesser General Public License v3.0 5 votes vote down vote up
def setupUi(self, SpinnerWidget):
        SpinnerWidget.setObjectName("SpinnerWidget")
        SpinnerWidget.resize(306, 207)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(SpinnerWidget.sizePolicy().hasHeightForWidth())
        SpinnerWidget.setSizePolicy(sizePolicy)
        SpinnerWidget.setStyleSheet("QFrame { background-color: rgba(224,224,224,192)} \n"
"QLabel { background-color: transparent }")
        self.verticalLayout = QtWidgets.QVBoxLayout(SpinnerWidget)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.icon = QtWidgets.QLabel(SpinnerWidget)
        self.icon.setText("")
        self.icon.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignHCenter)
        self.icon.setObjectName("icon")
        self.verticalLayout.addWidget(self.icon)
        self.label = QtWidgets.QLabel(SpinnerWidget)
        self.label.setText("")
        self.label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.cancelButton = QtWidgets.QPushButton(SpinnerWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.cancelButton.sizePolicy().hasHeightForWidth())
        self.cancelButton.setSizePolicy(sizePolicy)
        self.cancelButton.setObjectName("cancelButton")
        self.horizontalLayout.addWidget(self.cancelButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.verticalLayout.setStretch(0, 1)
        self.verticalLayout.setStretch(1, 1)

        self.retranslateUi(SpinnerWidget)
        QtCore.QMetaObject.connectSlotsByName(SpinnerWidget) 
Example #24
Source File: ConsoleDialog.py    From pyweed with GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, pyweed, parent=None):
        super(ConsoleDialog, self).__init__(parent=parent)
        self.widget = EmbedIPython(pyweed=pyweed)
        layout = QtWidgets.QVBoxLayout(self)
        layout.addWidget(self.widget) 
Example #25
Source File: rest_prepare.py    From mindfulness-at-the-computer with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        super().__init__(None, WINDOW_FLAGS)

        self.setFrameStyle(QtWidgets.QFrame.Box | QtWidgets.QFrame.Plain)
        self.setLineWidth(1)

        vbox_l2 = QtWidgets.QVBoxLayout()
        self.setLayout(vbox_l2)

        self.setMinimumHeight(MIN_HEIGHT_INT)

        self.title_qll = QtWidgets.QLabel(self.tr("Please prepare for rest"))
        vbox_l2.addWidget(self.title_qll)
        self.title_qll.setWordWrap(True)

        self.reminder_qll = QtWidgets.QLabel(self.tr("One minute left until the next rest"))
        vbox_l2.addWidget(self.reminder_qll)
        self.reminder_qll.setWordWrap(True)

        self.show()  # -done after all the widget have been added so that the right size is set
        self.raise_()
        self.showNormal()

        # Set position - done after show to get the right size hint
        screen_qrect = QtWidgets.QApplication.desktop().availableGeometry()
        xpos_int = screen_qrect.right() - self.sizeHint().width() - 30
        ypos_int = screen_qrect.top() + 30
        self.move(xpos_int, ypos_int)

        self.shown_qtimer = None
        self.start_shown_timer()

        self.setStyleSheet("background-color: #101010; color: #999999;") 
Example #26
Source File: TransformGuiTemplate_pyqt5.py    From tf-pose with Apache License 2.0 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(224, 117)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setSpacing(1)
        self.verticalLayout.setObjectName("verticalLayout")
        self.translateLabel = QtWidgets.QLabel(Form)
        self.translateLabel.setObjectName("translateLabel")
        self.verticalLayout.addWidget(self.translateLabel)
        self.rotateLabel = QtWidgets.QLabel(Form)
        self.rotateLabel.setObjectName("rotateLabel")
        self.verticalLayout.addWidget(self.rotateLabel)
        self.scaleLabel = QtWidgets.QLabel(Form)
        self.scaleLabel.setObjectName("scaleLabel")
        self.verticalLayout.addWidget(self.scaleLabel)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.mirrorImageBtn = QtWidgets.QPushButton(Form)
        self.mirrorImageBtn.setToolTip("")
        self.mirrorImageBtn.setObjectName("mirrorImageBtn")
        self.horizontalLayout.addWidget(self.mirrorImageBtn)
        self.reflectImageBtn = QtWidgets.QPushButton(Form)
        self.reflectImageBtn.setObjectName("reflectImageBtn")
        self.horizontalLayout.addWidget(self.reflectImageBtn)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #27
Source File: intro_dlg.py    From mindfulness-at-the-computer with GNU General Public License v3.0 5 votes vote down vote up
def _init_ui(self):
        title_qll = QtWidgets.QLabel("Finish")
        title_qll.setFont(mc.mc_global.get_font_xxlarge(i_bold=True))

        text_qll = QtWidgets.QLabel(
            "<p>When you click on finish and exit this wizard a breathing dialog will be shown. </p>"
            "<p><strong>Breathing in:</strong> Hover over the green box</p>"
            "<p><strong>Breathing out:</strong> Hover outside the green box</p>"
        )
        text_qll.setWordWrap(True)
        text_qll.setFont(mc.mc_global.get_font_xlarge())

        relaunch_wizard_qll = QtWidgets.QLabel(
            '<p>You can start this wizard again by choosing "Help" -> "Show intro wizard" in the settings '
            'window (available from the system tray icon menu)</p>'
        )
        relaunch_wizard_qll.setWordWrap(True)
        relaunch_wizard_qll.setFont(mc.mc_global.get_font_medium())
        relaunch_wizard_qll.setAlignment(QtCore.Qt.AlignCenter)

        vbox_l2 = QtWidgets.QVBoxLayout()
        vbox_l2.addSpacing(MARGIN_TOP_INT)
        vbox_l2.addWidget(title_qll)
        vbox_l2.addStretch(3)
        vbox_l2.addWidget(text_qll)
        vbox_l2.addStretch(3)
        vbox_l2.addWidget(relaunch_wizard_qll)
        vbox_l2.addStretch(1)

        self.setLayout(vbox_l2) 
Example #28
Source File: intro_dlg.py    From mindfulness-at-the-computer with GNU General Public License v3.0 5 votes vote down vote up
def _init_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 File: intro_dlg.py    From mindfulness-at-the-computer with 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) 
Example #30
Source File: interSubs.py    From interSubs with MIT License 5 votes vote down vote up
def subtitles_base(self):
		self.subtitles = QFrame()
		self.subtitles.setAttribute(Qt.WA_TranslucentBackground)
		self.subtitles.setWindowFlags(Qt.X11BypassWindowManagerHint)
		self.subtitles.setStyleSheet(config.style_subs)

		self.subtitles_vbox = QVBoxLayout(self.subtitles)
		self.subtitles_vbox.setSpacing(config.subs_padding_between_lines)
		self.subtitles_vbox.setContentsMargins(0, 0, 0, 0)