48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
#include "QtHeaderPCH.h"
|
|
#include "SimMonitorWidget.h"
|
|
|
|
struct SimMonitorWidget::Impl : public QObject {
|
|
|
|
Impl(QMainWindow* w);
|
|
|
|
|
|
/** 创建主要内容区域*/
|
|
void createContentArea();
|
|
|
|
/** 创建功能区域*/
|
|
void createFunctionArea();
|
|
|
|
/** 创建工具栏*/
|
|
void createToolBar(QWidget* toolBar);
|
|
|
|
/** 创建标签组件并链接到槽 */
|
|
template<typename SlotFunc>
|
|
QPushButton* createLabel(const QString& ico, QWidget* parent, SlotFunc&& slot);
|
|
|
|
/** 创建帧率监控窗口*/
|
|
void createFpsWindow();
|
|
|
|
/** 全局通知消息显示组件 */
|
|
QLabel* m_monitor = nullptr;
|
|
|
|
/** 工具栏*/
|
|
QWidget* m_toolBar = nullptr;
|
|
|
|
/** 主窗口*/
|
|
QMainWindow* m_mainWindow = nullptr;
|
|
|
|
/** 动态功能区域窗口*/
|
|
QWidget* m_monitorWin = nullptr;
|
|
};
|
|
|
|
|
|
template<typename SlotFunc>
|
|
inline QPushButton* SimMonitorWidget::Impl::createLabel(const QString& ico, QWidget* parent, SlotFunc&& slot)
|
|
{
|
|
QPushButton* button = new QPushButton(parent);
|
|
QIcon icon = QIcon(ico);
|
|
button->setIcon(icon);
|
|
button->adjustSize();
|
|
QObject::connect(button, &QPushButton::clicked, this, slot);
|
|
return button;
|
|
} |