1 Star 0 Fork 2

尘年灬往事 / smart-community

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
base_manage_widget.cpp 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
#include <QHeaderView>
#include <QApplication>
#include <QMessageBox>
#include "base_manage_widget.h"
BaseManageWidget::BaseManageWidget(QWidget *parent) :
QWidget(parent)
{
q_model=new QSqlQueryModel;
layout=new QVBoxLayout(this);
b_btn_1=new QPushButton;
b_btn_2=new QPushButton;
b_btn_3=new QPushButton;
b_layout=new QHBoxLayout;
tableView=new QTableView;
layout->addWidget(tableView);
layout->addLayout(b_layout);
}
void BaseManageWidget::load(const QString &queryStr){
q_model->setQuery(queryStr);
tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
tableView->setModel(q_model);
}
void BaseManageWidget::setMajorKey(QString &key){
int rowNum=tableView->currentIndex().row();
QAbstractItemModel *qaim = tableView->model();
QModelIndex qmi=qaim->index(rowNum,0);
QVariant qv=qaim->data(qmi);
key=qv.toString();
}
void BaseManageWidget::init(){}
void BaseManageWidget::add(){}
void BaseManageWidget::edit(){}
void BaseManageWidget::detail(){}
BaseManageWidget::~BaseManageWidget()
{
//delete ui;
}
1
https://gitee.com/mikema_138/smart-community.git
git@gitee.com:mikema_138/smart-community.git
mikema_138
smart-community
smart-community
master

搜索帮助