def __init__(self): QWidget.__init__(self) self.title = u"页面" # Search condition widget self.__wid_search_cond = ViewSearch(def_view_page_def) self.__wid_search_cond.set_col_num(2) self.__wid_search_cond.create() # Column widget self.__wid_page_def = ViewPageDefMag() self.__wid_page_det = ViewPageDetMag() # Bottom layout _layout_bottom = QHBoxLayout() _layout_bottom.addWidget(self.__wid_page_def) _layout_bottom.addWidget(self.__wid_page_det) # Main layout _layout_main = QVBoxLayout() _layout_main.addWidget(self.__wid_search_cond) _layout_main.addLayout(_layout_bottom) _layout_main.setContentsMargins(0, 0, 0, 0) _layout_main.setSpacing(0) self.setLayout(_layout_main) self.__wid_page_def.sig_selected.connect( self.__wid_page_det.set_page_id) self.__wid_page_def.sig_search.connect(self.search_definition) self.__wid_page_def.sig_delete.connect(self.__wid_page_det.clean) self.__wid_page_det.sig_selected[str].connect(self.sig_selected.emit)
def __init__(self): QWidget.__init__(self) self.title = u"执行" # View RunDef self.__wid_run_def = ViewRunDef() # View ReportDet self.__wid_report_det = ViewReportDet() # Search condition widget self.__wid_search_cond = ViewSearch(def_view_run_def) self.__wid_search_cond.create() # 底部 layout _layout_bottom = QSplitter() _layout_bottom.addWidget(self.__wid_run_def) _layout_bottom.addWidget(self.__wid_report_det) # main layout _layout = QVBoxLayout() _layout.addWidget(self.__wid_search_cond) _layout.addWidget(_layout_bottom) _layout.setContentsMargins(0, 0, 0, 0) self.setLayout(_layout) self.__wid_run_def.sig_search.connect(self.search) self.__wid_run_def.sig_selected.connect( self.__wid_report_det.usr_refresh)
def __init__(self, p_type=None): QWidget.__init__(self) self.title = u"选择用例" self.__type = "MULTI" if p_type is None else p_type # Model self.__model = CaseSelModel() self.__model.usr_set_definition(def_view_case_def) if "SINGLE" == self.__type: self.__model.usr_chk_able() # Control _control = CaseSelControl(def_view_case_def) # Search condition widget self.__wid_search_cond = ViewSearch(def_view_case_def) self.__wid_search_cond.set_col_num(2) self.__wid_search_cond.create() # Data result display widget _wid_display = ViewTree() _wid_display.set_model(self.__model) _wid_display.set_control(_control) # Buttons widget if "SINGLE" == self.__type: button_def = [] else: button_def = [dict(id="select", name=u"选择")] button_def.extend([ dict(id="search", name=u"查询"), dict(id="cancel", name=u"取消")]) _wid_buttons = ViewButtons(button_def) # win_add self.__win_add = ViewAdd(def_view_case_def) # Layout _layout = QVBoxLayout() _layout.addWidget(self.__wid_search_cond) _layout.addWidget(_wid_display) _layout.addWidget(_wid_buttons) self.setLayout(_layout) # Connection _wid_buttons.sig_clicked.connect(self.__operate) _wid_display.clicked.connect(self.__model.usr_set_current_data) _wid_display.doubleClicked.connect(self.__select_one)
def __init__(self): QWidget.__init__(self) self.title = u"窗口" # Current window id self.__window_id = None # Model self.__model = WindowModel() self.__model.usr_set_definition(def_view_window_def) # Control _control = WindowControl(def_view_window_def) # Data result display window _wid_display = ViewTable() _wid_display.set_model(self.__model) _wid_display.set_control(_control) # Search condition self.__wid_search_cond = ViewSearch(def_view_window_def) self.__wid_search_cond.set_col_num(3) self.__wid_search_cond.create() # Buttons window _btn_definition = [ dict(id="refresh", name=u'刷新'), dict(id="search", name=u"查询"), dict(id="update", name=u"修改", type="CHECK"), dict(id="delete", name=u"删除") ] _wid_buttons = ViewButtons(_btn_definition) _wid_buttons.align_back() # Layout _layout = QVBoxLayout() _layout.addWidget(self.__wid_search_cond) _layout.addWidget(_wid_display) _layout.addWidget(_wid_buttons) _layout.setContentsMargins(0, 0, 0, 0) self.setLayout(_layout) # Connection _wid_buttons.sig_clicked.connect(self.__operate)
def __init__(self, p_data): QWidget.__init__(self) _batch_no = p_data["no"] self.__batch_id = p_data["id"] self.title = _batch_no # Model self.__model = BatchDetModel() self.__model.usr_set_definition(def_view_batch_det) # Control _control = BatchDetControl(def_view_batch_det) # Search condition widget self.__wid_search_cond = ViewSearch(def_view_batch_det) self.__wid_search_cond.create() # Data result display widget _wid_display = ViewTable() _wid_display.set_model(self.__model) _wid_display.set_control(_control) # Buttons widget _wid_buttons = ViewButtons([ dict(id="add", name=u"增加"), dict(id="delete", name=u"删除"), dict(id="search", name=u"查询") ]) # win_add self.__win_add = ViewCaseSelMag() # Layout _layout = QVBoxLayout() _layout.addWidget(self.__wid_search_cond) _layout.addWidget(_wid_display) _layout.addWidget(_wid_buttons) self.setLayout(_layout) # Connection _wid_buttons.sig_clicked.connect(self.__operate) self.__win_add.sig_selected.connect(self.add)
def __init__(self): QWidget.__init__(self) self.title = u"数据管理" # Model self.__model = DataModel() self.__model.usr_set_definition(def_view_data) # Control _control = DataControl(def_view_data) # Search condition widget self.__wid_search_cond = ViewSearch(def_view_data) self.__wid_search_cond.set_col_num(3) self.__wid_search_cond.create() # Data result display widget _wid_display = ViewTable() _wid_display.set_model(self.__model) _wid_display.set_control(_control) # Buttons widget _wid_buttons = ViewButtons([ dict(id="add", name=u"增加"), dict(id="delete", name=u"删除"), dict(id="update", name=u"修改", type="CHECK"), dict(id="search", name=u"查询") ]) # win_add self.__win_add = ViewAdd(def_view_data) # Layout _layout = QVBoxLayout() _layout.addWidget(self.__wid_search_cond) _layout.addWidget(_wid_display) _layout.addWidget(_wid_buttons) self.setLayout(_layout) # Connection _wid_buttons.sig_clicked.connect(self.__operate) self.__win_add.sig_submit[dict].connect(self.add)
def __init__(self): QWidget.__init__(self) self.title = u"选择用例" # Model self.__model = CaseSelModel() self.__model.usr_set_definition(def_view_case_def) # Control _control = CaseSelControl(def_view_case_def) # Search condition widget self.__wid_search_cond = ViewSearch(def_view_case_def) self.__wid_search_cond.set_col_num(2) self.__wid_search_cond.create() # Data result display widget _wid_display = ViewTree() _wid_display.set_model(self.__model) _wid_display.set_control(_control) # Buttons widget _wid_buttons = ViewButtons([ dict(id="select", name=u"选择"), dict(id="search", name=u"查询"), dict(id="cancel", name=u"取消") ]) # win_add self.__win_add = ViewAdd(def_view_case_def) # Layout _layout = QVBoxLayout() _layout.addWidget(self.__wid_search_cond) _layout.addWidget(_wid_display) _layout.addWidget(_wid_buttons) self.setLayout(_layout) # Connection _wid_buttons.sig_clicked.connect(self.__operate)
def __init__(self): QWidget.__init__(self) # Model self.__model = WidgetSelectModel() self.__model.usr_set_definition(def_view_widget_def) self.__model.usr_chk_able() # Control _control = WidgetSelectControl(def_view_widget_def) # Search condition widget self.__wid_search_cond = ViewSearch(def_view_widget_def) self.__wid_search_cond.set_col_num(2) self.__wid_search_cond.create() # Data result display widget _wid_display = ViewTree() _wid_display.set_model(self.__model) _wid_display.set_control(_control) # Buttons widget _wid_buttons = ViewButtons([dict(id="search", name=u"查询")]) # Layout _layout = QVBoxLayout() _layout.addWidget(self.__wid_search_cond) _layout.addWidget(_wid_display) _layout.addWidget(_wid_buttons) self.setLayout(_layout) # Connection _wid_buttons.sig_clicked.connect(self.__operate) _wid_display.doubleClicked.connect(self.select)
def __init__(self): QWidget.__init__(self) self.title = u"计划管理" self.__service = BatchDefService() # Model self.__model = BatchDefModel() self.__model.usr_set_definition(def_view_batch_def) # Control _control = BatchDefControl(def_view_batch_def) # Search condition widget self.__wid_search_cond = ViewSearch(def_view_batch_def) self.__wid_search_cond.create() # Data result display widget _wid_display = ViewTree() _wid_display.set_model(self.__model) _wid_display.set_control(_control) # Context menu _wid_display.create_context_menu([ dict(NAME=u"增加", STR="sig_add"), dict(NAME=u"删除", STR="sig_del"), dict(NAME=u"增加数据", STR="sig_data"), dict(NAME=u"添加至运行", STR="sig_run") ]) # Buttons widget _wid_buttons = ViewButtons([ dict(id="add", name=u"增加"), dict(id="delete", name=u"删除"), dict(id="update", name=u"修改", type="CHECK"), dict(id="search", name=u"查询") ]) # win_add self.__win_add = ViewAdd(def_view_batch_def) # win add data self.__win_data = ViewDataAdd() # Layout _layout = QVBoxLayout() _layout.addWidget(self.__wid_search_cond) _layout.addWidget(_wid_display) _layout.addWidget(_wid_buttons) self.setLayout(_layout) # Connection _wid_buttons.sig_clicked.connect(self.__operate) self.__win_add.sig_submit[dict].connect(self.add) _wid_display.doubleClicked[QModelIndex].connect(self.__batch_detail) _wid_display.sig_context.connect(self.__context) # 右键菜单 _wid_display.clicked.connect(self.__model.usr_set_current_data)
def __init__(self, p_type=None): """ 支持选择类型,选择时按钮/查询条件/查询方式都有不同 :param p_type: :return: """ QWidget.__init__(self) self.__type = p_type # Model self.__model = WidgetDefModel() self.__model.usr_set_definition(def_view_widget_def) # Control _control = WidgetDefControl(def_view_widget_def) # Search if self.__type is not None: self.__wid_search_cond = ViewSearch(def_view_widget_def) self.__wid_search_cond.set_col_num(2) self.__wid_search_cond.create() else: self.__wid_search_cond = None # Data result display widget _wid_display = ViewTree() _wid_display.set_model(self.__model) _wid_display.set_control(_control) # Buttons window btn_definition = [] if self.__type is None: btn_definition.append(dict(id="add", name=u'增加')), btn_definition.append(dict(id="delete", name=u"删除")) btn_definition.append(dict(id="update", name=u"修改", type="CHECK")) btn_definition.append(dict(id="search", name=u"查询")) _wid_buttons = ViewButtons(btn_definition) _wid_buttons.align_back() # win_add self.__win_add = ViewAdd(def_view_widget_def) # Layout _layout = QVBoxLayout() if self.__type is not None: _layout.addWidget(self.__wid_search_cond) _layout.addWidget(_wid_display) _layout.addWidget(_wid_buttons) _layout.setContentsMargins(0, 0, 0, 0) self.setLayout(_layout) # connection self.__win_add.sig_submit[dict].connect(self.add) _wid_buttons.sig_clicked.connect(self.__operate) if self.__type is None: _wid_display.clicked[QModelIndex].connect(self.__widget_detail) else: _wid_display.doubleClicked[QModelIndex].connect( self.__widget_detail)