fix
parent
85f5932796
commit
546a2db848
|
@ -1,8 +1,37 @@
|
|||
#include "finclip-qt-demo.h"
|
||||
#include <qevent.h>
|
||||
|
||||
std::string appid = "";
|
||||
FinclipQtDemo::FinclipQtDemo(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
this->show();
|
||||
std::string appkey = "";
|
||||
std::string secret = "";
|
||||
std::string domain = "";
|
||||
|
||||
std::string app_store = "1";
|
||||
auto *factory = finclip_get_packer_factory();
|
||||
auto *packer = finclip_packer_factory_get_config_packer(factory);
|
||||
finclip_initialize(packer);
|
||||
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());
|
||||
finclip_config_packer_add_config(packer, config);
|
||||
|
||||
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() );
|
||||
|
||||
}
|
||||
|
||||
FinclipQtDemo::~FinclipQtDemo()
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define FINCLIPQTDEMO_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include "finclip_api.h"
|
||||
|
||||
class FinclipQtDemo : public QMainWindow
|
||||
{
|
||||
|
@ -10,5 +11,7 @@ class FinclipQtDemo : public QMainWindow
|
|||
public:
|
||||
FinclipQtDemo(QWidget *parent = nullptr);
|
||||
~FinclipQtDemo();
|
||||
private:
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
};
|
||||
#endif // FINCLIPQTDEMO_H
|
||||
|
|
|
@ -1,27 +1,11 @@
|
|||
#include "finclip-qt-demo.h"
|
||||
#include "finclip_api.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
std::string appkey = "";
|
||||
std::string secret = "";
|
||||
std::string domain = "";
|
||||
std::string app_store = "1";
|
||||
|
||||
auto *factory = finclip_get_packer_factory();
|
||||
auto *packer = finclip_packer_factory_get_config_packer(factory);
|
||||
finclip_initialize(packer);
|
||||
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());
|
||||
finclip_config_packer_add_config(packer, config);
|
||||
|
||||
finclip_start_applet(app_store.c_str(), "");
|
||||
FinclipQtDemo w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
|
|
Loading…
Reference in New Issue