open-hyperion/ORGBExamplePlugin.cpp

52 lines
1.3 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
bool ORGBPlugin::HasCustomIcon() const
{
return false;
}
QLabel* ORGBPlugin::TabLabel() const
{
QLabel *TLabel = new QLabel();
TLabel->setText("Example");
return TLabel;
}
2020-12-11 23:53:32 +00:00
std::string ORGBPlugin::PluginName() const
{
return "ExamplePlugin";
}
2020-12-12 17:39:01 +00:00
std::string ORGBPlugin::PluginDesc() const
{
return "This is an Example plugin for OpenRGB";
}
std::string ORGBPlugin::PluginLocal() const
{
return "InfoTab";
}
QWidget* ORGBPlugin::CreateGUI(QWidget *Parent, ResourceManager *RM) const
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();
}