mirror-chatterino2/src/widgets/helper/DebugPopup.cpp

29 lines
643 B
C++
Raw Normal View History

2018-06-26 14:09:39 +02:00
#include "DebugPopup.hpp"
2018-04-06 16:37:30 +02:00
2018-06-26 14:09:39 +02:00
#include "util/DebugCount.hpp"
2018-04-06 16:37:30 +02:00
#include <QFontDatabase>
#include <QHBoxLayout>
#include <QLabel>
#include <QTimer>
namespace chatterino {
DebugPopup::DebugPopup()
{
auto *layout = new QHBoxLayout(this);
auto *text = new QLabel(this);
auto *timer = new QTimer(this);
timer->setInterval(1000);
QObject::connect(timer, &QTimer::timeout,
2018-06-26 17:06:17 +02:00
[text] { text->setText(DebugCount::getDebugText()); });
2018-04-06 16:37:30 +02:00
timer->start();
text->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
layout->addWidget(text);
}
} // namespace chatterino