LidarView源码分析(三)vvMainWindow类

简介

vvMainWindow是QMainWindow的子类,即该类是一个主界面类。其界面布局是由vvMainWindow.ui定义的,该文件是Qt的界面文件。vvMainWindow界面布局如下图:

QDockWidget能够在QMainWindow内以浮动或者占据指定位置进行显示的窗口控件。在QtDesigner中无法使用无法使用鼠标拖动指定其位置,需要在属性中调整docWidgetArea,进行位置指定。多个QDockWidget重叠在一起会构成标签页。

QTabWidget以选项卡的方式容纳多个界面。

头文件

代码如下:

// Copyright 2013 Velodyne Acoustics, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __vvMainWindow_h
#define __vvMainWindow_h

#include <QMainWindow>


// pqDataRepresentation是用于显示的pqPipelineSource的超类。
// 比如显示代理的输入就是一个pqPiplineSource。
// 该类管理pqPiplineSource和pqDataRepresentation之间的关联。
class pqDataRepresentation;

class vvMainWindow : public QMainWindow
{
  Q_OBJECT
  typedef QMainWindow Superclass;

public:
  vvMainWindow();
  virtual ~vvMainWindow() override;

protected:
  void dragEnterEvent(QDragEnterEvent* evt) override; // 鼠标拖动事件
  void dropEvent(QDropEvent* evt) override;
  void showEvent(QShowEvent* evt) override;
  void closeEvent(QCloseEvent* evt) override; // 窗口关闭事件

protected Q_SLOTS:
  void showHelpForProxy(const QString& proxyname, const QString& groupname);
  void handleMessage(const QString&, int);
  // void showWelcomeDialog();
  // void updateFontSize();

  void toggleMVDecoration(); // Toggle Multiview decorations

private:
  Q_DISABLE_COPY(vvMainWindow)

  class pqInternals; // vvMainWindow.ui中定义的界面类
  pqInternals* Internals;

  // Following Methods should be the same accross LidarView-based Apps
  // Exact elements shared accross apps has not been decided yet,
  // coherence has been improved, but code-duplication remains for more freedom.
  void setupPVGUI();      // Common Parts of the ParaViewMainWindow.cxx
  void pqbuildToolbars(); // Reworked pqParaViewMenuBuilders::buildToolbars helper
  void setupLVGUI();      // Add generally common elements to all LidarView-based apps

  void setupGUICustom(); // LidarView Specific UI elements
  void setBranding();    // LidarView Specific Branding
};

#endif

构造函数

在vvMainWindow的构造函数中进行了一系列的初始化操作:连接服务器,加载python模块,初始化UI界面,创建LidarView管理器,初始化python界面,初始化ParaView基本界面,初始化LidarView基本界面,初始化自定义界面元素,初始化开发者信息。其代码如下:

vvMainWindow::vvMainWindow()
{
  // ParaView Init Start
  // DebugLeaksView MUST be instantiated first
  DebugLeaksViewType* leaksView = nullptr;
  if (vtksys::SystemTools::GetEnv("PV_DEBUG_LEAKS_VIEW"))
  {
    leaksView = new DebugLeaksViewType(this);
    leaksView->setWindowFlags(Qt::Window);
    leaksView->show();
  }

  // Connect to builtin server.
  pqServer* server =
    pqApplicationCore::instance()->getObjectBuilder()->createServer(pqServerResource("builtin:"));
  pqActiveObjects::instance().setActiveServer(server);

  // PVPython
  pvpythonmodules_load();

  // Internals
  this->Internals = new pqInternals();
  this->Internals->setupUi(this); // 初始化界面
  // this->Internals->outputWidgetDock->hide(); // This is default ParaView, we give the App choice
  // first this->Internals->pythonShellDock->hide();  // Kept for reference
  // this->Internals->materialEditorDock->hide();

  // LidarView Specific Manager
  new lqLidarViewManager(this);

  // Create pythonshell
  pqPythonShell* shell = new pqPythonShell(this);
  shell->setObjectName("pythonShell");
  shell->setFontSize(8);
  lqLidarViewManager::instance()->setPythonShell(shell);
  if (leaksView)
  {
    leaksView->setShell(shell);
  }
  // ParaView Init END

  // Setup ParaView  Base GUI
  this->setupPVGUI();

  // Setup LidarView Base GUI
  this->setupLVGUI();

  // LidarView custom GUI
  this->setupGUICustom();

  // LidarView Branding
  this->setBranding();

  // Create Main Render View
  // instance()返回的是lqLidarCoreManager指针
  // lqLidarCoreManager 是 lqLidarViewManager的基类
  lqLidarViewManager::instance()->createMainRenderView();

  // Schedule Python Init late otherwise startup is slow, WIP to investigate (related to window
  // creation timing)
  lqLidarViewManager::instance()->schedulePythonStartup();

  // Force Show App
  this->show();
  this->raise();
  this->activateWindow();

  // pqParaViewBehaviors创建所有ParaView中的行为。
  // 如果程序仅仅是ParaView的一个品牌产品,可以简单的使用其进行配置。
  // 可以在实例化pqParaViewBehaviors前使用
  // 静态函数pqParaViewBehaviors::setEnable<behavior name>(bool)
  // 进行个别行为的开启或关闭。
  // 例如:pqParaViewBehaviors::setEnableStandardPropertyWidgets(false)
  // 具体行为参考pqParaViewBehaviors.h
  new pqParaViewBehaviors(this, this);
}

