def InitContainer(self): main_widget = QWidget() main_table = QHBoxLayout() left = QVBoxLayout() self.right_info = QVBoxLayout() self.para_info = QLabel() self.para_graph = QTextEdit() self.word_info = QTextEdit(readOnly=True) left.addWidget(self.para_info, 2) left.addWidget(self.para_graph, 20) left.addWidget(self.word_info, 20) main_table.addLayout(left) main_table.addLayout(self.right_info) main_widget.setLayout(main_table) self.setCentralWidget(main_widget)
def __init__(self): QMainWindow.__init__(self) self.setWindowFlags(Qt.FramelessWindowHint) self.setFixedSize(300,300) layout = QVBoxLayout() label = QLabel() label.setFixedSize(280,280) layout.addWidget(label, alignment=Qt.AlignCenter) self.setStyleSheet("QLabel{background-color:white}") self.blink_animation = QPropertyAnimation(self, b"backcolor") self.blink_animation.setStartValue(QColor(255,0,0)) self.blink_animation.setKeyValueAt(0.5, QColor(0,0,255)) self.blink_animation.setEndValue(QColor(255,0,0)) self.blink_animation.setDuration(3000) #self.blink_animation.setLoopCount(-1) self.blink_animation.start() container = QWidget() container.setLayout(layout) self.setCentralWidget(container)
def init_ui(self): self.mainLayout = QVBoxLayout() scroll_content = QWidget() task_box_layout = QGridLayout() scroll_content.setLayout(task_box_layout) for g in self.cp.ground_objects: if g.airbase_group: group_info = QBaseDefenseGroupInfo(self.cp, g, self.game) task_box_layout.addWidget(group_info) scroll_content.setLayout(task_box_layout) scroll = QScrollArea() scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) scroll.setWidgetResizable(True) scroll.setWidget(scroll_content) self.mainLayout.addWidget(scroll) self.setLayout(self.mainLayout)
def __init__(self): super().__init__() # Título da janela. self.setWindowTitle('PySide2 QColorDialog().') # Ícone da janela principal icon = QIcon() icon.addPixmap(QPixmap('../../../images/icons/icon.png')) self.setWindowIcon(icon) # Tamanho inicial da janela. screen_size = app.desktop().geometry() # screen_size = app.primaryScreen().geometry() width = screen_size.width() height = screen_size.height() self.resize(width / 2, height / 2) # Tamanho mínimo da janela. self.setMinimumSize(width / 2, height / 2) # Tamanho maximo da janela. self.setMaximumSize(width - 200, height - 200) # Widget central. widget = QWidget() self.setCentralWidget(widget) # Widgets. vbox = QVBoxLayout() widget.setLayout(vbox) self.label = QLabel('Cor selecionada') self.label.setAutoFillBackground(True) self.label.setAlignment(Qt.AlignCenter) vbox.addWidget(self.label) button = QPushButton('Abrir diálogo de seleção de cor') button.clicked.connect(self.open_dialog) vbox.addWidget(button)
def test_closeEvent(self): importer = mock.NonCallableMagicMock() importer.name = mock.MagicMock(return_value="importer") toolbox = QWidget() toolbox.qsettings = mock.MagicMock(return_value=QSettings()) widget = ImportEditorWindow(importer, "", SourceConnection, {}, {}, toolbox) widget._qsettings = mock.NonCallableMagicMock() widget.closeEvent() widget._qsettings.beginGroup.assert_called_once_with("mappingPreviewWindow") widget._qsettings.endGroup.assert_called_once_with() qsettings_save_calls = widget._qsettings.setValue.call_args_list self.assertEqual(len(qsettings_save_calls), 9) saved_dict = {saved[0][0]: saved[0][1] for saved in qsettings_save_calls} self.assertIn("main_splitter_splitterState", saved_dict) self.assertIn("sources_splitter_splitterState", saved_dict) self.assertIn("mapping_splitter_splitterState", saved_dict) self.assertIn("top_source_splitter_splitterState", saved_dict) self.assertIn("windowSize", saved_dict) self.assertIn("windowPosition", saved_dict) self.assertIn("windowState", saved_dict) self.assertIn("windowMaximized", saved_dict) self.assertIn("n_screens", saved_dict)
def _setup(self) -> None: # Set the central widget self._centralWidget = QWidget() self.setCentralWidget(self._centralWidget) self.generalLayoutMaster = QVBoxLayout() self._centralWidget.setLayout(self.generalLayoutMaster) extractAction = QAction(QIcon('coffeebean.ico'), 'Flee the Scene', self) extractAction.triggered.connect(self.close_application) self.toolBar = self.addToolBar("Extraction") self.toolBar.addAction(extractAction) self._font_choice() self._font_color() self._quit_button() self._calender() self._calculator() self._style_selector() self._progressbar_button() self._resize_checkbox()
def _load(self): if self.loaded: return self.service = locator.get_scoped("DialogueService") module_service = locator.get_scoped("ModuleService") characters_model = module_service.get_module( "Characters").entries_model layout = QHBoxLayout(self) characters_list = QListView() characters_list.setModel(characters_model) characters_list.setSizePolicy( QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)) characters_list.selectionModel().currentRowChanged.connect( self._update_selection) self.list = characters_list scroll_area = QScrollArea() form_container = QWidget() form = QFormLayout() self.editors = [] for dialogue in self.service.dialogues: label = QLabel(dialogue.name) editor = QLineEdit() editor.editingFinished.connect( lambda e=editor, d=dialogue: self._on_editor_change(e, d)) self.editors.append(editor) form.addRow(label, editor) form_container.setLayout(form) scroll_area.setWidgetResizable(True) scroll_area.setWidget(form_container) layout.addWidget(characters_list) layout.addWidget(scroll_area) self.setLayout(layout) self.service.load() self.loaded = True
def init_tab1(paths): tab1 = QWidget() tab1_layout = QVBoxLayout() tab1.setLayout(tab1_layout) # Widgets in leftbox tab1_fasta_chooser = file_chooser(paths['pipe'], type='fasta') tab1_database_viewer = file_viewer(type='file') tab1_ms_chooser = file_chooser(paths['pipe'], type='ms') tab1_batch_file_viewer = batch_file_viewer(paths['nf']) tab1_output_chooser = file_chooser(paths['pipe'], type='directory') tab1_output_viewer = file_viewer(type='directory') tab1_run_button = run_button(paths['nf'], paths['sh'], paths['pipe']) tab1_layout.addWidget(tab1_fasta_chooser, 0, QtCore.Qt.AlignCenter) tab1_layout.addWidget(tab1_database_viewer) tab1_layout.addWidget(tab1_ms_chooser, 0, QtCore.Qt.AlignCenter) tab1_layout.addWidget(tab1_batch_file_viewer) tab1_layout.addWidget(tab1_output_chooser, 0, QtCore.Qt.AlignCenter) tab1_layout.addWidget(tab1_output_viewer) tab1_layout.addWidget(tab1_run_button) return tab1
def __init__(self, parent=None, canvas=None): super(MyWidget, self).__init__(parent) ## 左 caps = ["みーぱん","かっきー","りさねーさん","ポンポン" ,"大園 玲","ゆっかー","おすし","かとし" ,"えんさく","掛橋 沙耶香","早川 聖来"] menu_widget = QListWidget() for i in range(11): #item = QListWidgetItem("Item {}".format(i)) item = QListWidgetItem(caps[i]) item.setTextAlignment(Qt.AlignCenter) menu_widget.addItem(item) ## 右 # 右上 _placeholder = "This is a placeholder text" text_widget = QLabel(_placeholder) text_widget.setObjectName("title") # 右下 button = QPushButton("Something") content_layout = QVBoxLayout() if canvas != None: content_layout.addWidget(canvas) else: content_layout.addWidget(text_widget) content_layout.addWidget(button) main_widget = QWidget() main_widget.setLayout(content_layout) ## 全体を構成 layout = QHBoxLayout() layout.addWidget(menu_widget, 1) layout.addWidget(main_widget, 4) self.setLayout(layout)
def _init_widgets(self): self._linear_viewer = QLinearDisassembly(self.workspace, self, parent=self) self._flow_graph = QDisassemblyGraph(self.workspace, self, parent=self) self._feature_map = QFeatureMap(self, parent=self) self._statusbar = QDisasmStatusBar(self, parent=self) vlayout = QVBoxLayout() vlayout.addWidget(self._feature_map) vlayout.addWidget(self._flow_graph) vlayout.addWidget(self._linear_viewer) vlayout.addWidget(self._statusbar) vlayout.setContentsMargins(0, 0, 0, 0) self._feature_map.setMaximumHeight(25) vlayout.setStretchFactor(self._feature_map, 0) vlayout.setStretchFactor(self._flow_graph, 1) vlayout.setStretchFactor(self._linear_viewer, 1) vlayout.setStretchFactor(self._statusbar, 0) hlayout = QHBoxLayout() hlayout.addLayout(vlayout) base = QWidget() base.setLayout(hlayout) main_window = QMainWindow() main_window.setWindowFlags(Qt.Widget) main_window.setCentralWidget(base) self.main_window = main_window main_layout = QHBoxLayout() main_layout.addWidget(main_window) self.setLayout(main_layout) self.display_disasm_graph() # self.display_linear_viewer() self.workspace.plugins.instrument_disassembly_view(self)
def __init__(self): super().__init__() self.w = NewWindow() self.chkbx1 = QCheckBox("show_and_close") self.chkbx1.clicked.connect(self.show_and_close) self.chkbx2 = QCheckBox("show_and_hide") self.chkbx2.clicked.connect(self.show_and_hide) self.chkbx3 = QCheckBox("set_visible") self.chkbx3.clicked.connect(self.set_visible) layout = QVBoxLayout() layout.addWidget(self.chkbx1) layout.addWidget(self.chkbx2) layout.addWidget(self.chkbx3) widget = QWidget() widget.setLayout(layout) self.setCentralWidget(widget)
def makeButtonsLayout(self): self.button = QPushButton("Add Node", self) self.button.clicked.connect(self.addNode) self.btn_connection = QPushButton("Add Connection:", self) self.btn_connection.clicked.connect(self.addConnection) self.button3 = QPushButton("Export Network", self) self.button3.clicked.connect(self.file_save) self.lbl_connection = QLabel("Connection") self.l_btns = QHBoxLayout() self.l_btns.addWidget(self.button3) self.l_btns.addStretch() self.l_btns.addWidget(self.btn_connection) self.l_btns.addWidget(self.lbl_connection) self.l_btns.addStretch() self.l_btns.addWidget(self.button) self.btns = QWidget() self.btns.setLayout(self.l_btns) self.btns.setFixedHeight(40)
def __init__(self, parent, db_mngr, *db_maps): """Initialize class. Args: parent (DataStoreForm) db_mngr (SpineDBManager) db_maps (DiffDatabaseMapping): the dbs to select items from """ super().__init__(parent) self.db_mngr = db_mngr self.db_maps = db_maps top_widget = QWidget() top_layout = QHBoxLayout(top_widget) db_maps_group_box = QGroupBox("Databases", top_widget) db_maps_layout = QVBoxLayout(db_maps_group_box) db_maps_layout.setContentsMargins(self._MARGIN, self._MARGIN, self._MARGIN, self._MARGIN) self.db_map_check_boxes = {db_map: QCheckBox(db_map.codename, db_maps_group_box) for db_map in self.db_maps} for check_box in self.db_map_check_boxes.values(): check_box.stateChanged.connect(lambda _: QTimer.singleShot(0, self._set_item_check_box_enabled)) check_box.setChecked(True) db_maps_layout.addWidget(check_box) items_group_box = QGroupBox("Items", top_widget) items_layout = QVBoxLayout(items_group_box) items_layout.setContentsMargins(self._MARGIN, self._MARGIN, self._MARGIN, self._MARGIN) self.item_check_boxes = {item_type: QCheckBox(item_type, items_group_box) for item_type in self._ITEM_TYPES} for check_box in self.item_check_boxes.values(): check_box.stateChanged.connect(lambda _: QTimer.singleShot(0, self._set_item_check_box_states_in_cascade)) items_layout.addWidget(check_box) top_layout.addWidget(db_maps_group_box) top_layout.addWidget(items_group_box) button_box = QDialogButtonBox(self) button_box.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) button_box.accepted.connect(self.accept) button_box.rejected.connect(self.reject) layout = QVBoxLayout(self) layout.addWidget(top_widget) layout.addWidget(button_box) layout.setContentsMargins(self._MARGIN, self._MARGIN, self._MARGIN, self._MARGIN) self.setAttribute(Qt.WA_DeleteOnClose)
def __init__(self): super(MainWindow, self).__init__() self.game = GameLoop(self) self.remember_choice_config = [False, False, 2] self.center_widget = QWidget(self) self.center_layout = TableGrid(self) self.side_widget = SidePanel(self) self.pieces = [] self.pieces_matrix = [[0] * 8] * 8 self.grid = self.center_layout.table self.available_moves = [] self.current_matrix = [] self.current_heuristic = None # Undo table is saved after every pc move, but if PC plays first, we cant save table before 1st move self.pc_first_jump = True self.animation_timer_list = [] self.animation_shrink_list = [] self.mark_source = [] self.marks = [] self.pl_last_eat = [] self.history_table = [] self.history_redo = [] self.overlayBG = None self.overlay = None self.aspect_ratio_widget = AspectRatioWidget(self.center_widget, self.side_widget, None) self.setStyleSheet("background:#333;") self.draw_table() self.windows_adjustment() self.show_menu(-1)
def addRow(self, row: int, *args): """ :param row: :param args: Jedes Argument ist ein Tuple, bestehend aus 1. einem String oder einem QWidget 2. der Column-Span-Angabe 3. (optional) der Align-Angabe :return: """ c = 0 for arg in args: if isinstance(arg, tuple): rowspan = 1 align = Qt.AlignLeft e1 = arg[0] colspan = arg[1] if len(arg) == 3: align = arg[2] if isinstance(e1, str): w = BaseLabel() w.setTextAndAdjustWidth(e1) else: w = e1 if align == Qt.AlignLeft: self.addWidget(w, row, c, rowspan, colspan) else: self.addWidget(w, row, c, rowspan, colspan, alignment=align) c += colspan elif isinstance(arg, int): vdummy = QWidget() vdummy.setFixedWidth(arg) c += 1 else: raise Exception("Illegal Argument")
def __init__(self): super().__init__() # Some buttons layout = QVBoxLayout() self.text = QPlainTextEdit() layout.addWidget(self.text) btn_run = QPushButton("Execute") btn_run.clicked.connect(self.start) layout.addWidget(btn_run) w = QWidget() w.setLayout(layout) self.setCentralWidget(w) # Thread runner self.threadpool = QThreadPool() self.show()
def draw(self): self.ui.modules.setLayout(QVBoxLayout()) for key, exporter_module in self.gui_root.fslapp.server.available_exporters.items( ): widget = QWidget() widget.setMaximumHeight(40) layout = QHBoxLayout(widget) layout.addWidget(QLabel(exporter_module.CLASS.name)) layout.addWidget(QLabel(exporter_module.CLASS.description)) button = QPushButton('Select') button.clicked.connect( partial(self.add_module, key, exporter_module)) button.setMinimumWidth(80) button.setMaximumWidth(80) layout.addWidget(button) self.ui.modules.layout().addWidget(widget) self.ui.modules.layout().addItem( QSpacerItem(20, 80, QSizePolicy.Minimum, QSizePolicy.Expanding)) self.show()
def __init__(self, parent=None): super().__init__(parent=parent) self.setWindowTitle("nexus-constructor") if parent is not None: parent.registerWindow(self) background_image = osp.join(osp.dirname(osp.abspath(__file__)), "../ui/icon.png") self._central_widget = QWidget() self._central_widget.setFont(QFont("monospace", pointSize=11)) self._central_widget.setObjectName("central_widget") self._central_widget.setStyleSheet( "QWidget#central_widget {" f"background-image:url({background_image});" "background-position:center; background-repeat:no-repeat; }") self.setCentralWidget(self._central_widget) self.setupUi() self.setFixedSize(660, 450) self.show()
def createLayout(self): self.widget = QWidget() self.setCentralWidget(self.widget) #栅格布局 self.layout = QGridLayout() #设置拉伸因子,每一列的比例 self.layout.setColumnStretch(0, 1) self.layout.setColumnStretch(1, 4) #控件 self.fileList() self.layout.addWidget(self.painter, 0, 1) #页面 self.button1 = QtWidgets.QLabel("起始点") self.brower1 = QtWidgets.QLineEdit() self.button2 = QtWidgets.QLabel("终止点") self.brower2 = QtWidgets.QLineEdit() self.button3 = QtWidgets.QPushButton("清除") self.button0 = QtWidgets.QPushButton("显示点号") self.button4 = QtWidgets.QPushButton("生成Lane") self.button5 = QtWidgets.QPushButton("生成Conn") labelLayout1 = QtWidgets.QHBoxLayout() labelLayout2 = QtWidgets.QHBoxLayout() labelLayout1.addWidget(self.button1) labelLayout1.addWidget(self.brower1) labelLayout1.addWidget(self.button2) labelLayout1.addWidget(self.brower2) labelLayout1.addWidget(self.button3) labelLayout2.addWidget(self.button0) labelLayout2.addWidget(self.button4) labelLayout2.addWidget(self.button5) self.layout.addLayout(labelLayout1, 1, 1) self.layout.addLayout(labelLayout2, 2, 1) self.widget.setLayout(self.layout)
def __init__(self, parent=None): super(HelpWindow,self).__init__(parent) self.setWindowTitle("Facepager 3.0 - Help") self.setMinimumWidth(600); self.setMinimumHeight(600); central = QWidget() self.setCentralWidget(central) vLayout = QVBoxLayout(central) self.page = MyQWebEnginePage() self.browser = QWebEngineView(central) self.browser.setPage(self.page) vLayout.addWidget(self.browser) hLayout = QHBoxLayout() vLayout.addLayout(hLayout) hLayout.addStretch(5) dismiss = QPushButton(central) dismiss.setText("Close") dismiss.clicked.connect(self.hide) hLayout.addWidget(dismiss)
def __init__(self): super().__init__() self.urls = [ "https://www.learnpyqt.com/", "https://www.mfitzp.com/", "https://www.google.com", "https://www.udemy.com/create-simple-gui-applications-with-python-and-qt/", ] # tag::init[] self.parsers = { # <1> # Regular expression parsers, to extract data from the HTML. "title": re.compile(r"<title.*?>(.*?)<\/title>", re.M | re.S), "h1": re.compile(r"<h1.*?>(.*?)<\/h1>", re.M | re.S), "h2": re.compile(r"<h2.*?>(.*?)<\/h2>", re.M | re.S), } # end::init[] layout = QVBoxLayout() self.text = QPlainTextEdit() self.text.setReadOnly(True) button = QPushButton("GO GET EM!") button.pressed.connect(self.execute) layout.addWidget(self.text) layout.addWidget(button) w = QWidget() w.setLayout(layout) self.setCentralWidget(w) self.show() self.threadpool = QThreadPool() print("Multithreading with maximum %d threads" % self.threadpool.maxThreadCount())
def __init__(self, parent=None): super(Widget, self).__init__(parent) menu_widget = QListWidget() for i in range(10): item = QListWidgetItem("Item {}".format(i)) item.setTextAlignment(Qt.AlignCenter) menu_widget.addItem(item) text_widget = QLabel(_placeholder) button = QPushButton("Something") content_layout = QVBoxLayout() content_layout.addWidget(text_widget) content_layout.addWidget(button) main_widget = QWidget() main_widget.setLayout(content_layout) layout = QHBoxLayout() layout.addWidget(menu_widget, 1) layout.addWidget(main_widget, 4) self.setLayout(layout)
def __init__(self, attributes: List[PluginAttribute], parent=None): """ Initialization of manager. :param attributes: Attributes that are manageable by user. :type attributes: List[PluginAttribute] :param parent: Parent widget. :type parent: QWidget """ super().__init__() self._attributes = attributes #Create widget for given attributes. self._widget = QWidget(parent) mainLayout = QVBoxLayout(self._widget) mainLayout.setAlignment(Qt.AlignTop) if len(self._attributes) == 0: label = QLabel(self.tr("No attributes."), self._widget) label.setTextInteractionFlags(Qt.TextSelectableByMouse | Qt.TextSelectableByKeyboard) mainLayout.addWidget(label) else: for a in self._attributes: #create layout for this attribute mainLayout.addWidget({ PluginAttribute.PluginAttributeType.CHECKABLE: self._createCheckableType, PluginAttribute.PluginAttributeType.VALUE: self._createValueType, PluginAttribute.PluginAttributeType.SELECTABLE: self._createSelectableType, PluginAttribute.PluginAttributeType.SELECTABLE_PLUGIN: self._createSelectablePluginType, PluginAttribute.PluginAttributeType.GROUP_PLUGINS: self._createGroupPluginType, }[a.type](a)) self._widget.setLayout(mainLayout)
def run(self): self.app = QApplication(sys.argv) win = QWidget() vbox = QVBoxLayout() button1 = QPushButton('Button 1') button2 = QPushButton('Button 2') button1.clicked.connect(self.clickedButton1) button2.clicked.connect(self.clickedButton2) self.bulb = QLabel() self.bulb.setText("Bulb: OFF") vbox.addWidget(button1) vbox.addWidget(button2) vbox.addWidget(self.bulb) win.setLayout(vbox) win.setWindowTitle('Physical Board') win.resize(200, 200) win.show() try: self.app.exec_() except KeyboardInterrupt: log.info('GUI FOUND interrupt') self.endMe()
def __init__(self): super().__init__() self.layout = QVBoxLayout() self.setLayout(self.layout) # Create widgets self.visualizations = QWidget() self.vis_layout = QHBoxLayout() self.camera = Camera() self.display = Display(self.camera) self.vis_layout.addWidget(self.camera) self.vis_layout.addWidget(self.display) self.visualizations.setLayout(self.vis_layout) self.dashboard = Dashboard() self.layout.addWidget(self.visualizations) self.layout.addWidget(self.dashboard) # Slots and signals. self.connect_singals_and_slots()
def setPrevLeakArea(self): form_box = FormGroupBox("Previous Leak Information", self) form_box.frame_layout.addRow(PrevLeak.INFLUENCE.value) form_box.frame_layout.addRow("Location:", PrevLeak.LOC.value) form_box.frame_layout.addRow("Cost to Repair ($):", PrevLeak.COST_TO_REPAIR.value) vol_unit = QWidget() vol_unit_lay = QHBoxLayout(vol_unit) vol_unit_lay.setContentsMargins(0, 0, 0, 0) vol_unit_lay.addWidget(QLabel("Volume (if known):", self)) vol_unit_lay.addWidget(PrevLeak.VOL.value) vol_unit_lay.addWidget(QLabel("Unit:", self)) vol_unit_lay.addWidget(PrevLeak.UNIT.value) vol_unit_lay.addWidget(HorizontalFiller(self)) form_box.frame_layout.addRow(vol_unit) claim_box = FormGroupBox("Claim Information:", self) claim_box.frame_layout.addRow(PrevLeak.CLAIM_FILED.value) claim_box.frame_layout.addRow("Total Claim Amount ($):", PrevLeak.CLAIM_AMT.value) claim_box.frame_layout.addRow("Deductible ($):", PrevLeak.DEDUCT.value) form_box.frame_layout.addRow(claim_box) self._scroll_layout.addRow(form_box)
def __init__(self): super().__init__() self.setWindowTitle("QSS Tester") self.editor = QPlainTextEdit() self.editor.textChanged.connect(self.update_styles) layout = QVBoxLayout() layout.addWidget(self.editor) # Define a set of simple widgets. cb = QCheckBox("Checkbox") layout.addWidget(cb) combo = QComboBox() combo.setObjectName("thecombo") combo.addItems(["First", "Second", "Third", "Fourth"]) layout.addWidget(combo) sb = QSpinBox() sb.setRange(0, 99999) layout.addWidget(sb) l = QLabel("This is a label") layout.addWidget(l) le = QLineEdit() le.setObjectName("mylineedit") layout.addWidget(le) pb = QPushButton("Push me!") layout.addWidget(pb) self.container = QWidget() self.container.setLayout(layout) self.setCentralWidget(self.container)
def __init__(self, parent): QWidget.__init__(self) self.parent = parent self.setWindowFlags(Qt.WindowStaysOnTopHint) self.setWindowTitle('~ Human IK管理 ~') self.setStyleSheet('font-size: 15px; color: #ddf;') self.resize(450, 350) vbl = QVBoxLayout() self.setLayout(vbl) hbl = QHBoxLayout() vbl.addLayout(hbl) self.cbb_poly = QComboBox() hbl.addWidget(self.cbb_poly) self.cbb_poly.setEditable(True) self.btn_hikdef = QPushButton('定義') hbl.addWidget(self.btn_hikdef) self.btn_hikdef.setFixedWidth(60) self.btn_hikdef.clicked.connect(self.hikdef) lis_chue_nod_poly = [] for chue_nod_shep in mc.ls('*Shape', shapes=1): chue_nod_poly = chue_nod_shep[:-5] if (mc.objExists(chue_nod_poly) and 'MMD_model' in mc.listAttr(chue_nod_poly)): lis_chue_nod_poly.append(chue_nod_poly) self.cbb_poly.addItem(chue_nod_poly) self.sca = QScrollArea() vbl.addWidget(self.sca) self.wdg = QWidget() self.sca.setWidget(self.wdg) self.vbl = QVBoxLayout() self.wdg.setLayout(self.vbl) self.btn_sang_hik = QPushButton('コントロールリグの作成') vbl.addWidget(self.btn_sang_hik) self.btn_sang_hik.clicked.connect(self.hikcori) self.btn_sang_hik.setEnabled(False)
def __init__(self, parent=None): super().__init__(parent) layout = QFormLayout(self) self._database = parent._database self.setWindowTitle("Enter New Definition to Dictionary") self._select_dictionary = QComboBox() self._select_dictionary.addItems(self._database.getDatabaseNames()) self._definition_name = QLineEdit() self._definition_name.setObjectName("defname") self._definition_name.setStyleSheet( 'QWidget[objectName^="defname"]{background-color: #FFFFFF; color: #000000;}' ) self._definition = DefinitionTextBox(self) self._definition.setObjectName("thedef") self._definition.setStyleSheet( 'QWidget[objectName^="thedef"]{background-color: #FFFFFF; color: #000000;}' ) button_row = QWidget(self) button_layout = QHBoxLayout(button_row) self._enter_button = QPushButton("Enter") self._enter_button.clicked.connect(self.enter) self._cancel_button = QPushButton("Cancel") self._canceled = True self._cancel_button.clicked.connect(self.close) button_layout.addWidget(self._enter_button) button_layout.addWidget(self._cancel_button) layout.addRow( QLabel( "Select the dictionary you would like to add the definition:")) layout.addRow(self._select_dictionary) layout.addRow(BreakLine(self)) layout.addRow("Enter the defintion name:", self._definition_name) layout.addRow("Enter the definition:", self._definition) layout.addRow(button_row)
def __init__(self, parent: QWidget = None): super(FrmShadowCalendar, self).__init__(parent) self.__iconFont: QFont = QFont() self.currentDate: QDateTime = QDateTime() self.shadowCalendar: ShadowCalendar = ShadowCalendar() self.widgetTop: QWidget = QWidget() self.btnDown: QPushButton = QPushButton() self.btnDown.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred) self.btnDown.setMinimumWidth(40) self.btnUp: QPushButton = QPushButton() self.btnUp.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred) self.btnUp.setMinimumWidth(40) self.labInfo: QLabel = QLabel() self.labInfo.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) self.line = Line(shape=QFrame.HLine, color=QColor("#888888")) layout: QHBoxLayout = QHBoxLayout() layout.addWidget(self.labInfo) layout.addWidget(self.btnUp) layout.addWidget(self.btnDown) layout.setGeometry(QRect(0, 9, 0, 9)) layout.setSpacing(6) self.widgetTop.setLayout(layout) layout: QVBoxLayout = QVBoxLayout() layout.addWidget(self.widgetTop) layout.addWidget(self.line) layout.addWidget(self.shadowCalendar) self.setLayout(layout) self.initForm() self.btnUp.clicked.connect(self.on_btnUp_clicked) self.btnDown.clicked.connect(self.on_btnDown_clicked)