qt demo
parent
1b6bba38e9
commit
b9dd4df40c
|
@ -76,7 +76,7 @@
|
|||
|---|---|---|---|---|---|
|
||||
| C++ | win32 | 测试中 | Windows | [win32](examples/win32) | 无 |
|
||||
| Python | pyqt 5 | 开发中 | Windows / Mac | [Pyqt](examples/pyqt) | |
|
||||
| JavaScript | Electron | 测试中 | Windows | [Electron](examples/electron) | [node](https://github.com/finogeeks/finclip-win32-demo/releases) |
|
||||
| JavaScript | Electron | 测试中 | Windows | [Electron](examples/electron) | [node](https://github.com/finogeeks/finclip-desktop-demo/releases) |
|
||||
|
||||
## DEMO 运行与 SDK 集成说明
|
||||
|
||||
|
|
|
@ -35,4 +35,4 @@ flowchart LR
|
|||
|
||||
参见首页表格
|
||||
|
||||
https://github.com/finogeeks/finclip-win32-demo
|
||||
https://github.com/finogeeks/finclip-desktop-demo
|
|
@ -1,3 +1,16 @@
|
|||
# 集成步骤
|
||||
|
||||
## 第一步: 📦 下载依赖
|
||||
|
||||
选择对应的release包, 并解压至指定位置
|
||||
```
|
||||
以win x64为例:
|
||||
[下载finclip二进制包](https://github.com/finogeeks/finclip-desktop-demo/releases)到`vendor`的对应目录下,如`vendor/win/x64`
|
||||
```
|
||||
|
||||
|
||||
# 基本功能介绍
|
||||
|
||||
此处展示各种语言集成finclip的demo, 每个demo应完整的包含以下功能:
|
||||
|
||||
- 启动finclip
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# finclip-electron-demo
|
||||
|
||||
## 📦 安装第三方依赖
|
||||
## 通用步骤与功能介绍
|
||||
|
||||
[下载finclip二进制包](https://github.com/finogeeks/finclip-win32-demo/releases)到`vendor`的对应目录下,如`vendor/win/x64`
|
||||
快速开始前请先阅读以下链接
|
||||
|
||||
[Finclip桌面版Demo简介](https://github.com/finogeeks/finclip-desktop-demo/tree/master/examples)
|
||||
|
||||
## 快速开始
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
build-demo*
|
|
@ -0,0 +1,10 @@
|
|||
# 通用步骤与功能介绍
|
||||
|
||||
快速开始前请先阅读以下链接
|
||||
|
||||
[Finclip桌面版Demo简介](https://github.com/finogeeks/finclip-desktop-demo/tree/master/examples)
|
||||
|
||||
|
||||
# 快速开始
|
||||
|
||||
1. 使用qt creator打开 demo文件夹
|
|
@ -0,0 +1,73 @@
|
|||
# This file is used to ignore files which are generated
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
*~
|
||||
*.autosave
|
||||
*.a
|
||||
*.core
|
||||
*.moc
|
||||
*.o
|
||||
*.obj
|
||||
*.orig
|
||||
*.rej
|
||||
*.so
|
||||
*.so.*
|
||||
*_pch.h.cpp
|
||||
*_resource.rc
|
||||
*.qm
|
||||
.#*
|
||||
*.*#
|
||||
core
|
||||
!core/
|
||||
tags
|
||||
.DS_Store
|
||||
.directory
|
||||
*.debug
|
||||
Makefile*
|
||||
*.prl
|
||||
*.app
|
||||
moc_*.cpp
|
||||
ui_*.h
|
||||
qrc_*.cpp
|
||||
Thumbs.db
|
||||
*.res
|
||||
*.rc
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
|
||||
# qtcreator generated files
|
||||
*.pro.user*
|
||||
|
||||
# xemacs temporary files
|
||||
*.flc
|
||||
|
||||
# Vim temporary files
|
||||
.*.swp
|
||||
|
||||
# Visual Studio generated files
|
||||
*.ib_pdb_index
|
||||
*.idb
|
||||
*.ilk
|
||||
*.pdb
|
||||
*.sln
|
||||
*.suo
|
||||
*.vcproj
|
||||
*vcproj.*.*.user
|
||||
*.ncb
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.vcxproj
|
||||
*vcxproj.*
|
||||
|
||||
# MinGW generated files
|
||||
*.Debug
|
||||
*.Release
|
||||
|
||||
# Python byte code
|
||||
*.pyc
|
||||
|
||||
# Binaries
|
||||
# --------
|
||||
*.dll
|
||||
*.exe
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# You can make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
finclip-qt-demo.cpp
|
||||
|
||||
HEADERS += \
|
||||
finclip-qt-demo.h
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
win32 {
|
||||
contains(QMAKE_TARGET.arch, x86_64) {
|
||||
message("x86_64 build")
|
||||
## Windows x64 (64bit) specific build here
|
||||
LIBS += "../../../vendor/win/x64/FinClipSDKWrapper.lib"
|
||||
INCLUDEPATH += "../../../src"
|
||||
QMAKE_POST_LINK=robocopy ../../../vendor/win/x64 . /E
|
||||
} else {
|
||||
message("x86 build")
|
||||
## Windows x86 (32bit) specific build here
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
#include "finclip-qt-demo.h"
|
||||
|
||||
FinclipQtDemo::FinclipQtDemo(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
}
|
||||
|
||||
FinclipQtDemo::~FinclipQtDemo()
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef FINCLIPQTDEMO_H
|
||||
#define FINCLIPQTDEMO_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
class FinclipQtDemo : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FinclipQtDemo(QWidget *parent = nullptr);
|
||||
~FinclipQtDemo();
|
||||
};
|
||||
#endif // FINCLIPQTDEMO_H
|
|
@ -0,0 +1,30 @@
|
|||
#include "finclip-qt-demo.h"
|
||||
#include "finclip_api.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
std::string appkey = "22LyZEib0gLTQdU3MUauAQVLIkNNhTSGIN42gXzlAsk=";
|
||||
std::string secret = "ae55433be2f62915";
|
||||
std::string domain = "https://finchat-mop-b.finogeeks.club:443";
|
||||
int app_store = 1;
|
||||
|
||||
auto* factory = finclip_get_packer_factory();
|
||||
auto* packer = finclip_packer_factory_get_config_packer(factory);
|
||||
auto* config = finclip_config_packer_new_config(packer);
|
||||
finclip_config_packer_add_config(packer, config);
|
||||
finclip_config_set_app_store(config, app_store);
|
||||
finclip_config_set_app_key(config, appkey.c_str());
|
||||
finclip_config_set_secret(config, secret.c_str());
|
||||
finclip_config_set_domain(config, domain.c_str());
|
||||
finclip_config_set_start_flag(config, kAppletSync);
|
||||
finclip_config_set_show_loading(config, false);
|
||||
|
||||
finclip_initialize(packer);
|
||||
finclip_start_applet(app_store, "60e3c059949a5300014d0c07");
|
||||
FinclipQtDemo w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
|
@ -1,23 +1,19 @@
|
|||
# 📦 安装第三方依赖
|
||||
Windows 小程序运行环境需要安装以下依赖,请提前配置环境:
|
||||
- 请下载依赖包[点我下载](https://github.com/finogeeks/finclip-win32-demo/releases)
|
||||
- 如果您使用的是64位版本, 请解压至vendor/win/x64文件
|
||||
- 建议使用 Visual Studio 2019或以上版本
|
||||
# 通用步骤与功能介绍
|
||||
|
||||
# demo运行
|
||||
## 下载依赖
|
||||
[下载finclip二进制包](https://github.com/finogeeks/finclip-win32-demo/releases)到`vendor`的对应目录下,如`vendor/win/x64`
|
||||
快速开始前请先阅读以下链接
|
||||
|
||||
[Finclip桌面版Demo简介](https://github.com/finogeeks/finclip-desktop-demo/tree/master/examples)
|
||||
|
||||
## 快速开始
|
||||
|
||||
环境准备就绪后, 双击finclip-win32-demo.sln, 在vs中即可运行
|
||||
环境准备就绪后, 双击finclip-desktop-demo.sln, 在vs中即可运行
|
||||
|
||||
# 集成
|
||||
|
||||
**注意:依赖包必须随缩主程序一同发布,并在独立目录中存放。**
|
||||
### 第一步 引入头文件
|
||||
|
||||
头文件: https://github.com/finogeeks/finclip-win32-demo/tree/master/src
|
||||
头文件: https://github.com/finogeeks/finclip-desktop-demo/tree/master/src
|
||||
|
||||
```c++
|
||||
#include "finclip_api.h" //引入头文件
|
||||
|
|
Loading…
Reference in New Issue