Python PyQt4.QtGui.QVBoxLayout() Examples

The following are 30 code examples of PyQt4.QtGui.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 PyQt4.QtGui , or try the search function .
Example #1
Source File: UITranslator.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout 
Example #2
Source File: quiz-controller.py    From networkzero with MIT License 6 votes vote down vote up
def __init__(self, controller, position, *args, **kwargs):
        super(Panel, self).__init__(position.title(), *args, **kwargs)
        self.instructions = controller
        self.position = position.lower()

        layout = QtGui.QVBoxLayout()
        self.selector = QtGui.QComboBox()
        self.selector.currentIndexChanged.connect(self.on_selector)

        layout.addWidget(self.selector)
        self.stack = QtGui.QStackedWidget()
        layout.addWidget(self.stack)
        self.setLayout(layout)

        for cls in screen.ScreenWidget.__subclasses__():
            self.selector.addItem(cls.name)
            self.stack.addWidget(cls(controller, position)) 
Example #3
Source File: Sniffer.py    From SimpleSniffer with GNU General Public License v3.0 6 votes vote down vote up
def initUI(self):
        self.text_show2 = QtGui.QTextEdit()
        self.text_show2.setText(SHOW2STR)
        self.text_show2.setReadOnly(True)
        self.text_hex = QtGui.QTextEdit()
        self.text_hex.setText(HEXSTR)
        self.text_hex.setReadOnly(True)
        self.save_but = QtGui.QPushButton(u'保存为PDF', self)
        self.save_but.setCheckable(False)
        self.save_but.clicked.connect(self.save_pdf)
        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.text_show2)
        vbox.addWidget(self.text_hex)
        vbox.addWidget(self.save_but)
        self.setLayout(vbox)
        """
        self.splitter = QtGui.QSplitter(self)
        self.splitter.addWidget(self.text_show2)
        self.splitter.addWidget(self.text_hex)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        """ 
Example #4
Source File: customemoticonsdialog_ui.py    From pyqtggpo with GNU General Public License v2.0 6 votes vote down vote up
def setupUi(self, EmoticonDialog):
        EmoticonDialog.setObjectName(_fromUtf8("EmoticonDialog"))
        EmoticonDialog.resize(300, 500)
        self.verticalLayout = QtGui.QVBoxLayout(EmoticonDialog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label = QtGui.QLabel(EmoticonDialog)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label)
        self.uiEmoticonTextEdit = QtGui.QTextEdit(EmoticonDialog)
        self.uiEmoticonTextEdit.setObjectName(_fromUtf8("uiEmoticonTextEdit"))
        self.verticalLayout.addWidget(self.uiEmoticonTextEdit)
        self.buttonBox = QtGui.QDialogButtonBox(EmoticonDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(EmoticonDialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), EmoticonDialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), EmoticonDialog.reject)
        QtCore.QMetaObject.connectSlotsByName(EmoticonDialog) 
Example #5
Source File: ddt4all.py    From ddt4all with 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 #6
Source File: dataeditor.py    From ddt4all with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        super(buttonEditor, self).__init__(parent)
        self.ecurequestsparser = None

        self.layout = None
        self.layouth = widgets.QHBoxLayout()
        self.buttontable = widgets.QTableWidget()
        self.layoutv = widgets.QVBoxLayout()

        self.layouth.addWidget(self.buttontable)
        self.layouth.addLayout(self.layoutv)

        self.buttondata = buttonData()
        self.layoutv.addWidget(self.buttondata)

        self.setLayout(self.layouth)

        self.buttontable.setFixedWidth(250)
        self.buttontable.setColumnCount(2)
        self.buttontable.verticalHeader().hide()
        self.buttontable.setSelectionBehavior(widgets.QAbstractItemView.SelectRows)
        self.buttontable.setSelectionMode(widgets.QAbstractItemView.SingleSelection)
        #self.buttontable.setShowGrid(False)
        self.buttontable.itemSelectionChanged.connect(self.selection_changed)
        self.enable_view(False) 
