Exemplo n.º 1
0
    def _build(self):
        _layout = QtWidgets.QVBoxLayout(self)
        _layout.setSpacing(2)

        #  操作窗口
        self.operation_widget = QtWidgets.QFrame()
        _layout.addWidget(self.operation_widget)
        self.operation_widget.setFixedHeight(30)
        self.operation_widget.setObjectName("operation_widget")
        self.operation_layout = QtWidgets.QHBoxLayout(self.operation_widget)
        self.operation_layout.setContentsMargins(0, 0, 0, 0)
        # show verison
        self.verison_checkbox = QtWidgets.QCheckBox()
        self.verison_checkbox.setText("只显示带有版本的")
        self.verison_checkbox.setChecked(True)
        self.operation_layout.addWidget(self.verison_checkbox)
        self.operation_layout.addStretch(True)
        # refresh button
        self.refresh_button = button.IconButton(
            self, resource.get("icons", "refresh.png"),
            resource.get("icons", "refresh_hover.png"),
            resource.get("icons", "refresh_pressed.png"))
        self.refresh_button.setFixedSize(60, 24)
        self.refresh_button.setText(u"刷新")
        self.operation_layout.addWidget(self.refresh_button)

        # 分割窗口
        self.splitter = QtWidgets.QSplitter()
        _layout.addWidget(self.splitter)
        # 过滤面板
        self.filter_widget = filterwidget.FilterWidget(self.splitter)
        self.filter_widget.setMaximumWidth(200)
        # 资产列表面板
        self.assembly_list_widget = assemblylistwidget.AssemblyListWidget(
            self.splitter)
Exemplo n.º 2
0
    def _build(self):
        """ build widget
        """
        self.setFixedHeight(40)

        _layout = QtWidgets.QHBoxLayout(self)
        _layout.setSpacing(4)
        _layout.setContentsMargins(2, 2, 2, 2)

        self.all_button = button.IconButton(
            self, resource.get("icons", "category.png"),
            resource.get("icons", "category_hover.png"),
            resource.get("icons", "category_pressed.png"))
        self.all_button.setText("选择所有")
        _layout.addWidget(self.all_button)

        #  add line
        _line = QtWidgets.QFrame()
        _line.setMinimumWidth(1)
        _line.setStyleSheet("QFrame{background-color: #E6E7EA}")
        _layout.addWidget(_line)

        self.category_layout = QtWidgets.QHBoxLayout()
        _layout.addLayout(self.category_layout)
        self.category_layout.setSpacing(2)
        self.category_layout.setContentsMargins(0, 0, 0, 0)

        #  add line
        _line = QtWidgets.QFrame()
        _line.setMinimumWidth(1)
        _line.setStyleSheet("QFrame{background-color: #E6E7EA}")
        _layout.addWidget(_line)

        _layout.addStretch(True)
    def _build(self):
        """ build operation widget

        """
        self.setMaximumHeight(40)

        _layout = QtWidgets.QVBoxLayout(self)
        _layout.setSpacing(2)
        _layout.setContentsMargins(2, 4, 2, 2)

        # check widget
        # check current file
        self.check_file_button = QtWidgets.QPushButton()
        self.check_file_button.setMinimumSize(100, 40)
        self.check_file_button.setText(u"检测当前文件")

        # task widget
        self.task_widget = QtWidgets.QFrame()
        _layout.addWidget(self.task_widget)
        self.task_layout = QtWidgets.QHBoxLayout(self.task_widget)
        self.task_layout.setSpacing(2)
        self.task_layout.setContentsMargins(2, 2, 2, 2)
        # project
        self.project_button = button.IconButton(
            self, resource.get("icons", "project.png"),
            resource.get("icons", "project.png"),
            resource.get("icons", "project.png"))
        self.task_layout.addWidget(self.project_button)
        self.project_button.setText("未设置项目")
        self.project_button.setObjectName("task_link_button")
        # entity name code
        self.link_button = button.IconButton(self,
                                             resource.get("icons", "link.png"),
                                             resource.get("icons", "link.png"),
                                             resource.get("icons", "link.png"))
        self.task_layout.addWidget(self.link_button)
        self.link_button.setText("未设置当前任务")
        self.link_button.setObjectName("task_link_button")
        # task
        self.task_button = button.IconButton(self,
                                             resource.get("icons", "task.png"),
                                             resource.get("icons", "task.png"),
                                             resource.get("icons", "task.png"))
        self.task_layout.addWidget(self.task_button)
        self.task_button.setText("未设置当前任务")
        self.task_button.setObjectName("task_link_button")
        self.task_layout.addStretch(True)
