ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
thread_control_widget.h
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 #pragma once
9 
10 #include <QtCore>
11 #include <QtWidgets>
12 
13 #include "util/threading.h"
14 
15 namespace colmap {
16 
17 class ThreadControlWidget : public QWidget {
18 public:
19  explicit ThreadControlWidget(QWidget* parent);
20 
21  void StartThread(const QString& progress_text,
22  const bool stoppable,
23  Thread* thread);
24  void StartFunction(const QString& progress_text,
25  const std::function<void()>& func);
26 
27 private:
28  QProgressDialog* progress_bar_;
29  QAction* destructor_;
30  std::unique_ptr<Thread> thread_;
31 };
32 
33 } // namespace colmap
void StartThread(const QString &progress_text, const bool stoppable, Thread *thread)
void StartFunction(const QString &progress_text, const std::function< void()> &func)