refine
This commit is contained in:
21
Classes/AboutDialog.cpp
Normal file
21
Classes/AboutDialog.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "AboutDialog.h"
|
||||
#include <QtWidgets/QDialog>
|
||||
#include <QtWidgets/QtWidgets>
|
||||
|
||||
AboutDialog::AboutDialog(QWidget *parent)
|
||||
: QDialog(parent), ui(new Ui::AboutDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->textEdit->setReadOnly(true);
|
||||
auto w = ui->label->width();
|
||||
auto h = ui->label->height();
|
||||
ui->label->setPixmap(QPixmap(":/Reconstruction/image/common/logo.png").scaled(w, h, Qt::KeepAspectRatio));
|
||||
}
|
||||
|
||||
AboutDialog::~AboutDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void AboutDialog::on_pushButton_clicked() {
|
||||
QDialog::accept();
|
||||
}
|
||||
23
Classes/AboutDialog.h
Normal file
23
Classes/AboutDialog.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "ui_aboutdialog.h"
|
||||
#include <QtWidgets/QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class AboutDialog;
|
||||
}
|
||||
|
||||
class AboutDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AboutDialog(QWidget *parent = Q_NULLPTR);
|
||||
~AboutDialog();
|
||||
|
||||
public slots:
|
||||
void on_pushButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::AboutDialog *ui;
|
||||
};
|
||||
@@ -61,6 +61,12 @@ Reconstruction::Reconstruction(QWidget* parent)
|
||||
#pragma region Style
|
||||
void Reconstruction::setStyle()
|
||||
{
|
||||
QAction* aboutAction = ui.menuBar->addAction(tr("About"), this, SLOT(about()));
|
||||
aboutAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_A));
|
||||
|
||||
QAction* quitAction = ui.menuBar->addAction(tr("Exit"), this, SLOT(close()));
|
||||
quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));
|
||||
|
||||
this->setContentsMargins(0, 0, 0, 0);
|
||||
// this->setFixedSize(1240, 680);
|
||||
// ui.centralWidget->setGeometry(0, 40, 1240, 680);
|
||||
@@ -216,6 +222,7 @@ void Reconstruction::updateQVTK(PointCloud<PointXYZRGB> cloud, QColor color)
|
||||
{
|
||||
boost::shared_ptr<visualization::PCLVisualizer> viewer;
|
||||
visualization::Camera camera;
|
||||
double size = 1;
|
||||
if (PointCloudData::getInstance() != nullptr)
|
||||
{
|
||||
auto pclData = PointCloudData::getInstance();
|
||||
@@ -229,6 +236,7 @@ void Reconstruction::updateQVTK(PointCloud<PointXYZRGB> cloud, QColor color)
|
||||
if(location)
|
||||
{
|
||||
viewer->setCameraParameters(camera);
|
||||
pclData->getViewer()->getPointCloudRenderingProperties(visualization::PCL_VISUALIZER_POINT_SIZE, size, "cloud");
|
||||
}else
|
||||
{
|
||||
location = true;
|
||||
@@ -249,8 +257,7 @@ void Reconstruction::updateQVTK(PointCloud<PointXYZRGB> cloud, QColor color)
|
||||
pclData->setViewer(viewer);
|
||||
pclData->setUI(ui);
|
||||
}
|
||||
double size = 1;
|
||||
viewer->getPointCloudRenderingProperties(visualization::PCL_VISUALIZER_POINT_SIZE, size, "cloud");
|
||||
|
||||
viewer->removeAllPointClouds();
|
||||
if (cloud.size() != 0)
|
||||
{
|
||||
@@ -785,3 +792,13 @@ void Reconstruction::on_pushButton_18_clicked()
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
void Reconstruction::about()
|
||||
{
|
||||
AboutDialog* aboutDialog;
|
||||
aboutDialog = new AboutDialog(this);
|
||||
aboutDialog->setWindowFlags(Qt::Window);
|
||||
aboutDialog->setWindowModality(Qt::ApplicationModal);
|
||||
aboutDialog->setWindowTitle(QString::fromLocal8Bit("关于"));
|
||||
aboutDialog->show();
|
||||
}
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "QVTKWidget.h"
|
||||
#include "vtkRenderWindow.h"
|
||||
#include "Help.h"
|
||||
#include "AboutDialog.h"
|
||||
#include <iostream>
|
||||
#include<vtkAutoInit.h>
|
||||
|
||||
@@ -122,4 +123,5 @@ private slots:
|
||||
void on_pushButton_19_clicked();
|
||||
void setPicAction(QString action);
|
||||
void setCloud();
|
||||
void about();
|
||||
};
|
||||
Reference in New Issue
Block a user