当前位置: 首页 > news >正文

建网站大公司销售手机网站的后期安排

建网站大公司,销售手机网站的后期安排,做网站还挣钱吗,wordpress get_user_meta一、介绍 首先#xff0c;QT界面开发中主要大体分为2种多窗口的形式#xff1a; 嵌入式#xff1a; 新生成的窗口嵌入在主窗口内部独立窗口#xff1a; 以弹窗形式的新窗口生成和展示 这里就讲解最简单的#xff1a;点击案件后#xff0c;跳出一个新窗口 二、代码实…一、介绍 首先QT界面开发中主要大体分为2种多窗口的形式 嵌入式 新生成的窗口嵌入在主窗口内部独立窗口 以弹窗形式的新窗口生成和展示 这里就讲解最简单的点击案件后跳出一个新窗口 二、代码实现 要在Qt C中实现点击按钮后显示新窗口并在新窗口中显示由主程序生成的图片你需要创建两个窗口类主窗口类和图片显示窗口类。下面是一个简单的示例展示了如何实现这一功能 创建一个新的Qt Widgets Application。 添加两个窗口类一个是主窗口类 MainWindow另一个是显示图片的窗口类 ImageWindow。 一般用vs2019开发创建Qt Widgets Application之后会自带一个和项目名同名的主窗口类。这个时候需要手动创建另外一个即新窗口类。创建方法可以参考这篇博客Qt5.12.6 VS2019 点击按钮弹出新窗口 首先是 ImageWindow 类的实现假设图片使用 QLabel 来显示 imagewindow.h: #ifndef IMAGEWINDOW_H #define IMAGEWINDOW_H#include QWidget #include QLabelclass ImageWindow : public QWidget {Q_OBJECTpublic:explicit ImageWindow(QWidget *parent nullptr);void displayImage(const QPixmap pixmap);private:QLabel *imageLabel;};#endif // IMAGEWINDOW_Himagewindow.cpp: #include imagewindow.h #include QVBoxLayoutImageWindow::ImageWindow(QWidget *parent) : QWidget(parent) {imageLabel new QLabel;QVBoxLayout *layout new QVBoxLayout(this);layout-addWidget(imageLabel);setLayout(layout); }void ImageWindow::displayImage(const QPixmap pixmap) {imageLabel-setPixmap(pixmap); }然后是主窗口类 MainWindow当点击按钮时将创建图片显示窗口的实例并显示图片 mainwindow.h: #ifndef MAINWINDOW_H #define MAINWINDOW_H#include QMainWindow #include QPushButton #include imagewindow.hclass MainWindow : public QMainWindow {Q_OBJECTpublic:MainWindow(QWidget *parent nullptr);private slots:void on_showImageButton_clicked();private:QPushButton *showImageButton;ImageWindow *imageWindow; };#endif // MAINWINDOW_Hmainwindow.cpp: #include imagewindow.hImageWindow::ImageWindow(QWidget *parent) : QWidget(parent) {imageLabel new QLabel(this); // 使用 this 作为父对象初始化 QLabelQVBoxLayout *layout new QVBoxLayout(this);layout-addWidget(imageLabel);setLayout(layout); }void ImageWindow::displayImage(const QPixmap pixmap) {imageLabel-setPixmap(pixmap); }三、实战经验分享 这里我的项目的情况是 主窗口的cpp文件new_QT_python.cpp中主要运行项目主体代码其中开设子线程视频检测线程会把事实的检测结果以图片的形式传回主线程需求当按下开始检测的按钮后立即弹出新窗口将主线程主窗口中接受到检测线程传过来的结果图片在新窗口中进行显示。 Tips:为了突出多窗口的实现省略了与此无关的代码 new_QT_python.h: #include QtWidgets/QMainWindow #include ui_new_QT_python.h #include opencv2/opencv.hpp #include DetectionWindow.h //#include inference.h#pragma execution_character_set(utf-8) #ifdef Q_OS_WIN #pragma execution_character_set(utf-8) //解决 VS编译器下中文乱码 #endifclass new_QT_python : public QMainWindow {Q_OBJECTpublic:new_QT_python(QWidget *parent nullptr);~new_QT_python(); private:Ui::new_QT_pythonClass ui;VideoDetectionWorker m_detectionWorker1;QThread m_detectionThread1;DetectionWindow *imageWindow;private slots:void onDetectionResult1(const QImage img);}; new_QT_python.cpp: #include new_QT_python.h #include QTimer.h #include QFileDialog #include iostream #include iomanip #include filesystem #include fstream #include random #include iostream #include vector #include opencv2/opencv.hpp #include DetectionWindow.h#pragma execution_character_set(utf-8) #ifdef Q_OS_WIN #pragma execution_character_set(utf-8) //解决 VS编译器下中文乱码 #endif#define ORT_API_MANUAL_INITnew_QT_python::new_QT_python(QWidget *parent): QMainWindow(parent) {ui.setupUi(this);// 连接子线程的检测结果信号connect(m_detectionWorker1, VideoDetectionWorker::detectionResult, this, new_QT_python::onDetectionResult1);imageWindow new DetectionWindow; // Create the image window but dont show it yet// 将自定义线程对象移动到子线程中m_detectionWorker1.moveToThread(m_detectionThread1); }new_QT_python::~new_QT_python() {m_detectionThread1.quit();m_detectionThread1.wait(); }void new_QT_python::onStartDetectionClicked() {//显示检测过程的窗口imageWindow-show();// 启动子线程m_detectionThread1.start();// 检查子线程是否成功启动if (m_detectionThread1.isRunning()){// 子线程已成功启动// 在这里添加你的逻辑ui.status-setText( m_detectionThread1 OK);}// 保存视频路径到子线程对象的成员变量m_detectionWorker1.m_videoPath videoPath1;// 向子线程发送开始检测的信号QMetaObject::invokeMethod(m_detectionWorker1, startDetection, Qt::QueuedConnection);// 禁用按钮ui.startToDetect-setEnabled(false); }void new_QT_python::onDetectionResult1(const QImage img) {imageWindow-displayImage(img); } DetectionWindow.h #pragma once#include QMainWindow #include ui_DetectionWindow.hclass DetectionWindow : public QMainWindow {Q_OBJECTpublic:DetectionWindow(QWidget *parent nullptr);void displayImage(const QImage img);~DetectionWindow();private:Ui::DetectionWindowClass ui; }; DetectionWindow.cpp #include DetectionWindow.h #include QVBoxLayoutDetectionWindow::DetectionWindow(QWidget *parent): QMainWindow(parent) { ui.setupUi(this); } void DetectionWindow::displayImage(const QImage img) {//使图片能和label尺寸相适应ui.imageLabel-setPixmap(QPixmap::fromImage(img).scaled(ui.imageLabel-size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));ui.imageLabel-setAlignment(Qt::AlignCenter); } DetectionWindow::~DetectionWindow() {}四、结果展示 点击“开始检测”按钮触发void new_QT_python::onStartDetectionClicked()函数检测子线程启动像主线程发送图片结果信号onDetectionResult1函数负责让子窗口对象将图片在其窗口内展示。
http://www.hkea.cn/news/14449541/

