open-hyperion/ORGBExamplePlugin.cpp

51 lines
1.4 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-24 14:59:15 +00:00
PluginInfo ORGBPlugin::DefineNeeded()
{
2020-12-24 14:59:15 +00:00
ORGBPlugin::PInfo.PluginName = "Example";
ORGBPlugin::PInfo.PluginDesc = "An example Plugin for OpenRGB";
ORGBPlugin::PInfo.PluginLoca = "InfoTab";
ORGBPlugin::PInfo.HasCustom = false;
ORGBPlugin::PInfo.SettingName = "";
return ORGBPlugin::PInfo;
}
2020-12-24 14:59:15 +00:00
QLabel* TabLabel()
{
QLabel *TLabel = new QLabel();
TLabel->setText("Example");
return TLabel;
}
2020-12-24 14:59:15 +00:00
PluginInfo ORGBPlugin::init(json Settings, bool DarkTheme)
2020-12-11 23:53:32 +00:00
{
2020-12-24 14:59:15 +00:00
ORGBPlugin::PInfo.PluginLabel = TabLabel();
2020-12-11 23:53:32 +00:00
2020-12-24 14:59:15 +00:00
return ORGBPlugin::PInfo;
2020-12-12 17:39:01 +00:00
}
2020-12-24 14:59:15 +00:00
QWidget* ORGBPlugin::CreateGUI(QWidget *Parent)
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();
}