mirror-chatterino2/src/widgets/helper/DebugPopup.cpp
2018-06-26 13:24:55 +02:00

31 lines
695 B
C++

#include "debugpopup.hpp"
#include "util/debugcount.hpp"
#include <QFontDatabase>
#include <QHBoxLayout>
#include <QLabel>
#include <QTimer>
namespace chatterino {
namespace widgets {
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,
[text] { text->setText(util::DebugCount::getDebugText()); });
timer->start();
text->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
layout->addWidget(text);
}
} // namespace widgets
} // namespace chatterino