ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccCompassInfo.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include "ccCompassInfo.h"
9 
10 #include <QFile>
11 #include <QTextEdit>
12 #include <QTextStream>
13 #include <QVBoxLayout>
14 
15 ccCompassInfo::ccCompassInfo(QWidget *parent) : QDialog(parent) {
16  setFixedSize(800, 600);
17 
18  // setup GUI components
19  QTextEdit *l = new QTextEdit;
20  l->acceptRichText();
21  l->setReadOnly(true);
22 
23  QDialogButtonBox *buttonBox =
24  new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal);
25  connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
26 
27  QVBoxLayout *lt = new QVBoxLayout;
28  lt->addWidget(l);
29  lt->addWidget(buttonBox);
30  setLayout(lt);
31 
32  // load text
33  QFile file(":/CC/plugin/qCompass/info.html");
34  if (file.open(QIODevice::ReadOnly)) {
35  QTextStream in(&file);
36  QString html = in.readAll();
37  l->setText(html);
38  } else {
39  l->setText("Error loading documentation file...");
40  }
41 }
ccCompassInfo(QWidget *parent=nullptr)