Python PyQt4.QtGui 模块,QToolButton() 实例源码

我们从Python开源项目中,提取了以下18个代码示例,用于说明如何使用PyQt4.QtGui.QToolButton()

项目:segyviewer    作者:Statoil    | 项目源码 | 文件源码
def _create_toolbar(self):
        toolbar = QToolBar()
        toolbar.setFloatable(False)
        toolbar.setMovable(False)

        self.layout_combo = LayoutCombo()
        toolbar.addWidget(self.layout_combo)
        self.layout_combo.layout_changed.connect(self._plot_layout_changed)

        self._settings_button = QToolButton()
        self._settings_button.setToolTip("Toggle settings visibility")
        self._settings_button.setIcon(resource_icon("cog.png"))
        self._settings_button.setCheckable(True)
        self._settings_button.toggled.connect(self._show_settings)
        toolbar.addWidget(self._settings_button)

        def toggle_on_close(event):
            self._settings_button.setChecked(False)
            event.accept()

        self._settings_window.closeEvent = toggle_on_close

        return toolbar
项目:PyFRAP    作者:alexblaessle    | 项目源码 | 文件源码
def __init__(self,parent,List,leftTitle="",rightTitle="",itemsRight=[]):

        super(advancedListSelectorDialog,self).__init__(parent,List,leftTitle=leftTitle,rightTitle=rightTitle)
        #print type(self),type(parent)
        #raw_input()

        #listSelectorDialog.__init__(parent,List,leftTitle=leftTitle,rightTitle=rightTitle,itemsRight=itemsRight)

        self.btnUp=QtGui.QToolButton()
        self.btnUp.connect(self.btnUp, QtCore.SIGNAL('clicked()'), self.upItem)
        self.btnUp.setArrowType(QtCore.Qt.UpArrow)

        self.btnDown=QtGui.QToolButton()
        self.btnDown.connect(self.btnDown, QtCore.SIGNAL('clicked()'), self.downItem)
        self.btnDown.setArrowType(QtCore.Qt.DownArrow)

        self.vbox.addWidget(self.btnUp)
        self.vbox.addWidget(self.btnDown)

        self.setWindowTitle("advanced List Selector Dialog")
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def createBackgroundCellWidget(self, text, image):
        button = QtGui.QToolButton()
        button.setText(text)
        button.setIcon(QtGui.QIcon(image))
        button.setIconSize(QtCore.QSize(50, 50))
        button.setCheckable(True)
        self.backgroundButtonGroup.addButton(button)

        layout = QtGui.QGridLayout()
        layout.addWidget(button, 0, 0, QtCore.Qt.AlignHCenter)
        layout.addWidget(QtGui.QLabel(text), 1, 0, QtCore.Qt.AlignCenter)

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

        return widget
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def createCellWidget(self, text, diagramType):
        item = DiagramItem(diagramType, self.itemMenu)
        icon = QtGui.QIcon(item.image())

        button = QtGui.QToolButton()
        button.setIcon(icon)
        button.setIconSize(QtCore.QSize(50, 50))
        button.setCheckable(True)
        self.buttonGroup.addButton(button, diagramType)

        layout = QtGui.QGridLayout()
        layout.addWidget(button, 0, 0, QtCore.Qt.AlignHCenter)
        layout.addWidget(QtGui.QLabel(text), 1, 0, QtCore.Qt.AlignCenter)

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

        return widget
项目:quartz-browser    作者:ksharindam    | 项目源码 | 文件源码
def __init__(self, parent=None):
        super(UrlEdit, self).__init__(parent)
        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.setStyleSheet("QLineEdit { padding: 2 2 2 22; background: transparent; border: 1px solid gray; border-radius: 3px;}")
        self.returnPressed.connect(self.onReturnPress)
        # Create button for showing page icon
        self.iconButton = QtGui.QToolButton(self)
        self.iconButton.setStyleSheet("QToolButton { border: 0; background: transparent; width: 16px; height: 16px; }")
        self.iconButton.move(4,3)
        self.iconButton.setCursor(QtCore.Qt.PointingHandCursor)
        self.iconButton.clicked.connect(self.selectAll)
        self.setIcon(QtGui.QIcon(':/quartz.png'))
        #self.setStyleSheet("QLineEdit { background-image:url(:/search.png);background-repeat:no-repeat;\
        #                         padding: 2 2 2 24 ;font-size:15px;}")