Exemplo n.º 4
0
    def _build(self):
        _layout = QtWidgets.QVBoxLayout(self)
        _layout.setSpacing(0)
        _layout.setContentsMargins(0, 0, 0, 0)

        self.head_widget = QtWidgets.QFrame()
        _layout.addWidget(self.head_widget)
        self.head_widget.setMinimumHeight(30)
        self.head_widget.setObjectName("attr_frame")
        self.head_layout = QtWidgets.QHBoxLayout(self.head_widget)
        self.head_layout.setSpacing(0)
        self.head_layout.setContentsMargins(0, 0, 0, 0)
        # name
        self.name_button = QtWidgets.QPushButton()
        self.name_button.setObjectName("icon_button")
        self.name_button.setText(language.word("library"))
        self.name_button.setIcon(
            QtGui.QIcon(resource.get("icons", "library.png")))
        self.name_button.setFixedHeight(30)
        self.head_layout.addWidget(self.name_button)
        self.head_layout.addStretch(True)
        # 刷新
        self.refresh_button = button.IconButton(
            self, resource.get("icons", "refresh.png"),
            resource.get("icons", "refresh_hover.png"),
            resource.get("icons", "refresh_pressed.png"))
        self.refresh_button.setFixedSize(30, 30)
        self.head_layout.addWidget(self.refresh_button)

        # search lineedit
        self.search_lineedit = lineedit.SearchLineEdit()
        _layout.addWidget(self.search_lineedit)
        self.search_lineedit.setFixedHeight(30)

        # tree view
        self.list_view = listview.ListView()
        self.list_view.setItemDelegate(
            itemdelegate.ItemDelegate(self.list_view))
        _layout.addWidget(self.list_view)
        self.list_model = listmodel.ListModel([])
        self.list_proxy_model = listmodel.ListFilterProxyModel()
        self.list_view.setModel(self.list_proxy_model)
    def _build(self):
        """ build widget
        """
        self.setFixedHeight(40)
        self.setObjectName("library_operation_frame")

        _layout = QtWidgets.QHBoxLayout(self)
        _layout.setSpacing(2)
        _layout.setContentsMargins(2, 2, 2, 2)

        # # new button
        # self.new_button = button.IconButton( self,
        #                                               resource.get("icons", "add.png"),
        #                                               resource.get("icons", "add_hover.png"),
        #                                               resource.get("icons", "add_pressed.png"))
        # self.new_button.setText(language.word("new object"))
        # self.new_button.setMaximumHeight(25)
        # _layout.addWidget(self.new_button)

        _layout.addStretch(True)

        # search lineedit
        self.search_lineedit = lineedit.SearchLineEdit()
        self.search_lineedit.setFixedSize(200, 25)
        _layout.addWidget(self.search_lineedit)

        # refresh button
        self.refresh_button = button.IconButton(
            self, resource.get("icons", "refresh.png"),
            resource.get("icons", "refresh_hover.png"),
            resource.get("icons", "refresh_pressed.png"))
        #self.refresh_button.setText(language.word("refresh"))
        self.refresh_button.setFixedSize(30, 30)
        _layout.addWidget(self.refresh_button)

        #  add line
        _line = QtWidgets.QFrame()
        _line.setMinimumWidth(1)
        _line.setStyleSheet("QFrame{background-color: #E6E7EA}")
        _layout.addWidget(_line)