1
0
Fork 0
phizclip-desktop-demo/examples/qt/demo/finclip-qt-demo.cpp

39 lines
1.1 KiB
C++
Raw Normal View History

2022-04-18 12:05:21 +08:00
#include "finclip-qt-demo.h"
2022-09-22 18:27:19 +08:00
#include <qevent.h>
2022-04-18 12:05:21 +08:00
2022-09-22 18:27:19 +08:00
std::string appid = "";
2022-04-18 12:05:21 +08:00
FinclipQtDemo::FinclipQtDemo(QWidget *parent)
: QMainWindow(parent)
{
2022-09-22 18:27:19 +08:00
this->show();
std::string appkey = "";
std::string secret = "";
std::string domain = "";
std::string app_store = "1";
2023-02-08 16:14:21 +08:00
2022-09-22 18:27:19 +08:00
FinclipParams *config = finclip_create_params();
finclip_params_set(config, FINCLIP_CONFIG_APPSTORE, "1");
finclip_params_set(config, FINCLIP_CONFIG_APPKEY, appkey.c_str());
finclip_params_set(config, FINCLIP_CONFIG_SECRET, secret.c_str());
finclip_params_set(config, FINCLIP_CONFIG_DOMAIN, domain.c_str());
2023-02-08 16:14:21 +08:00
finclip_init_with_config(app_store, config);
2022-09-22 18:27:19 +08:00
auto* params = finclip_create_params();
finclip_params_set(params, "window_type", "1");
finclip_start_applet_embed(app_store.c_str(), appid.c_str(),params, (HWND)this->effectiveWinId());
}
void FinclipQtDemo::resizeEvent(QResizeEvent* event)
{
QMainWindow::resizeEvent(event);
finclip_set_position(appid.c_str(), 0, 0, event->size().height(),event->size().width() );
2022-04-18 12:05:21 +08:00
}
FinclipQtDemo::~FinclipQtDemo()
{
}