项目:linkchecker-gui    作者:linkcheck    | 项目源码 | 文件源码
def setup_clear_button (self):
        """Initialize the clear button."""
        self.clearButton = QtGui.QToolButton(self)
        pixmap = QtGui.QPixmap(":/icons/clear.png")
        self.clearButton.setIcon(QtGui.QIcon(pixmap))
        self.clearButton.setIconSize(pixmap.size())
        self.clearButton.setCursor(QtCore.Qt.ArrowCursor)
        style = "QToolButton { border: none; padding: 0px; }"
        self.clearButton.setStyleSheet(style)
        self.clearButton.hide()
        self.clearButton.clicked.connect(self.clear)
        self.textChanged.connect(self.updateCloseButton)
项目:linkchecker-gui    作者:linkcheck    | 项目源码 | 文件源码
def setup_list_button (self):
        """Initialize the dropdown list button."""
        self.listButton = QtGui.QToolButton(self)
        pixmap = QtGui.QPixmap(":/icons/arrow_down.png")
        self.listButton.setIcon(QtGui.QIcon(pixmap))
        self.listButton.setIconSize(pixmap.size())
        self.listButton.setCursor(QtCore.Qt.ArrowCursor)
        style = "QToolButton { border: none; padding: 0px; }"
        self.listButton.setStyleSheet(style)
        self.listButton.hide()
        self.listButton.clicked.connect(self.toggle_list)
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(316, 70)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setContentsMargins(0, 2, 0, 2)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.line = QtGui.QFrame(Form)
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.gridLayout.addWidget(self.line, 0, 0, 1, 3)
        self.dataOptions = QtGui.QComboBox(Form)
        self.dataOptions.setObjectName(_fromUtf8("dataOptions"))
        self.gridLayout.addWidget(self.dataOptions, 2, 0, 1, 3)
        self.enable = QtGui.QCheckBox(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.enable.sizePolicy().hasHeightForWidth())
        self.enable.setSizePolicy(sizePolicy)
        self.enable.setMinimumSize(QtCore.QSize(20, 0))
        self.enable.setText(_fromUtf8(""))
        self.enable.setObjectName(_fromUtf8("enable"))
        self.gridLayout.addWidget(self.enable, 1, 0, 1, 1)
        self.title = QtGui.QLabel(Form)
        self.title.setObjectName(_fromUtf8("title"))
        self.gridLayout.addWidget(self.title, 1, 1, 1, 1)
        self.toolButton = QtGui.QToolButton(Form)
        icon = QtGui.QIcon.fromTheme(_fromUtf8("window-close"))
        self.toolButton.setIcon(icon)
        self.toolButton.setObjectName(_fromUtf8("toolButton"))
        self.gridLayout.addWidget(self.toolButton, 1, 2, 1, 1)
        self.line_2 = QtGui.QFrame(Form)
        self.line_2.setFrameShape(QtGui.QFrame.HLine)
        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_2.setObjectName(_fromUtf8("line_2"))
        self.gridLayout.addWidget(self.line_2, 3, 0, 1, 3)

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.toolButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.remove)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:quantdigger    作者:andyzsf    | 项目源码 | 文件源码
def createBackgroundCellWidget(self, text, image):
        button = QtGui.QToolButton()
        button.setText(text)
        button.setIcon(QtGui.QIcon(image))
        button.setIconSize(QtCore.QSize(50, 50))
        button.setCheckable(True)
        self.backgroundButtonGroup.addButton(button)

        layout = QtGui.QGridLayout()
        layout.addWidget(button, 0, 0, QtCore.Qt.AlignHCenter)
        layout.addWidget(QtGui.QLabel(text), 1, 0, QtCore.Qt.AlignCenter)

        widget = QtGui.QWidget()
        widget.setLayout(layout)
        return widget