相关文章:

  • 完整版网站推广方案垦利县企业型网站建设
  • 哪个视频网站做视频最赚钱的建筑用木模板的规格与价格
  • 网站服务器迁移wordpress默认导航栏
  • 深一互联网站建设怎样用rp怎么做网站导航菜单
  • 台州英文网站建设广告企业网站源码
  • 网站界面友好机械加工网免费铺货
  • 徐州做网站的公司招聘免费企业邮箱注册怎么注册
  • 网站访问量 wordpressWordPress vidropro
  • 创意网站页面模板网站建设开发
  • 用商城系统做教育网站泰安中呼网站建设有限公司 概况
  • 百度网站排名全掉怎么使用微wordpress
  • 网站建设信息介绍庆阳市住房和城乡建设局网站
  • pycharm 做网站哪个好受欢迎的合肥网站建设
  • 网站建设的资源整合与系统设计徐州微网站开发
  • 做网站的没有进项票怎么办wordpress结婚模板
  • 苏州公司做变更网站如何开发游戏软件
  • 杭州网站建设制作公司wordpress主题 机械
  • 做汽车养护的网站途牛旅行网站建设策划书
  • 网络服务都有哪些上海优化外包公司
  • 新建网站的评估工业和信息化部产业发展促进中心
  • 东莞app制作公司seo营销排名
  • 对于高校类建设网站的要求做淘宝券网站
  • 大学什么专业做网站旅游网站国内外研究现状
  • 如何把代码放在网站首页教程牡丹江制作网站
  • 官方网站建设专家磐石网络广东seo站外推广折扣
  • 做网站销售有前景网络设计山西分公司
  • 建设工程检测预约网站网站建站公司订单多吗
  • 中关村网站建设的公司桂林亿星网络科技公司
  • 青岛正规网站建设哪家好怎么做租号网站
  • 吴中区建设局网站电子商务网站规划与建设试题