析构函数

析构函数中删除了界面元素的指针,代码如下:

vvMainWindow::~vvMainWindow()
{
  delete this->Internals;
  this->Internals = NULL;
}

函数setupPVGUI

该函数中初始化了ParaView的相关界面元素,比如QDockWidget的停靠位置,一些常用的工具栏按钮,菜单栏按钮等,具体见以下代码中的注释。

其中pqApplicationCore是ParaView应用程序的关键类。该类创建并管理各种管理器,这些管理器是基于ParaView客户端与服务管理器工作的关键。对于一个基础的pqCore库,初始化顺序为:QApplication初始化之后创建pqApplicationCore,接着创建应用程序的窗口。然后,您可以使用pqCore提供的工具,如pqObjectBuilder、pqUndoStack等。

void vvMainWindow::setupPVGUI()
{
  // Common Parts of the ParaViewMainWindow.cxx
  // Easily updatable and referenceable
  // Common elements to all LidarView-based Apps

  // PARAVIEW_USE_MATERIALEDITOR // Not used

  // show output widget if we received an error message.
  this->connect(this->Internals->outputWidget,
    SIGNAL(messageDisplayed(const QString&, int)),
    SLOT(handleMessage(const QString&, int)));

  // Setup default GUI layout.
  // 左侧QTabWidget的选项卡在上面。
  this->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);
  // 右侧的选项卡在下面。

  // Set up the dock window corners to give the vertical docks more room.
  // 左右两侧的停靠窗口占用竖直方向上的整个主界面
  this->setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
  this->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
  this->setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
  this->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);

  // CUSTOMIZED tabifyDockWidget() / hide() section
  // Easier to understand what is being used

  // Memory Inspector Dock
  // 打开memoryInspectorDock会自动放置在informationDock处,并形成标签页
  this->tabifyDockWidget(this->Internals->informationDock, this->Internals->memoryInspectorDock);
  this->Internals->memoryInspectorDock->hide(); // 默认隐藏

  // View Animation Dock
  this->tabifyDockWidget(this->Internals->informationDock, this->Internals->viewAnimationDock);
  this->Internals->viewAnimationDock->hide();

  // Hide Various Other Docks
  this->Internals->colorMapEditorDock->hide();
  this->Internals->pipelineBrowserDock->hide();
  this->Internals->propertiesDock->hide();
  this->Internals->viewPropertiesDock->hide();
  this->Internals->displayPropertiesDock->hide();
  this->Internals->informationDock->hide();

  // CUSTOMIZED PropertiesPanelMode
  this->Internals->propertiesPanel->setPanelMode(pqPropertiesPanel::SOURCE_PROPERTIES);
  this->Internals->viewPropertiesPanel->setPanelMode(pqPropertiesPanel::VIEW_PROPERTIES);
  this->Internals->displayPropertiesPanel->setPanelMode(pqPropertiesPanel::DISPLAY_PROPERTIES);

  // TODO update UI when font size changes.

  // TODO Enable help from the properties panel.

  /// hook delete to pqDeleteReaction.
  QAction* tempDeleteAction = new QAction(this);
  pqDeleteReaction* handler = new pqDeleteReaction(tempDeleteAction);
  handler->connect(this->Internals->propertiesPanel,
    SIGNAL(deleteRequested(pqProxy*)),
    SLOT(deleteSource(pqProxy*)));

  // setup color editor
  /// Provide access to the color-editor panel for the application.
  pqApplicationCore::instance()->registerManager(
    "COLOR_EDITOR_PANEL", this->Internals->colorMapEditorDock);
  // 自定义程序需要各种管理器。所有的管理器可以通过pqApplicationCore进行注册,并且可以被该程序的其他模块使用。
  // 使用pqApplicationCore进行注册能够很容易的创建这些管理器。
  // 注意,用户程序并不是必须注册管理器。
  // 一些pqCore会导出管理器
  

  // pqTabbedMultiViewWidget用来在tab标签窗口中添加多个pqMultiViewWidget实例
  // 该类会直接监听server-manager来自动为每个已注册的vtkSMViewLayoutProxy创建pqMultiViewWidget实例
  // Set the central widget
  pqTabbedMultiViewWidget* mv = new pqTabbedMultiViewWidget;
  mv->setTabVisibility(false); // 默认隐藏标签栏
  this->setCentralWidget(mv); // 添加到中心显示区域

  // Provide access to the find data panel for the application.
  // pqApplicationCore::instance()->registerManager("FIND_DATA_PANEL",
  // this->Internals->findDataDock); // Unused

  // Populate application menus with actions.
  // pqParaViewMenuBuilders::buildFileMenu(*this->Internals->menu_File); // Advanced Menu
  // pqParaViewMenuBuilders::buildEditMenu(*this->Internals->menu_Edit,
  // this->Internals->propertiesPanel); // Advanced Menu

  // Populate sources menu.
  // 静态函数,自动添加数据源的工具栏按钮
  // 需要传入一个已创建的菜单栏,即this->Internals->menuSources已经完成内存分配。
  pqParaViewMenuBuilders::buildSourcesMenu(*this->Internals->menuSources, this);

  // Populate filters menu.
  // 静态函数,自动添加滤波器的工具栏按钮
  // 需要传入一个已创建的菜单栏
  pqParaViewMenuBuilders::buildFiltersMenu(*this->Internals->menuFilters, this);

  // Populate extractors menu.
  // pqParaViewMenuBuilders::buildExtractorsMenu(*this->Internals->menuExtractors, this); // Unused

  // Populate Tools menu.
  // pqParaViewMenuBuilders::buildToolsMenu(*this->Internals->menuTools); // Advanced Menu

  // Populate Catalyst menu.
  // pqParaViewMenuBuilders::buildCatalystMenu(*this->Internals->menu_Catalyst); // Unused

  // setup the context menu for the pipeline browser.
  // 静态函数,创建管线浏览器的上下文菜单
  pqParaViewMenuBuilders::buildPipelineBrowserContextMenu(
    *this->Internals->pipelineBrowser->contextMenu());

  // CUSTOMIZED Toolbars
  // pqParaViewMenuBuilders::buildToolbars(*this);
  this->pqbuildToolbars(); // 自定义的工具栏生成函数

  // Setup the View menu. This must be setup after all toolbars and dockwidgets
  // have been created.
  // 静态函数,创建View菜单,
  pqParaViewMenuBuilders::buildViewMenu(*this->Internals->menuViews, *this);

  // Setup the menu to show macros.
  // pqParaViewMenuBuilders::buildMacrosMenu(*this->Internals->menu_Macros); // Advanced Menu

  // Setup the help menu.
  // pqParaViewMenuBuilders::buildHelpMenu(*this->Internals->menu_Help); // Custom

  // CUSTOMIZED Paraview behaviors
  // 在new pqParaViewBehaviors(this, this) 前控制程序的一些行为。
  pqParaViewBehaviors::enableApplyBehavior();
  pqParaViewBehaviors::enableAutoLoadPluginXMLBehavior();
  pqParaViewBehaviors::enableCommandLineOptionsBehavior();
  pqParaViewBehaviors::enableCrashRecoveryBehavior();
  pqParaViewBehaviors::enableDataTimeStepBehavior();
  pqParaViewBehaviors::enableLiveSourceBehavior();
  pqParaViewBehaviors::enableObjectPickingBehavior();
  pqParaViewBehaviors::enableQuickLaunchShortcuts();
  pqParaViewBehaviors::enableSpreadSheetVisibilityBehavior();
  pqParaViewBehaviors::enableStandardPropertyWidgets();
  pqParaViewBehaviors::setEnableStandardViewFrameActions(false);
  pqParaViewBehaviors::setEnableDefaultViewBehavior(false);
  pqParaViewBehaviors::setEnableUsageLoggingBehavior(true);
}