项目:ee-book    作者:ee-book    | 项目源码 | 文件源码
def setupUi(self, JobsDialog):
        JobsDialog.setObjectName(_fromUtf8("JobsDialog"))
        JobsDialog.resize(633, 542)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/jobs.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        JobsDialog.setWindowIcon(icon)
        self.gridLayout = QtGui.QGridLayout(JobsDialog)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.search = SearchBox2(JobsDialog)
        self.search.setObjectName(_fromUtf8("search"))
        self.horizontalLayout.addWidget(self.search)
        self.search_button = QtGui.QToolButton(JobsDialog)
        self.search_button.setObjectName(_fromUtf8("search_button"))
        self.horizontalLayout.addWidget(self.search_button)
        self.clear_button = QtGui.QToolButton(JobsDialog)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/clear_left.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.clear_button.setIcon(icon1)
        self.clear_button.setObjectName(_fromUtf8("clear_button"))
        self.horizontalLayout.addWidget(self.clear_button)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 2)
        self.jobs_view = QtGui.QTableView(JobsDialog)
        self.jobs_view.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
        self.jobs_view.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.jobs_view.setAlternatingRowColors(True)
        self.jobs_view.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.jobs_view.setIconSize(QtCore.QSize(32, 32))
        self.jobs_view.setObjectName(_fromUtf8("jobs_view"))
        self.gridLayout.addWidget(self.jobs_view, 1, 0, 1, 2)
        self.kill_button = QtGui.QPushButton(JobsDialog)
        self.kill_button.setObjectName(_fromUtf8("kill_button"))
        self.gridLayout.addWidget(self.kill_button, 2, 0, 1, 1)
        self.hide_button = QtGui.QPushButton(JobsDialog)
        self.hide_button.setObjectName(_fromUtf8("hide_button"))
        self.gridLayout.addWidget(self.hide_button, 2, 1, 1, 1)
        self.details_button = QtGui.QPushButton(JobsDialog)
        self.details_button.setObjectName(_fromUtf8("details_button"))
        self.gridLayout.addWidget(self.details_button, 3, 0, 1, 1)
        self.show_button = QtGui.QPushButton(JobsDialog)
        self.show_button.setObjectName(_fromUtf8("show_button"))
        self.gridLayout.addWidget(self.show_button, 3, 1, 1, 1)
        self.stop_all_jobs_button = QtGui.QPushButton(JobsDialog)
        self.stop_all_jobs_button.setObjectName(_fromUtf8("stop_all_jobs_button"))
        self.gridLayout.addWidget(self.stop_all_jobs_button, 4, 0, 1, 1)
        self.hide_all_button = QtGui.QPushButton(JobsDialog)
        self.hide_all_button.setObjectName(_fromUtf8("hide_all_button"))
        self.gridLayout.addWidget(self.hide_all_button, 4, 1, 1, 1)

        self.retranslateUi(JobsDialog)
        QtCore.QMetaObject.connectSlotsByName(JobsDialog)
项目:MidiMemo    作者:MaurizioB    | 项目源码 | 文件源码
def do_ev_filters(self):
        for actionBtn in self.toolBar.findChildren(QtGui.QWidget):
            if isinstance(actionBtn, QtGui.QToolButton) and actionBtn.defaultAction() == self.actionStop:
                actionBtn.installEventFilter(self)
                self.actionStop_btn = actionBtn
        self.src_bpm_spin.lineEdit().installEventFilter(self)
        self.dest_bpm_spin.lineEdit().installEventFilter(self)