Example #7
Source File: qt4_figure.py    From FRETBursts with GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, show=True, create_axis=False):
        super(PlotWindow, self).__init__()
        
        # Create the plot canvas ...
        self.figure = Figure()
        self.canvas = FigureCanvas(self.figure)        
        if create_axis: self.axis = self.figure.add_subplot(111)
        #self.canvas.setParent(self)
        
        # ... and the toolbar
        self.toolbar = NavigationToolbar(self.canvas, self)

        # Pack all in QVBoxLayout
        self.vbox = QtGui.QVBoxLayout(self)
        self.vbox.addWidget(self.canvas)
        self.vbox.addWidget(self.toolbar)

        if show: self.show() 
Example #8
Source File: uiMainWindow.py    From TradeSim with Apache License 2.0 6 votes vote down vote up
def initUi(self):
        """"""
        self.setWindowTitle(u'关于VnTrader')
        
        text = u"""
            quantos trade client
            """
        
        label = QLabel()
        label.setText(text)
        label.setMinimumWidth(500)
        
        vbox = QVBoxLayout()
        vbox.addWidget(label)
        
        self.setLayout(vbox) 
Example #9
Source File: licenseDialog.py    From youtube-dl-GUI with MIT License 6 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(400, 300)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.textEdit = QtGui.QTextEdit(Dialog)
        self.textEdit.setReadOnly(True)
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.verticalLayout.addWidget(self.textEdit)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.ExitButton = QtGui.QPushButton(Dialog)
        self.ExitButton.setObjectName(_fromUtf8("ExitButton"))
        self.horizontalLayout.addWidget(self.ExitButton)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #10
Source File: memoEdit_ui.py    From memo with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
def setupUi(self, MemoEdit):
        '''被memoedit调用'''
        MemoEdit.setFixedWidth(400)

        '''初始化组件'''
        self.titleEdit = QtGui.QLineEdit()
        self.timeEdit = QtGui.QDateTimeEdit()
        self.contentEdit = QtGui.QTextEdit()
        self.okBtn = QtGui.QPushButton(_fromUtf8("确定"))
        self.layout = QtGui.QVBoxLayout()

        '''设置组件大小属性'''
        self.layout.setMargin(0)
        self.layout.setSpacing(0)

        ''' 设置stylesheet'''
        '''设置布局'''
        self.layout.addWidget(self.titleEdit)
        self.layout.addWidget(self.timeEdit)
        self.layout.addWidget(self.contentEdit)
        self.layout.addWidget(self.okBtn)

        self.setLayout(self.layout) 
Example #11
Source File: plot_view.py    From qkit with GNU General Public License v2.0 6 votes vote down vote up
def _addIndicatorLabels(self,Form,sizePolicy,indicators=[]):
        self.IndicatorLayout = QtGui.QVBoxLayout()
        self.IndicatorLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
        self.IndicatorLayout.setObjectName(_fromUtf8("horizontalLayout"))

        self.IndicatorLayout.setContentsMargins(0,0,0,0)
        self.IndicatorLayout.setContentsMargins(QtCore.QMargins(0,0,0,0))
        self.IndicatorLayout.setSpacing(3)
        
        for indicator in indicators:
            setattr(self,indicator,QtGui.QLabel(Form))
            temp_indicator = getattr(self,indicator)
            temp_indicator.setSizePolicy(sizePolicy)
            temp_indicator.setObjectName(_fromUtf8(indicator))
            self.IndicatorLayout.addWidget(temp_indicator)
            
        self.horizontalLayout.addLayout(self.IndicatorLayout,stretch = -10) 
Example #12
Source File: demoUi.py    From chanlun with MIT License 6 votes vote down vote up
def initUi(self, startDate=None):
        """初始化界面"""
        self.setWindowTitle(u'Price')

        self.vbl_1 = QtGui.QVBoxLayout()
        self.initplotTick()  # plotTick初始化

        self.vbl_2 = QtGui.QVBoxLayout()
        self.initplotKline()  # plotKline初始化
        self.initplotTendency()  # plot分时图的初始化

        # 整体布局
        self.hbl = QtGui.QHBoxLayout()
        self.hbl.addLayout(self.vbl_1)
        self.hbl.addLayout(self.vbl_2)
        self.setLayout(self.hbl)

        self.initHistoricalData()  # 下载历史数据

    #---------------------------------------------------------------------- 
