open-hyperion/ORGBExamplePlugin.cpp

52 lines
1.2 KiB
C++
Raw Normal View History

2020-12-11 23:53:32 +00:00
#include "ORGBExamplePlugin.h"
#include "Dependencies/ResourceManager.h"
2020-12-11 23:53:32 +00:00
2020-12-17 14:42:24 +00:00
bool ORGBPlugin::HasCustomIcon()
{
return false;
}
2020-12-17 14:42:24 +00:00
QLabel* ORGBPlugin::TabLabel()
{
QLabel *TLabel = new QLabel();
TLabel->setText("Example");
return TLabel;
}
2020-12-17 14:42:24 +00:00
std::string ORGBPlugin::PluginName()
2020-12-11 23:53:32 +00:00
{
return "ExamplePlugin";
}
2020-12-17 14:42:24 +00:00
std::string ORGBPlugin::PluginDesc()
2020-12-12 17:39:01 +00:00
{
return "This is an Example plugin for OpenRGB";
}
2020-12-17 14:42:24 +00:00
std::string ORGBPlugin::PluginLocal()
2020-12-12 17:39:01 +00:00
{
return "InfoTab";
}
2020-12-17 14:42:24 +00:00
QWidget* ORGBPlugin::CreateGUI(QWidget *Parent, ResourceManager *RM)
2020-12-12 17:39:01 +00:00
{
QWidget *ORGBExamplePage = new QWidget(Parent);
QLabel *ORGBExampleLabel = new QLabel(ORGBExamplePage);
QPushButton *ORGBExamplePushButton = new QPushButton(ORGBExamplePage);
qDebug() << ORGBExamplePushButton->objectName();
connect(ORGBExamplePushButton,SIGNAL(clicked()) ,this , SLOT(on_ExampleButton_clicked()));
2020-12-12 17:39:01 +00:00
ORGBExampleLabel->setText("This is an example page added by plugins");
return ORGBExamplePage;
}
void ORGBPlugin::on_ExampleButton_clicked()
{
QDialog *ButtonDialog = new QDialog();
ButtonDialog->setModal(true);
QLabel *DialogText = new QLabel(ButtonDialog);
DialogText->setText("This is the result of the button being clicked");
ButtonDialog->show();
}