项目:segyviewer    作者:Statoil    | 项目源码 | 文件源码
def _create_toolbar(self, color_maps):
        toolbar = QToolBar()
        toolbar.setFloatable(False)
        toolbar.setMovable(False)

        self._layout_combo = LayoutCombo()
        self._layout_combo_action = QWidgetAction(self._layout_combo)
        self._layout_combo_action.setDefaultWidget(self._layout_combo)
        toolbar.addAction(self._layout_combo_action)
        self._layout_combo.layout_changed.connect(self._slice_view_widget.set_plot_layout)

        # self._colormap_combo = ColormapCombo(['seismic', 'spectral', 'RdGy', 'hot', 'jet', 'gray'])
        self._colormap_combo = ColormapCombo(color_maps)
        self._colormap_combo.currentIndexChanged[int].connect(self._colormap_changed)
        toolbar.addWidget(self._colormap_combo)

        self._save_button = QToolButton()
        self._save_button.setToolTip("Save as image")
        self._save_button.setIcon(resource_icon("table_export.png"))
        self._save_button.clicked.connect(self._save_figure)
        toolbar.addWidget(self._save_button)

        self._settings_button = QToolButton()
        self._settings_button.setToolTip("Toggle settings visibility")
        self._settings_button.setIcon(resource_icon("cog.png"))
        self._settings_button.setCheckable(True)
        self._settings_button.toggled.connect(self._show_settings)
        toolbar.addWidget(self._settings_button)

        self._help_button = QToolButton()
        self._help_button.setToolTip("View help")
        self._help_button.setIcon(resource_icon("help.png"))
        self._help_button.setCheckable(True)
        self._help_button.toggled.connect(self._show_help)
        toolbar.addWidget(self._help_button)

        def toggle_on_close(event):
            self._settings_button.setChecked(False)
            event.accept()

        def toggle_on_close_help(event):
            self._help_button.setChecked(False)
            event.accept()

        self._settings_window.closeEvent = toggle_on_close
        self._help_window.closeEvent = toggle_on_close_help

        self._colormap_combo.setCurrentIndex(45)
        self.set_default_layout()

        return toolbar
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(355, 33)
        self.horizontalLayout = QtGui.QHBoxLayout(Form)
        self.horizontalLayout.setSpacing(3)
        self.horizontalLayout.setContentsMargins(0, 2, 0, 2)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.enable = QtGui.QCheckBox(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.enable.sizePolicy().hasHeightForWidth())
        self.enable.setSizePolicy(sizePolicy)
        self.enable.setMinimumSize(QtCore.QSize(20, 0))
        self.enable.setText(_fromUtf8(""))
        self.enable.setObjectName(_fromUtf8("enable"))
        self.horizontalLayout.addWidget(self.enable)
        self.name = QtGui.QLineEdit(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.name.sizePolicy().hasHeightForWidth())
        self.name.setSizePolicy(sizePolicy)
        self.name.setObjectName(_fromUtf8("name"))
        self.horizontalLayout.addWidget(self.name)
        self.cmd = QtGui.QLineEdit(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.cmd.sizePolicy().hasHeightForWidth())
        self.cmd.setSizePolicy(sizePolicy)
        self.cmd.setObjectName(_fromUtf8("cmd"))
        self.horizontalLayout.addWidget(self.cmd)
        self.toolButton = QtGui.QToolButton(Form)
        icon = QtGui.QIcon.fromTheme(_fromUtf8("window-close"))
        self.toolButton.setIcon(icon)
        self.toolButton.setObjectName(_fromUtf8("toolButton"))
        self.horizontalLayout.addWidget(self.toolButton)
        self.horizontalLayout.setStretch(0, 1)
        self.horizontalLayout.setStretch(1, 3)
        self.horizontalLayout.setStretch(2, 10)

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.toolButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.remove)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:PyFRAP    作者:alexblaessle    | 项目源码 | 文件源码
def __init__(self,parent,List,leftTitle="",rightTitle="",itemsRight=[]):
        super(listSelectorDialog,self).__init__(parent)
        #print type(self), type(parent)

        #QtGui.QDialog.__init__()


        self.itemsRight=itemsRight
        self.itemsLeft=list(List)

        self.List=List

        #Buttons
        self.btnAdd=QtGui.QToolButton()
        self.btnAdd.connect(self.btnAdd, QtCore.SIGNAL('clicked()'), self.addItem)
        self.btnAdd.setArrowType(QtCore.Qt.RightArrow)

        self.btnRemove=QtGui.QToolButton()
        self.btnRemove.connect(self.btnRemove, QtCore.SIGNAL('clicked()'), self.removeItem)
        self.btnRemove.setArrowType(QtCore.Qt.LeftArrow)

        self.btnDone=QtGui.QPushButton('Done')
        self.btnDone.connect(self.btnDone, QtCore.SIGNAL('clicked()'), self.donePressed)

        #Left QtreeWidgetItem
        self.leftList=QtGui.QTreeWidget()
        self.leftList.setHeaderLabels([leftTitle])
        self.leftList.setColumnWidth(0,200)
        self.leftList.setColumnWidth(1,75)
        self.leftList.itemDoubleClicked.connect(self.addItem)

        #right QtreeWidgetItem
        self.rightList=QtGui.QTreeWidget()
        self.rightList.setHeaderLabels([rightTitle])
        self.rightList.setColumnWidth(0,200)
        self.rightList.setColumnWidth(1,75)
        self.rightList.itemDoubleClicked.connect(self.removeItem)

        #Layout
        self.vbox = QtGui.QVBoxLayout()
        self.vbox.addWidget(self.btnAdd)
        self.vbox.addWidget(self.btnRemove)

        self.hbox = QtGui.QHBoxLayout()
        self.hbox.addWidget(self.leftList)
        self.hbox.addLayout(self.vbox)
        self.hbox.addWidget(self.rightList)

        self.vbox2 = QtGui.QVBoxLayout()
        self.vbox2.addLayout(self.hbox)
        self.vbox2.addWidget(self.btnDone)

        #Init lists
        self.initLeftList()
        self.initRightList()

        self.resize(400,500)
        self.setLayout(self.vbox2)
        self.setWindowTitle("list Selector Dialog")

        self.show()
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def createToolBox(self):
        self.buttonGroup = QtGui.QButtonGroup()
        self.buttonGroup.setExclusive(False)
        self.buttonGroup.buttonClicked[int].connect(self.buttonGroupClicked)

        layout = QtGui.QGridLayout()
        layout.addWidget(self.createCellWidget("Conditional", DiagramItem.Conditional),
                0, 0)
        layout.addWidget(self.createCellWidget("Process", DiagramItem.Step), 0,
                1)
        layout.addWidget(self.createCellWidget("Input/Output", DiagramItem.Io),
                1, 0)

        textButton = QtGui.QToolButton()
        textButton.setCheckable(True)
        self.buttonGroup.addButton(textButton, self.InsertTextButton)
        textButton.setIcon(QtGui.QIcon(QtGui.QPixmap(':/images/textpointer.png')
                            .scaled(30, 30)))
        textButton.setIconSize(QtCore.QSize(50, 50))

        textLayout = QtGui.QGridLayout()
        textLayout.addWidget(textButton, 0, 0, QtCore.Qt.AlignHCenter)
        textLayout.addWidget(QtGui.QLabel("Text"), 1, 0,
                QtCore.Qt.AlignCenter)
        textWidget = QtGui.QWidget()
        textWidget.setLayout(textLayout)
        layout.addWidget(textWidget, 1, 1)

        layout.setRowStretch(3, 10)
        layout.setColumnStretch(2, 10)

        itemWidget = QtGui.QWidget()
        itemWidget.setLayout(layout)

        self.backgroundButtonGroup = QtGui.QButtonGroup()
        self.backgroundButtonGroup.buttonClicked.connect(self.backgroundButtonGroupClicked)

        backgroundLayout = QtGui.QGridLayout()
        backgroundLayout.addWidget(self.createBackgroundCellWidget("Blue Grid",
                ':/images/background1.png'), 0, 0)
        backgroundLayout.addWidget(self.createBackgroundCellWidget("White Grid",
                ':/images/background2.png'), 0, 1)
        backgroundLayout.addWidget(self.createBackgroundCellWidget("Gray Grid",
                ':/images/background3.png'), 1, 0)
        backgroundLayout.addWidget(self.createBackgroundCellWidget("No Grid",
                ':/images/background4.png'), 1, 1)

        backgroundLayout.setRowStretch(2, 10)
        backgroundLayout.setColumnStretch(2, 10)

        backgroundWidget = QtGui.QWidget()
        backgroundWidget.setLayout(backgroundLayout)

        self.toolBox = QtGui.QToolBox()
        self.toolBox.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Ignored))
        self.toolBox.setMinimumWidth(itemWidget.sizeHint().width())
        self.toolBox.addItem(itemWidget, "Basic Flowchart Shapes")
        self.toolBox.addItem(backgroundWidget, "Backgrounds")