其中函数pqbuildToolbars用于生成工具栏上的一些列常用按钮,代码如下:

void vvMainWindow::pqbuildToolbars()
{
  // Rework of pqParaViewMenuBuilders::buildToolbars
  // Removed pqMainControlsToolbar, pqVCRToolbar, pqAnimationTimeToolbar,
  //         pqCustomViewpointsToolbar, pqColorToolbar, pqRepresentationToolbar

  // pqCameraToolbar用于创建观察控制工具栏,比如观察方向,拉近,远离等。
  // pqCameraToolbar的基类为QToolBar
  // << 重载,调用 LHS->setObjectName(RHS.Name) 
  // LHS为模板指针,该实例中为pqCameraToolbar的指针,RHS为pqSetName类的实例,其Name属性即传入参数"cameraToolbar"
  QToolBar* cameraToolbar = new pqCameraToolbar(this) << pqSetName("cameraToolbar");
  this->addToolBar(Qt::TopToolBarArea, cameraToolbar); // 添加工具栏

  // pqAxesToolbar用于创建在视图中心显示的坐标轴的工具栏
  QToolBar* axesToolbar = new pqAxesToolbar(this) << pqSetName("axesToolbar");
  this->addToolBar(Qt::TopToolBarArea, axesToolbar);

  // Give the macros menu to the pqPythonMacroSupervisor
  pqPythonManager* manager =
    qobject_cast<pqPythonManager*>(pqApplicationCore::instance()->manager("PYTHON_MANAGER"));
  if (manager)
  {
    QToolBar* macrosToolbar = new QToolBar("Macros Toolbars", this) << pqSetName("MacrosToolbar");
    macrosToolbar->setVisible(false);
    manager->addWidgetForRunMacros(macrosToolbar);
    this->addToolBar(Qt::TopToolBarArea, macrosToolbar);
  }
}