Example #13
Source File: uiBasicWidget修改.py    From chanlun with MIT License 6 votes vote down vote up
def initUi(self, startDate=None):
        """初始化界面"""
        self.setWindowTitle(u'Price')

        self.vbl_1 = QtGui.QVBoxLayout()
        self.initplotTick()  # plotTick初始化

        self.vbl_2 = QtGui.QVBoxLayout()
        self.initplotKline()  # plotKline初始化
        self.initplotTendency()  # plot分时图的初始化

        # 整体布局
        self.hbl = QtGui.QHBoxLayout()
        self.hbl.addLayout(self.vbl_1)
        self.hbl.addLayout(self.vbl_2)
        self.setLayout(self.hbl)

        self.initHistoricalData()  # 下载历史数据

    #---------------------------------------------------------------------- 
Example #14
Source File: GUIElements.py    From FlatCAM with MIT License 6 votes vote down vote up
def __init__(self, choices, orientation='horizontal', parent=None):
        """
        The choices are specified as a list of dictionaries containing:

        * 'label': Shown in the UI
        * 'value': The value returned is selected

        :param choices: List of choices. See description.
        :type choices: list
        """
        super(RadioSet, self).__init__(parent)
        self.choices = copy(choices)

        if orientation == 'horizontal':
            layout = QtGui.QHBoxLayout()
        else:
            layout = QtGui.QVBoxLayout()

        group = QtGui.QButtonGroup(self)

        for choice in self.choices:
            choice['radio'] = QtGui.QRadioButton(choice['label'])
            group.addButton(choice['radio'])
            layout.addWidget(choice['radio'], stretch=0)
            choice['radio'].toggled.connect(self.on_toggle)

        layout.setContentsMargins(0, 0, 0, 0)
        layout.addStretch()
        self.setLayout(layout)

        self.group_toggle_fn = lambda: None 
Example #15
Source File: FlatCAMTool.py    From FlatCAM with MIT License 6 votes vote down vote up
def __init__(self, app, parent=None):
        """

        :param app: The application this tool will run in.
        :type app: App
        :param parent: Qt Parent
        :return: FlatCAMTool
        """
        QtGui.QWidget.__init__(self, parent)

        # self.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Maximum)

        self.layout = QtGui.QVBoxLayout()
        self.setLayout(self.layout)

        self.app = app

        self.menuAction = None 
Example #16
Source File: universal_tool_template_1116.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout 
Example #17
Source File: universal_tool_template_1020.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout 
Example #18
Source File: window_ui.py    From memo with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
def setupUi(self, Window):
        '''被主窗口调用'''
        Window.setWindowTitle(_fromUtf8("便签"))
        Window.setMinimumWidth(400)
        Window.setMaximumWidth(400)

        '''初始化组件'''
        self.layout = QtGui.QVBoxLayout()
        self.topLabelPix = QtGui.QPixmap(setting.topLabelImgPath)
        self.topLabel = QtGui.QLabel()

        '''设置组件属性'''
        self.layout.setMargin(0)
        self.layout.setSpacing(0)
        self.topLabel.setPixmap(self.topLabelPix)

        '''设置布局'''
        self.layout.addWidget(self.topLabel)

        self.setLayout(self.layout) 