项目:quantdigger    作者:andyzsf    | 项目源码 | 文件源码
def createToolBox(self):
        self.buttonGroup = QtGui.QButtonGroup()
        self.buttonGroup.setExclusive(False)
        #self.buttonGroup.buttonClicked[int].connect(self.buttonGroupClicked)

        layout = QtGui.QGridLayout()
        #layout.addWidget(self.createCellWidget("Conditional", DiagramItem.Conditional), 0, 0)
        #layout.addWidget(self.createCellWidget("Process", DiagramItem.Step), 0, 1)
        #layout.addWidget(self.createCellWidget("Input/Output", DiagramItem.Io), 1, 0)

        textButton = QtGui.QToolButton()
        textButton.setCheckable(True)
        textButton.setIcon(QtGui.QIcon(QtGui.QPixmap(':/images/textpointer.png')
                            .scaled(30, 30)))
        textButton.setIconSize(QtCore.QSize(50, 50))

        textLayout = QtGui.QGridLayout()
        textLayout.addWidget(textButton, 0, 0, QtCore.Qt.AlignHCenter)
        textLayout.addWidget(QtGui.QLabel("Text"), 1, 0,
                QtCore.Qt.AlignCenter)
        textWidget = QtGui.QWidget()
        textWidget.setLayout(textLayout)
        layout.addWidget(textWidget, 1, 1)

        layout.setRowStretch(3, 10)
        layout.setColumnStretch(2, 10)

        itemWidget = QtGui.QWidget()
        itemWidget.setLayout(layout)

        self.backgroundButtonGroup = QtGui.QButtonGroup()
        #self.backgroundButtonGroup.buttonClicked.connect(self.backgroundButtonGroupClicked)

        backgroundLayout = QtGui.QGridLayout()
        backgroundLayout.addWidget(self.createBackgroundCellWidget("Blue Grid",
                ':/images/background1.png'), 0, 0)
        backgroundLayout.addWidget(self.createBackgroundCellWidget("White Grid",
                ':/images/background2.png'), 0, 1)
        backgroundLayout.addWidget(self.createBackgroundCellWidget("Gray Grid",
                ':/images/background3.png'), 1, 0)
        backgroundLayout.addWidget(self.createBackgroundCellWidget("No Grid",
                ':/images/background4.png'), 1, 1)

        backgroundLayout.setRowStretch(2, 10)
        backgroundLayout.setColumnStretch(2, 10)

        backgroundWidget = QtGui.QWidget()
        backgroundWidget.setLayout(backgroundLayout)

        self.toolBox = QtGui.QToolBox()
        self.toolBox.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Ignored))
        self.toolBox.setMinimumWidth(itemWidget.sizeHint().width())
        self.toolBox.addItem(itemWidget, "Basic Flowchart Shapes")
        self.toolBox.addItem(backgroundWidget, "Backgrounds")