函数setupLVGUI

该函数中设置了一些和雷达相关的界面元素。

void vvMainWindow::setupLVGUI()
{
  // Add generally common elements to all LidarView-based apps
  // Not necessarilly verbatim Paraview
  // Feel Free to modify this in your LidarView-based app if you really do not like the look

  // Output Window Dock
  this->Internals->outputWidgetDock->setWidget(this->Internals->outputWidget);
  // 将informationDock和outputWidgetDock放在同一位置,形成标签页
  this->tabifyDockWidget(this->Internals->informationDock, this->Internals->outputWidgetDock);
  connect(this->Internals->actionShowErrorDialog,
    SIGNAL(triggered()),
    this->Internals->outputWidgetDock,
    SLOT(show())); // 点击消息框按钮,显示消息框
  this->Internals->outputWidgetDock->hide(); // 消息框默认为隐藏状态

  // Python Shell Dock
  this->Internals->pythonShellDock->setWidget(lqLidarViewManager::instance()->getPythonShell());
  // 将pythonShellDock放在informationDock处,形成标签页
  this->tabifyDockWidget(this->Internals->informationDock, this->Internals->pythonShellDock);
  connect(this->Internals->actionPython_Console,
    SIGNAL(triggered()),
    this->Internals->pythonShellDock,
    SLOT(show()));
  this->Internals->pythonShellDock->hide();

  // Sensor List Dock //wipwip not a core LV element, could also be added in the .ui in internals,
  // like python shell
  QDockWidget* sensorListDock = new QDockWidget("Sensor List", this);
  sensorListDock->setObjectName("sensorListDock");
  sensorListDock->hide();
  sensorListDock->setWidget(lqSensorListWidget::instance());
  this->addDockWidget(Qt::RightDockWidgetArea, sensorListDock);
}

函数setupGUICustom

该函数中设置了重置按钮,帮助按钮以及一些和雷达数据加载播放等相关的按钮。具体见代码中的注释。