Example #19
Source File: GearBox_template_1010.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout 
Example #20
Source File: Sniffer.py    From SimpleSniffer with GNU General Public License v3.0 6 votes vote down vote up
def initUI(self):
        grid = QtGui.QGridLayout()

        grid.addWidget(QtGui.QLabel(u'过滤规则:', parent=self), 0, 0, 1, 1)
        self.filter = QtGui.QLineEdit(parent=self)
        grid.addWidget(self.filter, 0, 1, 1, 1)
        # 创建ButtonBox,用户确定和取消
        buttonBox = QtGui.QDialogButtonBox(parent=self)
        buttonBox.setOrientation(QtCore.Qt.Horizontal) # 设置为水平方向
        buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) # 确定和取消两个按钮
        # 连接信号和槽
        buttonBox.accepted.connect(self.accept) # 确定
        buttonBox.rejected.connect(self.reject) # 取消
        # 垂直布局,布局表格及按钮
        layout = QtGui.QVBoxLayout()
        # 加入前面创建的表格布局
        layout.addLayout(grid)
        # 放一个间隔对象美化布局
        spacerItem = QtGui.QSpacerItem(20, 48, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        layout.addItem(spacerItem)
        # ButtonBox
        layout.addWidget(buttonBox)
        self.setLayout(layout) 
Example #21
Source File: universal_tool_template_2010.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def quickMsg(self, msg, block=1, ask=0):
        tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
        tmpMsg.setWindowTitle("Info")
        lineCnt = len(msg.split('\n'))
        if lineCnt > 25:
            scroll = QtWidgets.QScrollArea()
            scroll.setWidgetResizable(1)
            content = QtWidgets.QWidget()
            scroll.setWidget(content)
            layout = QtWidgets.QVBoxLayout(content)
            tmpLabel = QtWidgets.QLabel(msg)
            tmpLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
            layout.addWidget(tmpLabel)
            tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
            tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
        else:
            tmpMsg.setText(msg)
        if block == 0:
            tmpMsg.setWindowModality( QtCore.Qt.NonModal )
        if ask==0:
            tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
        else:
            tmpMsg.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel)
        if block:
            value = tmpMsg.exec_()
            if value == QtWidgets.QMessageBox.Ok:
                return 1
            else:
                return 0
        else:
            tmpMsg.show()
            return 0 
Example #22
Source File: fader.py    From tutorials with MIT License 5 votes vote down vote up
def __init__(self):
        super(FadeExample, self).__init__()

        self.resize(600,600)
        self.vlayout = QtGui.QVBoxLayout(self)

        self.w1 = QtGui.QWidget()
        self.w1.setStyleSheet("QWidget {background-color: red;}")

        self.w2 = QtGui.QWidget()
        self.w2.setStyleSheet("QWidget {background-color: blue;}")

        self.stacked = QtGui.QStackedLayout()
        self.stacked.addWidget(self.w1)
        self.stacked.addWidget(self.w2)

        self.vlayout.addLayout(self.stacked)
        
        self.fadeButton = QtGui.QPushButton("Fade")   
        self.resetButton = QtGui.QPushButton("Reset")

        buttonLayout = QtGui.QHBoxLayout()
        buttonLayout.addWidget(self.fadeButton)
        buttonLayout.addWidget(self.resetButton)
                
        self.vlayout.addLayout(buttonLayout)
        
        self.fadeButton.clicked.connect(self.fade)
        self.resetButton.clicked.connect(self.reset) 
Example #23
Source File: blocking.py    From tutorials with MIT License 5 votes vote down vote up
def main(self):

		app = QtGui.QApplication(sys.argv)

		self.win = QtGui.QWidget()
		self.win.resize(300,200)

		layout = QtGui.QVBoxLayout(self.win)

		blocking_button = QtGui.QPushButton("Block")
		blocking_button.clicked.connect(self.blocking)
		layout.addWidget(blocking_button)

		signal_button = QtGui.QPushButton("Signals")
		signal_button.clicked.connect(self.non_blocking)
		layout.addWidget(signal_button)

		self.output = QtGui.QLineEdit()
		layout.addWidget(self.output)

		clear_button = QtGui.QPushButton("Clear")
		clear_button.clicked.connect(self.output.clear)
		layout.addWidget(clear_button)

		self.win.show()
		self.win.raise_()

		app.exec_() 
