VS+QT+PCL点云窗体程序显示编辑保存

简介: VS+QT+PCL点云窗体程序显示编辑保存
程序示例精选
VS+QT+PCL点云窗体程序显示编辑保存
如需安装运行环境或远程调试,可点击
博主头像进入个人主页查看博主联系方式,由专业技术人员远程协助!

前言

这篇博客针对《VS+QT+PCL点云窗体程序显示编辑保存》编写代码,代码整洁,规则,易读。 学习与应用推荐首选。

运行结果

文章目录

一、所需工具软件
二、使用步骤
3. 主要代码
4. 运行结果
三、在线协助

一、所需工具软件

1. VS2019, C++
2. Yolov8, OpenCV

二、使用步骤

代码如下(示例):

/********************************************************************************
** Form generated from reading UI file 'QtGuiApplication1vznqOM.ui'
**
** Created by: Qt User Interface Compiler version 5.13.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/

#ifndef QTGUIAPPLICATION1VZNQOM_H
#define QTGUIAPPLICATION1VZNQOM_H

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include "QVTKWidget.h"

QT_BEGIN_NAMESPACE

class Ui_QtGuiApplication1Class
{
public:
    QAction *actionOpen;
    QAction *actionClose;
    QWidget *centralWidget;
    QGridLayout *gridLayout;
    QFrame *frame;
    QHBoxLayout *horizontalLayout;
    QPushButton *pushButton_5;
    QPushButton *pushButton_6;
    QSpacerItem *horizontalSpacer_3;
    QFrame *frame_3;
    QVBoxLayout *verticalLayout;
    QPushButton *pushButton;
    QPushButton *pushButton_2;
    QPushButton *pushButton_3;
    QPushButton *pushButton_4;
    QSpacerItem *verticalSpacer_3;
    QFrame *frame_2;
    QGridLayout *gridLayout_2;
    QSpacerItem *verticalSpacer;
    QSpacerItem *horizontalSpacer_2;
    QVTKWidget *qvtkWidget;
    QSpacerItem *horizontalSpacer;
    QSpacerItem *verticalSpacer_2;
    QMenuBar *menuBar;
    QMenu *menuopen;
    QToolBar *mainToolBar;
    QStatusBar *statusBar;

    void setupUi(QMainWindow *QtGuiApplication1Class)
    {
        if (QtGuiApplication1Class->objectName().isEmpty())
            QtGuiApplication1Class->setObjectName(QString::fromUtf8("QtGuiApplication1Class"));
        QtGuiApplication1Class->resize(598, 452);
        actionOpen = new QAction(QtGuiApplication1Class);
        actionOpen->setObjectName(QString::fromUtf8("actionOpen"));
        QFont font;
        font.setFamily(QString::fromUtf8("Calibri"));
        font.setPointSize(16);
        font.setBold(false);
        font.setWeight(50);
        actionOpen->setFont(font);
        actionClose = new QAction(QtGuiApplication1Class);
        actionClose->setObjectName(QString::fromUtf8("actionClose"));
        QFont font1;
        font1.setFamily(QString::fromUtf8("Calibri"));
        font1.setPointSize(16);
        actionClose->setFont(font1);
        centralWidget = new QWidget(QtGuiApplication1Class);
        centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
        gridLayout = new QGridLayout(centralWidget);
        gridLayout->setSpacing(6);
        gridLayout->setContentsMargins(11, 11, 11, 11);
        gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
        frame = new QFrame(centralWidget);
        frame->setObjectName(QString::fromUtf8("frame"));
        QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
        sizePolicy.setHorizontalStretch(0);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(frame->sizePolicy().hasHeightForWidth());
        frame->setSizePolicy(sizePolicy);
        frame->setStyleSheet(QString::fromUtf8("\n"
"background-color: rgb(232, 232, 232);"));
        frame->setFrameShape(QFrame::StyledPanel);
        frame->setFrameShadow(QFrame::Raised);
        horizontalLayout = new QHBoxLayout(frame);
        horizontalLayout->setSpacing(6);
        horizontalLayout->setContentsMargins(11, 11, 11, 11);
        horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
        pushButton_5 = new QPushButton(frame);
        pushButton_5->setObjectName(QString::fromUtf8("pushButton_5"));
        pushButton_5->setLayoutDirection(Qt::LeftToRight);
        pushButton_5->setAutoFillBackground(false);
        pushButton_5->setStyleSheet(QString::fromUtf8(""));
        QIcon icon;
        icon.addFile(QString::fromUtf8(":/QtGuiApplication1/Resources/\346\211\223\345\274\200\346\226\207\344\273\266\345\244\271-\347\273\277\350\211\262.png"), QSize(), QIcon::Normal, QIcon::Off);
        pushButton_5->setIcon(icon);
        pushButton_5->setIconSize(QSize(33, 33));
        pushButton_5->setAutoDefault(false);
        pushButton_5->setFlat(true);

        horizontalLayout->addWidget(pushButton_5);

        pushButton_6 = new QPushButton(frame);
        pushButton_6->setObjectName(QString::fromUtf8("pushButton_6"));
        pushButton_6->setLayoutDirection(Qt::LeftToRight);
        pushButton_6->setAutoFillBackground(false);
        pushButton_6->setStyleSheet(QString::fromUtf8(""));
        QIcon icon1;
        icon1.addFile(QString::fromUtf8(":/QtGuiApplication1/Resources/save.png"), QSize(), QIcon::Normal, QIcon::Off);
        pushButton_6->setIcon(icon1);
        pushButton_6->setIconSize(QSize(33, 33));
        pushButton_6->setAutoDefault(false);
        pushButton_6->setFlat(true);

        horizontalLayout->addWidget(pushButton_6);

        horizontalSpacer_3 = new QSpacerItem(467, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);

        horizontalLayout->addItem(horizontalSpacer_3);


        gridLayout->addWidget(frame, 0, 0, 1, 2);

        frame_3 = new QFrame(centralWidget);
        frame_3->setObjectName(QString::fromUtf8("frame_3"));
        frame_3->setEnabled(true);
        QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Expanding);
        sizePolicy1.setHorizontalStretch(0);
        sizePolicy1.setVerticalStretch(0);
        sizePolicy1.setHeightForWidth(frame_3->sizePolicy().hasHeightForWidth());
        frame_3->setSizePolicy(sizePolicy1);
        frame_3->setStyleSheet(QString::fromUtf8(""));
        frame_3->setFrameShape(QFrame::Box);
        frame_3->setFrameShadow(QFrame::Raised);
        verticalLayout = new QVBoxLayout(frame_3);
        verticalLayout->setSpacing(6);
        verticalLayout->setContentsMargins(11, 11, 11, 11);
        verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
        pushButton = new QPushButton(frame_3);
        pushButton->setObjectName(QString::fromUtf8("pushButton"));
        QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Fixed);
        sizePolicy2.setHorizontalStretch(0);
        sizePolicy2.setVerticalStretch(0);
        sizePolicy2.setHeightForWidth(pushButton->sizePolicy().hasHeightForWidth());
        pushButton->setSizePolicy(sizePolicy2);
        pushButton->setMaximumSize(QSize(16777215, 16777215));
        pushButton->setFont(font1);

        verticalLayout->addWidget(pushButton);

        pushButton_2 = new QPushButton(frame_3);
        pushButton_2->setObjectName(QString::fromUtf8("pushButton_2"));
        sizePolicy2.setHeightForWidth(pushButton_2->sizePolicy().hasHeightForWidth());
        pushButton_2->setSizePolicy(sizePolicy2);
        pushButton_2->setFont(font1);

        verticalLayout->addWidget(pushButton_2);

        pushButton_3 = new QPushButton(frame_3);
        pushButton_3->setObjectName(QString::fromUtf8("pushButton_3"));
        sizePolicy2.setHeightForWidth(pushButton_3->sizePolicy().hasHeightForWidth());
        pushButton_3->setSizePolicy(sizePolicy2);
        pushButton_3->setFont(font1);

        verticalLayout->addWidget(pushButton_3);

        pushButton_4 = new QPushButton(frame_3);
        pushButton_4->setObjectName(QString::fromUtf8("pushButton_4"));
        pushButton_4->setFont(font1);

        verticalLayout->addWidget(pushButton_4);

        verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);

        verticalLayout->addItem(verticalSpacer_3);


        gridLayout->addWidget(frame_3, 1, 0, 1, 1);

        frame_2 = new QFrame(centralWidget);
        frame_2->setObjectName(QString::fromUtf8("frame_2"));
        QSizePolicy sizePolicy3(QSizePolicy::Expanding, QSizePolicy::Expanding);
        sizePolicy3.setHorizontalStretch(0);
        sizePolicy3.setVerticalStretch(0);
        sizePolicy3.setHeightForWidth(frame_2->sizePolicy().hasHeightForWidth());
        frame_2->setSizePolicy(sizePolicy3);
        frame_2->setFrameShape(QFrame::Box);
        frame_2->setFrameShadow(QFrame::Raised);
        gridLayout_2 = new QGridLayout(frame_2);
        gridLayout_2->setSpacing(6);
        gridLayout_2->setContentsMargins(11, 11, 11, 11);
        gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
        verticalSpacer = new QSpacerItem(20, 142, QSizePolicy::Minimum, QSizePolicy::Fixed);

        gridLayout_2->addItem(verticalSpacer, 0, 1, 1, 1);

        horizontalSpacer_2 = new QSpacerItem(150, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);

        gridLayout_2->addItem(horizontalSpacer_2, 1, 0, 1, 1);

        qvtkWidget = new QVTKWidget(frame_2);
        qvtkWidget->setObjectName(QString::fromUtf8("qvtkWidget"));
        sizePolicy3.setHeightForWidth(qvtkWidget->sizePolicy().hasHeightForWidth());
        qvtkWidget->setSizePolicy(sizePolicy3);

        gridLayout_2->addWidget(qvtkWidget, 1, 1, 1, 1);

        horizontalSpacer = new QSpacerItem(150, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);

        gridLayout_2->addItem(horizontalSpacer, 1, 2, 1, 1);

        verticalSpacer_2 = new QSpacerItem(20, 142, QSizePolicy::Minimum, QSizePolicy::Fixed);

        gridLayout_2->addItem(verticalSpacer_2, 2, 1, 1, 1);


        gridLayout->addWidget(frame_2, 1, 1, 1, 1);

        QtGuiApplication1Class->setCentralWidget(centralWidget);
        menuBar = new QMenuBar(QtGuiApplication1Class);
        menuBar->setObjectName(QString::fromUtf8("menuBar"));
        menuBar->setGeometry(QRect(0, 0, 598, 19));
        menuopen = new QMenu(menuBar);
        menuopen->setObjectName(QString::fromUtf8("menuopen"));
        QtGuiApplication1Class->setMenuBar(menuBar);
        mainToolBar = new QToolBar(QtGuiApplication1Class);
        mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
        QtGuiApplication1Class->addToolBar(Qt::TopToolBarArea, mainToolBar);
        statusBar = new QStatusBar(QtGuiApplication1Class);
        statusBar->setObjectName(QString::fromUtf8("statusBar"));
        QtGuiApplication1Class->setStatusBar(statusBar);

        menuBar->addAction(menuopen->menuAction());
        menuopen->addAction(actionOpen);
        menuopen->addAction(actionClose);

        retranslateUi(QtGuiApplication1Class);
        QObject::connect(pushButton, SIGNAL(clicked()), QtGuiApplication1Class, SLOT(onClick()));
        QObject::connect(pushButton_2, SIGNAL(clicked()), QtGuiApplication1Class, SLOT(onColor()));
        QObject::connect(pushButton_3, SIGNAL(clicked()), QtGuiApplication1Class, SLOT(onColor2()));
        QObject::connect(menuBar, SIGNAL(triggered(QAction*)), QtGuiApplication1Class, SLOT(onOpen()));
        QObject::connect(pushButton_4, SIGNAL(clicked()), QtGuiApplication1Class, SLOT(saveFileButtonPressed()));
        QObject::connect(pushButton_5, SIGNAL(clicked()), QtGuiApplication1Class, SLOT(onOpen()));
        QObject::connect(pushButton_6, SIGNAL(clicked()), QtGuiApplication1Class, SLOT(saveFileButtonPressed()));

        QMetaObject::connectSlotsByName(QtGuiApplication1Class);
    } // setupUi

    void retranslateUi(QMainWindow *QtGuiApplication1Class)
    {
        QtGuiApplication1Class->setWindowTitle(QCoreApplication::translate("QtGuiApplication1Class", "QtGuiApplication1", nullptr));
        actionOpen->setText(QCoreApplication::translate("QtGuiApplication1Class", "Open File", nullptr));
        actionOpen->setIconText(QCoreApplication::translate("QtGuiApplication1Class", "open", nullptr));
#if QT_CONFIG(tooltip)
        actionOpen->setToolTip(QCoreApplication::translate("QtGuiApplication1Class", "open", nullptr));
#endif // QT_CONFIG(tooltip)
        actionClose->setText(QCoreApplication::translate("QtGuiApplication1Class", "Close", nullptr));
        pushButton_5->setText(QString());
        pushButton_6->setText(QString());
        pushButton->setText(QCoreApplication::translate("QtGuiApplication1Class", "    Open File    ", nullptr));
        pushButton_2->setText(QCoreApplication::translate("QtGuiApplication1Class", "JiangCai", nullptr));
        pushButton_3->setText(QCoreApplication::translate("QtGuiApplication1Class", "Color-red", nullptr));
        pushButton_4->setText(QCoreApplication::translate("QtGuiApplication1Class", "Save as", nullptr));
        menuopen->setTitle(QCoreApplication::translate("QtGuiApplication1Class", "File", nullptr));
    } // retranslateUi

};

namespace Ui {
    class QtGuiApplication1Class: public Ui_QtGuiApplication1Class {};
} // namespace Ui

QT_END_NAMESPACE

#endif // QTGUIAPPLICATION1VZNQOM_H

运行结果

三、在线协助:

如需安装运行环境或远程调试,可点击博主头像,进入个人主页查看博主联系方式,由专业技术人员远程协助!

1)远程安装运行环境,代码调试
2)Visual Studio, Qt, C++, Python编程语言入门指导
3)界面美化
4)软件制作

博主个人主页:https://developer.aliyun.com/profile/expert/rfnzgp3sk3ahc
博主所有文章点这里:https://developer.aliyun.com/profile/expert/rfnzgp3sk3ahc
博主联系方式点这里:https://developer.aliyun.com/profile/expert/rfnzgp3sk3ahc
相关文章
|
6月前
|
Web App开发 存储 Linux
Linux(33)Rockchip RK3568 Ubuntu22.04上通过SSH运行Qt程序和关闭Chrome的密钥提示
Linux(33)Rockchip RK3568 Ubuntu22.04上通过SSH运行Qt程序和关闭Chrome的密钥提示
452 0
|
4月前
|
Linux iOS开发 开发者
Qt问题(二):无法定位程序输入点于动态链接库
动态链接库(Dynamic Link Library,简称DLL)是一种可执行文件格式,常见于Windows操作系统中,而在Linux和macOS等其他操作系统中,相似的概念通常被称为共享库(Shared Library)。动态链接库允许程序在运行时加载所需的代码和数据,而不是在编译时静态链接到应用程序中。这种方式带来了几个重要的优点:
468 3
|
2月前
|
C语言 Android开发 C++
基于MTuner软件进行qt的mingw编译程序的内存泄漏检测
本文介绍了使用MTuner软件进行Qt MinGW编译程序的内存泄漏检测的方法,提供了MTuner的下载链接和测试代码示例,并通过将Debug程序拖入MTuner来定位内存泄漏问题。
基于MTuner软件进行qt的mingw编译程序的内存泄漏检测
|
6月前
|
开发框架 自然语言处理 Linux
Qt:构建强大跨平台应用程序的框架
Qt:构建强大跨平台应用程序的框架
|
4月前
|
调度
【浅入浅出】Qt多线程机制解析:提升程序响应性与并发处理能力
在学习QT线程的时候我们首先要知道的是QT的主线程,也叫GUI线程,意如其名,也就是我们程序的最主要的一个线程,主要负责初始化界面并监听事件循环,并根据事件处理做出界面上的反馈。但是当我们只限于在一个主线程上书写逻辑时碰到了需要一直等待的事件该怎么办?它的加载必定会带着主界面的卡顿,这时候我们就要去使用多线程。
159 6
|
5月前
Qt MainWindow 程序主窗口
Qt MainWindow 程序主窗口
|
6月前
|
人工智能 编译器 C++
新版Qt6快速打包程序脚本
不知道啥时候Qt更新了,目前是6.7.0,项目默认的生成路径改了, 从 项目目录的同级目录 改为了 项目目录中的build目录, 之前的脚本也用不了了,所以用AI更新了一下脚本, 希望能帮到大家,方便快速打包程序到桌面。
165 9
|
6月前
|
开发框架 Linux C++
Qt:强大的跨平台C++应用程序开发框架
Qt:强大的跨平台C++应用程序开发框架
212 3
|
6月前
|
开发框架 编译器 C++
Qt:一个强大的跨平台C++应用程序开发框架
Qt:一个强大的跨平台C++应用程序开发框架
180 1