void vvMainWindow::setupGUICustom()
{
  // LidarView Specific UI elements

  // WIP TODO actionResetDefaultSettings needs rework
  connect(this->Internals->actionResetDefaultSettings,
    SIGNAL(triggered()),
    lqLidarViewManager::instance(),
    SLOT(onResetDefaultSettings())); // 重置程序

  // Add Professional Support menu action
  // ParaView功能
  // 帮助按钮中的"Professional Support", 打开url地址
  new pqDesktopServicesReaction(
    QUrl("https://www.kitware.com/what-we-offer"), (this->Internals->actionHelpSupport));
  // How to SLAM menu action
  // pqDesktopServicesReaction使用QDesktopServices打开文件或者URL。
  new pqDesktopServicesReaction(
    QUrl("https://gitlab.kitware.com/keu-computervision/slam/-/blob/master/paraview_wrapping/"
         "Plugin/doc/How_to_SLAM_with_LidarView.md"),
    (this->Internals->actionHelpSlam));

  // Enable help from the properties panel.
  QObject::connect(this->Internals->propertiesPanel,
    SIGNAL(helpRequested(const QString&, const QString&)), // 点击帮助按钮时触发
    this,
    SLOT(showHelpForProxy(const QString&, const QString&))); // 显示帮助文档

  // Break ToolBar Lines
  this->addToolBarBreak(); //后续的工具栏添加在下面

  // LidarView-Base Toolbars
  QToolBar* vcrToolbar = new lqPlayerControlsToolbar(this) << pqSetName("Player Control");
  // lqPlayerControlsToolbar中混合了pqVCRToolbar和pqTimAnimationWidget
  // 依靠lqSensorListWidget来禁用“流模式” 
  // 播放控制的一系列按钮,包括前进后退速度进度条等
  this->addToolBar(Qt::TopToolBarArea, vcrToolbar);

  //定位应用程序的界面跟踪器。pqInterfaceTracker用于定位通常从插件加载的所有接口实现。
  pqInterfaceTracker* pgm = pqApplicationCore::instance()->interfaceTracker();
  pgm->addInterface(new lqViewFrameActions);

  // Create RenderView dependant reactions
  // 改变投影类型:透视投影或者平行投影
  new lqCameraParallelProjectionReaction(this->Internals->actionToggleProjection);
  // new pqRenderViewSelectionReaction(this->Internals->actionSelect_Visible_Points, nullptr, // WIP
  //     pqRenderViewSelectionReaction::SELECT_SURFACE_POINTS);
  // pqRenderViewSelectionReaction类实现了渲染窗口的多种选择模式
  // 可以通过创建pqRenderViewSelectionReaction的实例来添加选择模式
  // 此处添加的是选择点的功能
  new pqRenderViewSelectionReaction(this->Internals->actionSelect_Points,
    nullptr,
    pqRenderViewSelectionReaction::SELECT_FRUSTUM_POINTS);

  // LV Reactions
  // 在QDockWidget中打开电子表格。
  new lqDockableSpreadSheetReaction(this->Internals->actionSpreadsheet, this);

  // WIP SETTINGS GRID
  pqSettings* const settings = pqApplicationCore::instance()->settings();
  // 默认显示测量网格,该按钮在Tools菜单栏中
  const QVariant& gridVisible = settings->value("LidarPlugin/MeasurementGrid/Visibility", true);
  this->Internals->actionMeasurement_Grid->setChecked(gridVisible.toBool());
  connect(this->Internals->actionMeasurement_Grid,
    SIGNAL(toggled(bool)),
    lqLidarViewManager::instance(),
    SLOT(onMeasurementGrid(bool)));

  // Ruler Menu
  // 在视图上显示一系列选择以及测量工具
  connect(this->Internals->actionMeasure, SIGNAL(triggered()), this, SLOT(toggleMVDecoration()));
  
  // 打开传感器数据流
  new lqOpenSensorReaction(this->Internals->actionOpen_Sensor_Stream);
  // 打开pcap格式的文件
  new lqOpenPcapReaction(this->Internals->actionOpenPcap);

  // 标定文件 Application/Ui/lqUpdateCaibrationReachtion.h
  new lqUpdateCalibrationReaction(
    this->Internals->actionChoose_Calibration_File); // Requires lqSensorListWidget init

  // Following is required if intend to use the lqSensorListWidget
  // LVCore/Qt/ApplicationComponents/lqSensorListWidget.h
  // lqSensorListWidget能够在sensorlist Dock显示LidarStream或者LidarReader列表。
  // 该窗口管理了一个lqSensorWidget列表。通过(lidarsource添加、删除或者重命名)信号来进行管理。
  // lqSensorListWidget不会管理创建该窗口前已经创建的传感器。
  lqSensorListWidget::instance()->setCalibrationFunction(
    &lqUpdateCalibrationReaction::UpdateExistingSource);

  // 保存雷达数据流,pcap格式
  new lqSaveLidarStateReaction(this->Internals->actionSaveLidarState);
  // 读取雷达数据流,pcap格式
  new lqLoadLidarStateReaction(this->Internals->actionLoadLidarState);

  // 管理LidarView菜单栏files中的最近打开文件。
  // menuRecent_Files是最近打开按钮,actionClear_Menu最近打开按钮中的清楚记录按钮
  new lqOpenRecentFilesReaction(
    this->Internals->menuRecent_Files, this->Internals->actionClear_Menu);

  // Writer reactions (action, writerName, extension, displaySettings, useDirectory,
  // keepNameFromPcapFile, fileNameWithFrameNumber )
  new lqSaveLidarFrameReaction(
    this->Internals->actionSavePCD, "PCDWriter", "pcd", false, false, true, true);
  new lqSaveLidarFrameReaction(
    this->Internals->actionSaveCSV, "DataSetCSVWriter", "csv", false, false, true, true);
  new lqSaveLidarFrameReaction(
    this->Internals->actionSavePLY, "PPLYWriter", "ply", false, false, true, true);
  new lqSaveLASReaction(this->Internals->actionSaveLAS, false, false, true, true);

  // Add save/load lidar state action
  new lqEnableAdvancedArraysReaction(this->Internals->actionEnableAdvancedArrays);

  // Stream AutoColoring
  // lqLiveSourceScalarColoringBehavior用于对雷达数据根据雷达标量值属性分布范围进行颜色渲染。
  new lqLiveSourceScalarColoringBehavior();

  // Advanced Menu
  // build Paraview file menu
  // 在Advance菜单中添加"File(Paraview)"子菜单
  // Advance需要打开Advance Feature选项才能显示
  QMenu* paraviewFileMenu = this->Internals->menuAdvance->addMenu("File (Paraview)");
  pqParaViewMenuBuilders::buildFileMenu(*paraviewFileMenu);
  paraviewFileMenu->setTitle(
    "File (Paraview)"); // for some reason the menu builder rename the QMenu...

  // build Paraview edit menu
  QMenu* paraviewEditMenu = this->Internals->menuAdvance->addMenu("Edit (Paraview)");
  pqParaViewMenuBuilders::buildEditMenu(*paraviewEditMenu);
  paraviewEditMenu->setTitle(
    "Edit (Paraview)"); // for some reason the menu builder rename the QMenu...

  // build Paraview macro menu
  QMenu* paraviewMacroMenu = this->Internals->menuAdvance->addMenu("Macro (Paraview)");
  pqParaViewMenuBuilders::buildMacrosMenu(*paraviewMacroMenu);

  // build Paraview tools menu
  // MUST BE ISNTANTIATED LAST for qtTesting + requires pqTabbedMultiViewWidget
  QMenu* paraviewToolsMenu = this->Internals->menuAdvance->addMenu("Tools (Paraview)");
  pqParaViewMenuBuilders::buildToolsMenu(*paraviewToolsMenu);
  // DO NOT ADD ANYTHING BELOW
}

函数setBranding

// 设置 Reset LidarView setting 和 about LidarView 按钮显示名称
// 以上连个按钮在Help菜单中。
void vvMainWindow::setBranding()
{
// For good measure
#ifndef SOFTWARE_NAME
#error "SOFTWARE_NAME not defined"
#endif
  static_assert(SOFTWARE_NAME, "SOFTWARE_NAME is not defined");

  std::stringstream ss;
  ss << "Reset " << SOFTWARE_NAME << " settings";
  QString text = QString(ss.str().c_str());
  this->Internals->actionResetDefaultSettings->setText(text);
  ss.str("");
  ss.clear();

  ss << "This will reset all " << SOFTWARE_NAME << " settings by default";
  text = QString(ss.str().c_str());
  this->Internals->actionResetDefaultSettings->setIconText(text);
  ss.str("");
  ss.clear();

  ss << "About " << SOFTWARE_NAME;
  text = QString(ss.str().c_str());
  this->Internals->actionAbout_LidarView->setText(text);
  ss.str("");
  ss.clear();
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值