def setupUi(self, AboutScreen): AboutScreen.setObjectName("AboutScreen") AboutScreen.resize(325, 385) AboutScreen.setMinimumSize(QtCore.QSize(320, 327)) self.verticalLayout = QtGui.QVBoxLayout(AboutScreen) self.verticalLayout.setSpacing(15) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.icon = QtGui.QLabel(AboutScreen) self.icon.setMinimumSize(QtCore.QSize(100, 100)) self.icon.setMaximumSize(QtCore.QSize(100, 100)) self.icon.setText("") self.icon.setPixmap(QtGui.QPixmap(":/tk-desktop/shotgun_logo.png")) self.icon.setScaledContents(True) self.icon.setObjectName("icon") self.horizontalLayout.addWidget(self.icon) self.verticalLayout.addLayout(self.horizontalLayout) self.header = QtGui.QLabel(AboutScreen) self.header.setStyleSheet("font-size: 16px;") self.header.setAlignment(QtCore.Qt.AlignCenter) self.header.setWordWrap(True) self.header.setObjectName("header") self.verticalLayout.addWidget(self.header) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.body = QtGui.QLabel(AboutScreen) self.body.setAlignment(QtCore.Qt.AlignCenter) self.body.setWordWrap(True) self.body.setObjectName("body") self.verticalLayout.addWidget(self.body) spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem1) self.copyright = QtGui.QLabel(AboutScreen) self.copyright.setStyleSheet("font-size: 10px;") self.copyright.setAlignment(QtCore.Qt.AlignCenter) self.copyright.setWordWrap(True) self.copyright.setObjectName("copyright") self.verticalLayout.addWidget(self.copyright) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem2) self.buttonBox = QtGui.QDialogButtonBox(AboutScreen) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) self.buttonBox.setCenterButtons(False) self.buttonBox.setObjectName("buttonBox") self.horizontalLayout_2.addWidget(self.buttonBox) self.licensesButton = QtGui.QPushButton(AboutScreen) self.licensesButton.setObjectName("licensesButton") self.horizontalLayout_2.addWidget(self.licensesButton) spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem3) self.verticalLayout.addLayout(self.horizontalLayout_2) self.retranslateUi(AboutScreen) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), AboutScreen.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), AboutScreen.reject) QtCore.QMetaObject.connectSlotsByName(AboutScreen)
def __init__(self, parent=None): super(GraphTypeDialog, self).__init__(parent) layout = QtGui.QVBoxLayout(self) self.graph_lbl = QtGui.QLabel("Graph Type:") self.graph_type_cmb = QtGui.QComboBox() self.graph_type_cmb.addItems(["Substance", "MDL Material"]) self.vspc1 = QtGui.QSpacerItem(20, 5, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.graph_name = QtGui.QLabel("Graph Name:") self.graph_name_edt = QtGui.QLineEdit("New Graph") self.vspc2 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) layout.addWidget(self.graph_lbl) layout.addWidget(self.graph_type_cmb) layout.addItem(self.vspc1) layout.addWidget(self.graph_name) layout.addWidget(self.graph_name_edt) layout.addItem(self.vspc2) # OK and Cancel buttons buttons = QtGui.QDialogButtonBox( QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self, ) buttons.accepted.connect(self.accept) buttons.rejected.connect(self.reject) layout.addWidget(buttons)
def setupUi(self, CreateStorageDialog): CreateStorageDialog.setObjectName("CreateStorageDialog") CreateStorageDialog.resize(285, 94) CreateStorageDialog.setAutoFillBackground(True) self.verticalLayout_2 = QtGui.QVBoxLayout(CreateStorageDialog) self.verticalLayout_2.setSpacing(4) self.verticalLayout_2.setContentsMargins(12, 12, 12, 12) self.verticalLayout_2.setObjectName("verticalLayout_2") self.main_widget = QtGui.QWidget(CreateStorageDialog) self.main_widget.setObjectName("main_widget") self.verticalLayout = QtGui.QVBoxLayout(self.main_widget) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.storage_name_layout = QtGui.QHBoxLayout() self.storage_name_layout.setSpacing(4) self.storage_name_layout.setObjectName("storage_name_layout") spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.storage_name_layout.addItem(spacerItem) self.storage_name_lbl = QtGui.QLabel(self.main_widget) self.storage_name_lbl.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.storage_name_lbl.setObjectName("storage_name_lbl") self.storage_name_layout.addWidget(self.storage_name_lbl) self.storage_name = QtGui.QLineEdit(self.main_widget) self.storage_name.setObjectName("storage_name") self.storage_name_layout.addWidget(self.storage_name) spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.storage_name_layout.addItem(spacerItem1) self.storage_name_layout.setStretch(0, 5) self.storage_name_layout.setStretch(2, 15) self.verticalLayout.addLayout(self.storage_name_layout) self.info = QtGui.QLabel(self.main_widget) font = QtGui.QFont() font.setPointSize(10) self.info.setFont(font) self.info.setText("") self.info.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.info.setWordWrap(True) self.info.setObjectName("info") self.verticalLayout.addWidget(self.info) self.verticalLayout.setStretch(0, 1) self.verticalLayout.setStretch(1, 10) self.verticalLayout_2.addWidget(self.main_widget) self.button_box = QtGui.QDialogButtonBox(CreateStorageDialog) self.button_box.setLayoutDirection(QtCore.Qt.LeftToRight) self.button_box.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.button_box.setObjectName("button_box") self.verticalLayout_2.addWidget(self.button_box) self.retranslateUi(CreateStorageDialog) QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("accepted()"), CreateStorageDialog.accept) QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("rejected()"), CreateStorageDialog.reject) QtCore.QMetaObject.connectSlotsByName(CreateStorageDialog) CreateStorageDialog.setTabOrder(self.storage_name, self.button_box)
def setupUi(self, ErrorDialog): ErrorDialog.setObjectName("ErrorDialog") ErrorDialog.resize(572, 443) ErrorDialog.setModal(True) self.verticalLayout = QtGui.QVBoxLayout(ErrorDialog) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setSpacing(20) self.horizontalLayout.setObjectName("horizontalLayout") self.icon = QtGui.QLabel(ErrorDialog) self.icon.setObjectName("icon") self.horizontalLayout.addWidget(self.icon) self.title = QtGui.QLabel(ErrorDialog) self.title.setStyleSheet("font-size: 20px;") self.title.setWordWrap(True) self.title.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse) self.title.setObjectName("title") self.horizontalLayout.addWidget(self.title) self.horizontalLayout.setStretch(1, 1) self.verticalLayout.addLayout(self.horizontalLayout) self.message = QtGui.QTextEdit(ErrorDialog) self.message.setUndoRedoEnabled(False) self.message.setLineWrapMode(QtGui.QTextEdit.NoWrap) self.message.setReadOnly(True) self.message.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse) self.message.setObjectName("message") self.verticalLayout.addWidget(self.message) self.buttonBox = QtGui.QDialogButtonBox(ErrorDialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(ErrorDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), ErrorDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), ErrorDialog.reject) QtCore.QMetaObject.connectSlotsByName(ErrorDialog)
def _show_image(self): """ The user requested to show the file. Display the image in a transient, modeless QDialog. """ # don't continue unless there's somethign to show if not self._pixmap: return if self._image_path: # try to use the local path if there is one display_pixmap = QtGui.QPixmap(self._image_path) else: # may only have the pixmap (delegates) display_pixmap = QtGui.QPixmap(self._pixmap) # construct the dialog, display label, and a button box to close it. img_dialog = QtGui.QDialog(self) img_dialog.setWindowTitle( "Viewing: %s %s" % ( shotgun_globals.get_type_display_name(self._entity_type), self._field_name, ) ) lbl = QtGui.QLabel() lbl.setPixmap(display_pixmap) btn_box = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok) layout = QtGui.QVBoxLayout(img_dialog) layout.addWidget(lbl) layout.addWidget(btn_box) btn_box.accepted.connect(img_dialog.accept) img_dialog.show()
def setupUi(self, Licenses): Licenses.setObjectName("Licenses") Licenses.resize(500, 400) Licenses.setMinimumSize(QtCore.QSize(500, 400)) self.verticalLayout_2 = QtGui.QVBoxLayout(Licenses) self.verticalLayout_2.setObjectName("verticalLayout_2") self.licenseText = QtGui.QTextBrowser(Licenses) self.licenseText.setOpenExternalLinks(True) self.licenseText.setObjectName("licenseText") self.verticalLayout_2.addWidget(self.licenseText) self.buttonBox = QtGui.QDialogButtonBox(Licenses) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) self.buttonBox.setCenterButtons(True) self.buttonBox.setObjectName("buttonBox") self.verticalLayout_2.addWidget(self.buttonBox) self.retranslateUi(Licenses) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Licenses.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Licenses.reject) QtCore.QMetaObject.connectSlotsByName(Licenses)
def __init__(self, parent=None): super(Client, self).__init__(parent) hostLabel = QtGui.QLabel("&Server name:") portLabel = QtGui.QLabel("S&erver port:") methodLabel = QtGui.QLabel("Method:") paramsLabel = QtGui.QLabel("Params:") self.hostLineEdit = QtGui.QLineEdit("127.0.0.1") self.portLineEdit = QtGui.QLineEdit("55893") self.portLineEdit.setValidator(QtGui.QIntValidator(1, 65535, self)) self.paramsLineEdit = QtGui.QLineEdit("{}") self.methodCombo = QtGui.QComboBox() self.resultsTextEdit = QtGui.QTextEdit("") hostLabel.setBuddy(self.hostLineEdit) portLabel.setBuddy(self.portLineEdit) paramsLabel.setBuddy(self.paramsLineEdit) methodLabel.setBuddy(self.methodCombo) self.statusLabel = QtGui.QLabel("Ready.") self.sendCommandButton = QtGui.QPushButton("Send") self.sendCommandButton.setDefault(True) self.sendCommandButton.setEnabled(False) quitButton = QtGui.QPushButton("Quit") self.connectButton = QtGui.QPushButton("Connect") buttonBox = QtGui.QDialogButtonBox() buttonBox.addButton( self.connectButton, QtGui.QDialogButtonBox.ActionRole ) buttonBox.addButton( self.sendCommandButton, QtGui.QDialogButtonBox.ActionRole ) buttonBox.addButton(quitButton, QtGui.QDialogButtonBox.RejectRole) self.hostLineEdit.textChanged.connect(self.enablesendCommandButton) self.portLineEdit.textChanged.connect(self.enablesendCommandButton) self.sendCommandButton.clicked.connect(self.sendCommand) self.connectButton.clicked.connect(self.connect_to_host) quitButton.clicked.connect(self.close) mainLayout = QtGui.QGridLayout() mainLayout.addWidget(hostLabel, 0, 0) mainLayout.addWidget(self.hostLineEdit, 0, 1) mainLayout.addWidget(portLabel, 1, 0) mainLayout.addWidget(self.portLineEdit, 1, 1) mainLayout.addWidget(methodLabel, 2, 0) mainLayout.addWidget(self.methodCombo, 2, 1) mainLayout.addWidget(paramsLabel, 3, 0) mainLayout.addWidget(self.paramsLineEdit, 3, 1) mainLayout.addWidget(self.resultsTextEdit, 4, 1) mainLayout.addWidget(self.statusLabel, 5, 0, 1, 2) mainLayout.addWidget(buttonBox, 6, 0, 1, 2) self.setLayout(mainLayout) self.setWindowTitle("Toon Boom Harmony Engine Client") self.portLineEdit.setFocus() self.client = QTcpSocketClient(parent=self)