Example #24
Source File: infoWindowUI.py    From tutorials with MIT License 5 votes vote down vote up
def setupUi(self, InfoWindow):
        InfoWindow.setObjectName(_fromUtf8("InfoWindow"))
        InfoWindow.resize(611, 396)
        self.verticalLayout = QtGui.QVBoxLayout(InfoWindow)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.infoLabel = QtGui.QLabel(InfoWindow)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.infoLabel.sizePolicy().hasHeightForWidth())
        self.infoLabel.setSizePolicy(sizePolicy)
        self.infoLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.infoLabel.setObjectName(_fromUtf8("infoLabel"))
        self.verticalLayout.addWidget(self.infoLabel)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.setInfoDumbButton = QtGui.QPushButton(InfoWindow)
        self.setInfoDumbButton.setObjectName(_fromUtf8("setInfoDumbButton"))
        self.horizontalLayout.addWidget(self.setInfoDumbButton)
        self.setInfoSmartButton = QtGui.QPushButton(InfoWindow)
        self.setInfoSmartButton.setObjectName(_fromUtf8("setInfoSmartButton"))
        self.horizontalLayout.addWidget(self.setInfoSmartButton)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(InfoWindow)
        QtCore.QMetaObject.connectSlotsByName(InfoWindow) 
Example #25
Source File: outliner.py    From tutorials with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
		super(Outliner, self).__init__(*args, **kwargs)

		self.resize(200,500)
		self.setObjectName("CustomOutliner")

		self.layout = QtGui.QVBoxLayout(self)
		self.layout.setMargin(2)

		self.model = QtGui.QStandardItemModel()
		self.model.setItemPrototype(DagTreeItem())

		view = QtGui.QTreeView()
		view.setModel(self.model)
		view.header().setVisible(False)
		view.setEditTriggers(view.NoEditTriggers)
		view.setSelectionMode(view.ExtendedSelection)

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

		QtCore.QTimer.singleShot(1, self.initDisplay)

		#
		# Connections
		#
		self.view.expanded.connect(self.nodeExpanded)
		self.view.selectionModel().selectionChanged.connect(self.selectionChanged) 
Example #26
Source File: __init__.py    From nightmare with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, vsbuilder, parent=None):
        QtGui.QDialog.__init__(self, parent=parent)
        self.structname = None

        self.setWindowTitle('Select a structure...')

        vlyt = QtGui.QVBoxLayout()
        hlyt = QtGui.QHBoxLayout()

        self.structtree = VQStructSelectView(vsbuilder, parent=self)

        hbox = QtGui.QWidget(parent=self)

        ok = QtGui.QPushButton("Ok", parent=hbox)
        cancel = QtGui.QPushButton("Cancel", parent=hbox)

        self.structtree.doubleClicked.connect( self.dialog_activated )

        ok.clicked.connect(self.dialog_ok)
        cancel.clicked.connect(self.dialog_cancel)

        hlyt.addStretch(1)
        hlyt.addWidget(cancel)
        hlyt.addWidget(ok)
        hbox.setLayout(hlyt)

        vlyt.addWidget(self.structtree)
        vlyt.addWidget(hbox)
        self.setLayout(vlyt)

        self.resize(500, 500) 
Example #27
Source File: recipe-578634.py    From code with MIT License 5 votes vote down vote up
def __init__(self):
            super(Gui, self).__init__()
            self.resize(250, 300)

            self._list = QtGui.QListWidget(self)

            self._button1 = QtGui.QPushButton("Test CallbackEvent", self)     
            self._button2 = QtGui.QPushButton("Test CallbackPool", self)     
            
            layout = QtGui.QVBoxLayout(self)
            layout.setSpacing(2)
            layout.addWidget(self._button1)

            line = QtGui.QFrame(self)
            line.setFrameStyle(line.HLine)
            layout.addSpacing(6)
            layout.addWidget(line)
            layout.addSpacing(6)

            layout.addWidget(self._list)
            layout.addWidget(self._button2)

            self._pool = CallbackThreadPool(4)

            self._button1.clicked.connect(self.runCallbackEvents)
            self._button2.clicked.connect(self.runCallbackPool) 
