QT dialog一种使用方法
来源:互联网 发布:中国狙击步枪 知乎 编辑:程序博客网 时间:2024/06/13 23:55
// 导出视频片段void extractTrajectoryWidget::exportAviSegment(){//设计一个弹出widget,包括内容:导出名称,存储路径(可选择)QDialog*dialog = new QDialog(this);dialog->window()->setWindowTitle(QStringLiteral("导出配置"));QLineEdit* aviFileNameLineEdit = new QLineEdit;// 导出视频片段保存路径/*QLineEdit**/aviFilePathLineEdit = new QLineEdit;// 设置为成员函数,为了槽能够操作这个变量aviFilePathLineEdit->setText(pGparam->synVideoPath.c_str());QPushButton*selectPathButton = new QPushButton(QStringLiteral("选择"));connect(selectPathButton,SIGNAL(clicked()),this,SLOT(selectSavePath()));{QVBoxLayout* v11Layout = new QVBoxLayout;v11Layout->addWidget(new QLabel(QStringLiteral("保存文件名:")));v11Layout->addWidget(new QLabel(QStringLiteral("存储路径:")));QVBoxLayout* v12Layout = new QVBoxLayout;v12Layout->addWidget(aviFileNameLineEdit);v12Layout->addWidget(aviFilePathLineEdit);QVBoxLayout* v13Layout = new QVBoxLayout;v13Layout->addWidget(new QLabel(QStringLiteral(".avi")));v13Layout->addWidget(selectPathButton);QHBoxLayout* h11Layout =new QHBoxLayout;h11Layout->addLayout(v11Layout);h11Layout->addLayout(v12Layout);h11Layout->addLayout(v13Layout);QHBoxLayout* h12Layout = new QHBoxLayout;QPushButton* okButton =new QPushButton(QStringLiteral("确定"));QPushButton* cancelButton = new QPushButton(QStringLiteral("取消"));connect(okButton,SIGNAL(clicked()),dialog,SLOT(accept()));connect(cancelButton,SIGNAL(clicked()),dialog,SLOT(reject()));h12Layout->addStretch();h12Layout->addWidget(okButton);h12Layout->addWidget(cancelButton);h12Layout->addSpacing(10);QVBoxLayout* v21Layout = new QVBoxLayout;v21Layout->addLayout(h11Layout);v21Layout->addLayout(h12Layout);v21Layout->addStretch();dialog->setLayout(v21Layout);}int ret = dialog->exec();if(ret ==QDialog::Accepted ){qDebug()<<"Qdialog accepted" <<ret;}else{qDebug()<<"operate " <<ret;}// 根据widget内容来导出}
bool video::exportSrcSegment( string fileName ){if(!aviLocation(m_playIndex)){return false;}cv::VideoWriter videoWriter;videoWriter.open(fileName,CV_FOURCC('D', 'I', 'V', 'X'),25.0,cv::Size(m_width,m_height),true);if (!videoWriter.isOpened()){return false;}Mat frame;for (int i=0;i< m_eventObj[m_playIndex].m_BlobList.size();i++){m_capture >> frame;videoWriter.write(frame);}videoWriter.release();return true;}
0 0
- QT dialog一种使用方法
- qt-dialog
- Qt Dialog
- Dialog 基础的使用方法
- Dialog 使用方法详解
- Android--Dialog,Dialog 的几种使用方法
- android中dialog(自定义dialog)的使用方法!!!
- QT: sort dialog
- QT widgets dialog
- Qt学习之Dialog
- Qt dialog 对话框
- QT dialog 模态
- QT之对话框Dialog
- dockPanel一种使用方法
- goroutine的一种使用方法
- semaphore的一种使用方法
- WebView的一种使用方法
- ResourceBundle 的一种使用方法
- gcc的__builtin_函数介绍
- chromium浏览器开发系列第二篇:如何编译最新chromium
- 关于NSRunLoop和NSTimer的深入理解
- 打造属于自己的安卓Metro界面
- 斯坦福机器学习实现与分析之二(线性回归)
- QT dialog一种使用方法
- 蓝桥杯 分糖果
- 最新版本Spring、Hibernate、Struts框架整合 (2014-10-26 20:22:09)
- 策略模式
- Symmetric Tree--LeetCode
- 【设计模式之三:模式对比】外观模式、代理模式与中介者模式的区别
- 说说js的==运算符和if语句
- MySQL学习笔记———《数据库操作》
- 第二章15题