项目:BeltaGo    作者:54BayMax    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(400, 300)
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(10, 120, 54, 12))
        self.label.setObjectName(_fromUtf8("label"))
        self.label_2 = QtGui.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(10, 150, 54, 12))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.label_3 = QtGui.QLabel(Dialog)
        self.label_3.setGeometry(QtCore.QRect(10, 190, 54, 12))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.label_4 = QtGui.QLabel(Dialog)
        self.label_4.setGeometry(QtCore.QRect(10, 240, 54, 12))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.lineEdit = QtGui.QLineEdit(Dialog)
        self.lineEdit.setGeometry(QtCore.QRect(80, 120, 113, 20))
        self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
        self.lineEdit_2 = QtGui.QLineEdit(Dialog)
        self.lineEdit_2.setGeometry(QtCore.QRect(80, 150, 113, 20))
        self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
        self.lineEdit_3 = QtGui.QLineEdit(Dialog)
        self.lineEdit_3.setGeometry(QtCore.QRect(80, 190, 113, 20))
        self.lineEdit_3.setObjectName(_fromUtf8("lineEdit_3"))
        self.lineEdit_4 = QtGui.QLineEdit(Dialog)
        self.lineEdit_4.setGeometry(QtCore.QRect(80, 230, 113, 20))
        self.lineEdit_4.setObjectName(_fromUtf8("lineEdit_4"))
        self.toolButton = QtGui.QToolButton(Dialog)
        self.toolButton.setGeometry(QtCore.QRect(200, 150, 37, 18))
        self.toolButton.setObjectName(_fromUtf8("toolButton"))
        self.toolButton_2 = QtGui.QToolButton(Dialog)
        self.toolButton_2.setGeometry(QtCore.QRect(200, 190, 37, 18))
        self.toolButton_2.setObjectName(_fromUtf8("toolButton_2"))
        self.toolButton_3 = QtGui.QToolButton(Dialog)
        self.toolButton_3.setGeometry(QtCore.QRect(200, 230, 37, 18))
        self.toolButton_3.setObjectName(_fromUtf8("toolButton_3"))
        self.pushButton = QtGui.QPushButton(Dialog)
        self.pushButton.setGeometry(QtCore.QRect(10, 270, 75, 23))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.pushButton_2 = QtGui.QPushButton(Dialog)
        self.pushButton_2.setGeometry(QtCore.QRect(160, 270, 75, 23))
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:ee-book    作者:ee-book    | 项目源码 | 文件源码
def setupUi(self, JobsDialog):
        JobsDialog.setObjectName(_fromUtf8("JobsDialog"))
        JobsDialog.resize(633, 542)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/jobs.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        JobsDialog.setWindowIcon(icon)
        self.gridLayout = QtGui.QGridLayout(JobsDialog)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        # self.search = SearchBox2(JobsDialog)     # TODO SearchBox
        # self.search.setObjectName(_fromUtf8("search"))
        # self.horizontalLayout.addWidget(self.search)
        self.search_button = QtGui.QToolButton(JobsDialog)
        self.search_button.setObjectName(_fromUtf8("search_button"))
        self.horizontalLayout.addWidget(self.search_button)
        self.clear_button = QtGui.QToolButton(JobsDialog)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/clear_left.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.clear_button.setIcon(icon1)
        self.clear_button.setObjectName(_fromUtf8("clear_button"))
        self.horizontalLayout.addWidget(self.clear_button)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 2)
        self.jobs_view = QtGui.QTableView(JobsDialog)
        self.jobs_view.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
        self.jobs_view.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.jobs_view.setAlternatingRowColors(True)
        self.jobs_view.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.jobs_view.setIconSize(QtCore.QSize(32, 32))
        self.jobs_view.setObjectName(_fromUtf8("jobs_view"))
        self.gridLayout.addWidget(self.jobs_view, 1, 0, 1, 2)
        self.kill_button = QtGui.QPushButton(JobsDialog)
        self.kill_button.setObjectName(_fromUtf8("kill_button"))
        self.gridLayout.addWidget(self.kill_button, 2, 0, 1, 1)
        self.hide_button = QtGui.QPushButton(JobsDialog)
        self.hide_button.setObjectName(_fromUtf8("hide_button"))
        self.gridLayout.addWidget(self.hide_button, 2, 1, 1, 1)
        self.details_button = QtGui.QPushButton(JobsDialog)
        self.details_button.setObjectName(_fromUtf8("details_button"))
        self.gridLayout.addWidget(self.details_button, 3, 0, 1, 1)
        self.show_button = QtGui.QPushButton(JobsDialog)
        self.show_button.setObjectName(_fromUtf8("show_button"))
        self.gridLayout.addWidget(self.show_button, 3, 1, 1, 1)
        self.stop_all_jobs_button = QtGui.QPushButton(JobsDialog)
        self.stop_all_jobs_button.setObjectName(_fromUtf8("stop_all_jobs_button"))
        self.gridLayout.addWidget(self.stop_all_jobs_button, 4, 0, 1, 1)
        self.hide_all_button = QtGui.QPushButton(JobsDialog)
        self.hide_all_button.setObjectName(_fromUtf8("hide_all_button"))
        self.gridLayout.addWidget(self.hide_all_button, 4, 1, 1, 1)

        self.retranslateUi(JobsDialog)
        QtCore.QMetaObject.connectSlotsByName(JobsDialog)