PeriDyno 1.0.0
Loading...
Searching...
No Matches
PLogWidget.h
Go to the documentation of this file.
1/*=========================================================================
2 Program: Log Widget
3 Module: PLogWidget.h
4
5 Copyright (c) Xiaowei He
6 All rights reserved.
7
8 This software is distributed WITHOUT ANY WARRANTY; without even
9 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 PURPOSE. See the above copyright notice for more information.
11=========================================================================*/
12
13#pragma once
14
15#include "Log.h"
16
17#include <QTableWidgetItem>
18
19#include <atomic>
20#include <mutex>
21
22namespace dyno
23{
24 class PLogWidget : public QTableWidget
25 {
26 Q_OBJECT
27
28 public:
29 static PLogWidget* instance();
30
31 QSize sizeHint() const override;
32 int sizeHintForColumn(int column) const override;
33
34 void toggleLogging();
35
36 static void RecieveLogMessage(const Log::Message& m);
37 static void setOutput(std::string filename);
38
39 protected:
40 void contextMenuEvent(QContextMenuEvent* pContextMenuEvent);
41
42 QIcon getIcon(const QString& name);
43
44 public slots:
45 void onPrintMessage(const Log::Message& m);
46 void onClear(void);
47 void onClearAll(void);
48
49 private:
50 PLogWidget(QWidget* pParent = NULL);
51
52 static std::atomic<PLogWidget*> gInstance;
53 static std::mutex gMutex;
54
55 bool mEnableLogging = false;
56 };
57
58}
void contextMenuEvent(QContextMenuEvent *pContextMenuEvent)
static void RecieveLogMessage(const Log::Message &m)
QSize sizeHint() const override
static std::atomic< PLogWidget * > gInstance
Definition PLogWidget.h:52
PLogWidget(QWidget *pParent=NULL)
int sizeHintForColumn(int column) const override
void onPrintMessage(const Log::Message &m)
QIcon getIcon(const QString &name)
void onClear(void)
static void setOutput(std::string filename)
void onClearAll(void)
static std::mutex gMutex
Definition PLogWidget.h:53
static PLogWidget * instance()
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25