Example #28
Source File: BatchAddUrls.py    From youtube-dl-GUI with MIT License 5 votes vote down vote up
def setupUi(self, BatchAdd):
        BatchAdd.setObjectName(_fromUtf8("BatchAdd"))
        BatchAdd.setWindowModality(QtCore.Qt.NonModal)
        BatchAdd.resize(400, 300)
        BatchAdd.setMaximumSize(QtCore.QSize(400, 16777215))
        BatchAdd.setModal(False)
        self.verticalLayout_2 = QtGui.QVBoxLayout(BatchAdd)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.verticalWidget = QtGui.QWidget(BatchAdd)
        self.verticalWidget.setObjectName(_fromUtf8("verticalWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalWidget)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.UrlList = QtGui.QTextEdit(self.verticalWidget)
        self.UrlList.setObjectName(_fromUtf8("UrlList"))
        self.verticalLayout.addWidget(self.UrlList)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.Browse = QtGui.QPushButton(self.verticalWidget)
        self.Browse.setObjectName(_fromUtf8("Browse"))
        self.horizontalLayout.addWidget(self.Browse)
        self.Add = QtGui.QPushButton(self.verticalWidget)
        self.Add.setObjectName(_fromUtf8("Add"))
        self.horizontalLayout.addWidget(self.Add)
        self.Close = QtGui.QPushButton(self.verticalWidget)
        self.Close.setObjectName(_fromUtf8("Close"))
        self.horizontalLayout.addWidget(self.Close)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.verticalLayout_2.addWidget(self.verticalWidget)

        self.retranslateUi(BatchAdd)
        QtCore.QMetaObject.connectSlotsByName(BatchAdd) 
Example #29
Source File: plot_view.py    From qkit with GNU General Public License v2.0 5 votes vote down vote up
def _addTraceSelectorIndicator(self,Form,sizePolicy,TraceSelector = "", TraceIndicator="", prefix = "Trace: "):
        self.TraceSelIndLayout = QtGui.QVBoxLayout()
        self.TraceSelIndLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
        self.TraceSelIndLayout.setObjectName(_fromUtf8("TraceSelIndLayout"))

        self.TraceSelIndLayout.setContentsMargins(0,0,0,0)
        self.TraceSelIndLayout.setContentsMargins(QtCore.QMargins(0,0,0,0))
        self.TraceSelIndLayout.setSpacing(1)


        setattr(self,TraceSelector,QtGui.QSpinBox(Form))
        temp_SelInd = getattr(self,TraceSelector)
        temp_SelInd.setSizePolicy(sizePolicy)
        temp_SelInd.setSuffix(_fromUtf8(""))
        temp_SelInd.setMinimum(-99999)
        temp_SelInd.setMaximum(99999)
        temp_SelInd.setProperty("value", -1)
        temp_SelInd.setObjectName(_fromUtf8(TraceSelector))
        temp_SelInd.setPrefix(_translate("Form", prefix , None))

        
        self.TraceSelIndLayout.addWidget(temp_SelInd)
            
        setattr(self,TraceIndicator,QtGui.QLineEdit(Form))
        temp_SelInd = getattr(self,TraceIndicator)
        temp_SelInd.setSizePolicy(sizePolicy)
        temp_SelInd.setReadOnly(False)
        temp_SelInd.setObjectName(_fromUtf8("TraceValue"))
        self.TraceSelIndLayout.addWidget(temp_SelInd)
        self.horizontalLayout.addLayout(self.TraceSelIndLayout,stretch = -10) 
Example #30
Source File: quiz-controller.py    From networkzero with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        super(QuizController, self).__init__(*args, **kwargs)
        self.setWindowTitle("Quiz Controller")

        self.instructions = Pyro4.Proxy("PYRO:quiz.instructions@localhost:1234")
        self.responder = FeedbackReader(Pyro4.Proxy("PYRO:quiz.feedback@localhost:1234"))
        self.responder.message_received.connect(self.handle_response)
        self.responder.start()

        overall_layout = QtGui.QVBoxLayout()
        self.add_teams(overall_layout)

        self.panel_layout = QtGui.QHBoxLayout()
        self.panels = {}
        for position in "left", "right":
            panel = self.panels[position.lower()] = Panel(self, position)
            self.panel_layout.addWidget(panel)
        overall_layout.addLayout(self.panel_layout)
        self.add_controller(overall_layout)
        self.setLayout(overall_layout)

        #
        # The first response is always lost. Not sure why.
        #
        self.send_command("COLOURS?")
        self.send_command("COLOURS?")
        self.send_command("SCORES?")
        self.send_command("TEAMS?")