Main MRPT website > C++ reference for MRPT 1.9.9
CAboutBoxQt.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "gui-precomp.h" // Precompiled headers
11 
12 #include <mrpt/config.h>
13 #if MRPT_HAS_Qt5
14 
15 #include "CAboutBoxQt.h"
16 #include <QVBoxLayout>
17 #include <QLabel>
18 #include <QTextEdit>
19 #include <QTabWidget>
20 
22  const std::string& appName, const std::string& additionalInfo,
23  const bool showStandardInfo)
24  : CAboutBoxBase(appName, additionalInfo, showStandardInfo)
25 {
26  auto lay = new QVBoxLayout();
27 
28  auto buildText = QString::fromStdString(MRPTBuildVersion());
29  auto label = new QLabel(buildText, this);
30  lay->addWidget(label);
31 
32  auto tabs = new QTabWidget(this);
33 
34  auto infoText = information("Qt", QT_VERSION_STR);
35  tabs->addTab(widgetForTabs(infoText, tabs), tr("Information"));
36  tabs->addTab(widgetForTabs(license(), tabs), tr("License"));
37  tabs->addTab(widgetForTabs(tutorial(), tabs), tr("Tutorial"));
38 
39  lay->addWidget(tabs);
40  setLayout(lay);
41 }
42 
44  const std::string& str, QTabWidget* parent) const
45 {
46  auto text = QString::fromStdString(str);
47  auto action = new QTextEdit(parent);
48  action->setText(text);
49  return action;
50 }
51 
52 #endif // MRPT_HAS_Qt5
CAboutBoxBase
Definition: CAboutBoxBase.h:12
CAboutBoxBase::tutorial
std::string tutorial() const
Definition: CAboutBoxBase.cpp:40
CAboutBoxBase::license
std::string license() const
Definition: CAboutBoxBase.cpp:46
CAboutBoxBase::information
std::string information(const std::string &guiLibName, const std::string &guiLibVersion) const
Definition: CAboutBoxBase.cpp:51
CAboutBoxQt::widgetForTabs
QTextEdit * widgetForTabs(const std::string &str, QTabWidget *parent) const
CAboutBoxQt::CAboutBoxQt
CAboutBoxQt(const std::string &appName, const std::string &additionalInfo, const bool showStandardInfo)
CAboutBoxBase::MRPTBuildVersion
std::string MRPTBuildVersion() const
Definition: CAboutBoxBase.cpp:31
gui-precomp.h
CAboutBoxQt.h
string
GLsizei const GLchar ** string
Definition: glext.h:4101



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST