1. 首页
  2. 数据库
  3. SQLite
  4. QT5的SQL数据导入exceldemo

QT5的SQL数据导入exceldemo

上传者: 2018-12-28 17:55:59上传 RAR文件 7.14KB 热度 42次
在qt5下的把excel的内容导入到sql当中MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); qDebug()addAction(openAction) ; oid MainWindow::open_file_func()//从excel中导入到sql中//存入到对应表时,要写相应的表明 { QString filePath =QFileDialog::getOpenFileName(this,"open","../","excel(*.xlsx *.xls)"); if(filePath.isEmpty()==false) { qDebug() 0) { QAxObject *work_sheet = work_book->querySubObject("Sheets(int)", 1); QAxObject *used_range = work_sheet->querySubObject("UsedRange"); QAxObject *rows = used_range->querySubObject("Rows"); QAxObject *columns = used_range->querySubObject("Columns"); int row_count = rows->property("Count").toInt(); //获取行 } QAction *openAction = new QAction(tr("打开(&O)"),this); // QIcon icon(":/image/myimage/fileopen.png") ; // openAction->setIcon(icon); openAction->setShortcut(QKeySequence(tr("ctrl+O"))); ui->menu->addAction(openAction) ; oid MainWindow::open_file_func()//从excel中导入到sql中//存入到对应表时,要写相应的表明 { QString filePath =QFileDialog::getOpenFileName(this,"open","../","excel(*.xlsx *.xls)"); if(filePath.isEmpty()==false) { qDebug() 0) { QAxObject *work_sheet = work_book->querySubObject("Sheets(int)", 1); QAxObject *used_range = work_sheet->querySubObject("UsedRange"); QAxObject *rows = used_range->querySubObject("Rows"); QAxObject *columns = used_range->querySubObject("Columns"); int row_count = rows->property("Count").toInt(); //获取行
下载地址
用户评论