2022-05-15 03:05:31 +00:00
|
|
|
#include "m3u8d.h"
|
|
|
|
|
/* Code generated by cmd/cgo; DO NOT EDIT. */
|
|
|
|
|
|
|
|
|
|
/* package command-line-arguments */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#line 1 "cgo-builtin-export-prolog"
|
|
|
|
|
|
|
|
|
|
#include <stddef.h> /* for ptrdiff_t below */
|
|
|
|
|
|
|
|
|
|
#ifndef GO_CGO_EXPORT_PROLOGUE_H
|
|
|
|
|
#define GO_CGO_EXPORT_PROLOGUE_H
|
|
|
|
|
|
|
|
|
|
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
|
|
|
|
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Start of preamble from import "C" comments. */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* End of preamble from import "C" comments. */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Start of boilerplate cgo prologue. */
|
|
|
|
|
#line 1 "cgo-gcc-export-header-prolog"
|
|
|
|
|
|
|
|
|
|
#ifndef GO_CGO_PROLOGUE_H
|
|
|
|
|
#define GO_CGO_PROLOGUE_H
|
|
|
|
|
|
|
|
|
|
typedef signed char GoInt8;
|
|
|
|
|
typedef unsigned char GoUint8;
|
|
|
|
|
typedef short GoInt16;
|
|
|
|
|
typedef unsigned short GoUint16;
|
|
|
|
|
typedef int GoInt32;
|
|
|
|
|
typedef unsigned int GoUint32;
|
|
|
|
|
typedef long long GoInt64;
|
|
|
|
|
typedef unsigned long long GoUint64;
|
|
|
|
|
typedef GoInt64 GoInt;
|
|
|
|
|
typedef GoUint64 GoUint;
|
|
|
|
|
typedef __SIZE_TYPE__ GoUintptr;
|
|
|
|
|
typedef float GoFloat32;
|
|
|
|
|
typedef double GoFloat64;
|
|
|
|
|
typedef float _Complex GoComplex64;
|
|
|
|
|
typedef double _Complex GoComplex128;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
static assertion to make sure the file is being used on architecture
|
|
|
|
|
at least with matching size of GoInt.
|
|
|
|
|
*/
|
|
|
|
|
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
|
|
|
|
|
|
|
|
|
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
|
|
|
|
typedef _GoString_ GoString;
|
|
|
|
|
#endif
|
|
|
|
|
typedef void *GoMap;
|
|
|
|
|
typedef void *GoChan;
|
|
|
|
|
typedef struct { void *t; void *v; } GoInterface;
|
|
|
|
|
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* End of boilerplate cgo prologue. */
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
extern __declspec(dllexport) void Go2cppFn_RunDownload(char* in, int inLen, char** out, int* outLen);
|
2022-06-12 14:43:20 +00:00
|
|
|
extern __declspec(dllexport) void Go2cppFn_CloseOldEnv(char* in, int inLen, char** out, int* outLen);
|
2022-05-15 03:05:31 +00:00
|
|
|
extern __declspec(dllexport) void Go2cppFn_GetProgress(char* in, int inLen, char** out, int* outLen);
|
|
|
|
|
extern __declspec(dllexport) void Go2cppFn_GetWd(char* in, int inLen, char** out, int* outLen);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RunDownload_Resp RunDownload(RunDownload_Req in0){
|
|
|
|
|
std::string in;
|
|
|
|
|
{
|
|
|
|
|
{
|
2022-06-20 23:22:53 +00:00
|
|
|
uint32_t tmp22 = in0.M3u8Url.length();
|
|
|
|
|
char tmp23[4];
|
|
|
|
|
tmp23[0] = (uint32_t(tmp22) >> 24) & 0xFF;
|
|
|
|
|
tmp23[1] = (uint32_t(tmp22) >> 16) & 0xFF;
|
|
|
|
|
tmp23[2] = (uint32_t(tmp22) >> 8) & 0xFF;
|
|
|
|
|
tmp23[3] = (uint32_t(tmp22) >> 0) & 0xFF;
|
|
|
|
|
in.append(tmp23, 4);
|
2022-05-15 03:05:31 +00:00
|
|
|
in.append(in0.M3u8Url);
|
|
|
|
|
}
|
|
|
|
|
{
|
2022-06-20 23:22:53 +00:00
|
|
|
uint32_t tmp24 = in0.HostType.length();
|
|
|
|
|
char tmp25[4];
|
|
|
|
|
tmp25[0] = (uint32_t(tmp24) >> 24) & 0xFF;
|
|
|
|
|
tmp25[1] = (uint32_t(tmp24) >> 16) & 0xFF;
|
|
|
|
|
tmp25[2] = (uint32_t(tmp24) >> 8) & 0xFF;
|
|
|
|
|
tmp25[3] = (uint32_t(tmp24) >> 0) & 0xFF;
|
|
|
|
|
in.append(tmp25, 4);
|
2022-05-15 03:05:31 +00:00
|
|
|
in.append(in0.HostType);
|
|
|
|
|
}
|
|
|
|
|
in.append((char*)(&in0.Insecure), 1);
|
|
|
|
|
{
|
2022-06-20 23:22:53 +00:00
|
|
|
uint32_t tmp26 = in0.SaveDir.length();
|
|
|
|
|
char tmp27[4];
|
|
|
|
|
tmp27[0] = (uint32_t(tmp26) >> 24) & 0xFF;
|
|
|
|
|
tmp27[1] = (uint32_t(tmp26) >> 16) & 0xFF;
|
|
|
|
|
tmp27[2] = (uint32_t(tmp26) >> 8) & 0xFF;
|
|
|
|
|
tmp27[3] = (uint32_t(tmp26) >> 0) & 0xFF;
|
|
|
|
|
in.append(tmp27, 4);
|
2022-05-15 03:05:31 +00:00
|
|
|
in.append(in0.SaveDir);
|
|
|
|
|
}
|
|
|
|
|
{
|
2022-06-20 23:22:53 +00:00
|
|
|
uint32_t tmp28 = in0.FileName.length();
|
|
|
|
|
char tmp29[4];
|
|
|
|
|
tmp29[0] = (uint32_t(tmp28) >> 24) & 0xFF;
|
|
|
|
|
tmp29[1] = (uint32_t(tmp28) >> 16) & 0xFF;
|
|
|
|
|
tmp29[2] = (uint32_t(tmp28) >> 8) & 0xFF;
|
|
|
|
|
tmp29[3] = (uint32_t(tmp28) >> 0) & 0xFF;
|
|
|
|
|
in.append(tmp29, 4);
|
2022-05-15 03:05:31 +00:00
|
|
|
in.append(in0.FileName);
|
|
|
|
|
}
|
|
|
|
|
{
|
2022-06-20 23:22:53 +00:00
|
|
|
char tmp30[4];
|
|
|
|
|
tmp30[0] = (uint32_t(in0.SkipTsCountFromHead) >> 24) & 0xFF;
|
|
|
|
|
tmp30[1] = (uint32_t(in0.SkipTsCountFromHead) >> 16) & 0xFF;
|
|
|
|
|
tmp30[2] = (uint32_t(in0.SkipTsCountFromHead) >> 8) & 0xFF;
|
|
|
|
|
tmp30[3] = (uint32_t(in0.SkipTsCountFromHead) >> 0) & 0xFF;
|
|
|
|
|
in.append(tmp30, 4);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
uint32_t tmp31 = in0.SetProxy.length();
|
|
|
|
|
char tmp32[4];
|
|
|
|
|
tmp32[0] = (uint32_t(tmp31) >> 24) & 0xFF;
|
|
|
|
|
tmp32[1] = (uint32_t(tmp31) >> 16) & 0xFF;
|
|
|
|
|
tmp32[2] = (uint32_t(tmp31) >> 8) & 0xFF;
|
|
|
|
|
tmp32[3] = (uint32_t(tmp31) >> 0) & 0xFF;
|
|
|
|
|
in.append(tmp32, 4);
|
|
|
|
|
in.append(in0.SetProxy);
|
2022-05-15 03:05:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
char *out = NULL;
|
|
|
|
|
int outLen = 0;
|
|
|
|
|
Go2cppFn_RunDownload((char *)in.data(), in.length(), &out, &outLen);
|
|
|
|
|
RunDownload_Resp retValue;
|
|
|
|
|
int outIdx = 0;
|
|
|
|
|
{
|
|
|
|
|
{
|
2022-06-12 14:43:20 +00:00
|
|
|
uint32_t tmp33 = 0;
|
|
|
|
|
uint32_t tmp34 = uint32_t(uint8_t(out[outIdx+0]) << 24);
|
|
|
|
|
uint32_t tmp35 = uint32_t(uint8_t(out[outIdx+1]) << 16);
|
|
|
|
|
uint32_t tmp36 = uint32_t(uint8_t(out[outIdx+2]) << 8);
|
|
|
|
|
uint32_t tmp37 = uint32_t(uint8_t(out[outIdx+3]) << 0);
|
|
|
|
|
tmp33 = tmp34 | tmp35 | tmp36 | tmp37;
|
2022-05-15 03:05:31 +00:00
|
|
|
outIdx+=4;
|
2022-06-20 23:22:53 +00:00
|
|
|
retValue.ErrMsg = std::string(out+outIdx, out+outIdx+tmp33);
|
2022-06-12 14:43:20 +00:00
|
|
|
outIdx+=tmp33;
|
2022-05-15 03:05:31 +00:00
|
|
|
}
|
2022-06-20 23:22:53 +00:00
|
|
|
retValue.IsSkipped = (bool) out[outIdx];
|
|
|
|
|
outIdx++;
|
|
|
|
|
retValue.IsCancel = (bool) out[outIdx];
|
|
|
|
|
outIdx++;
|
|
|
|
|
{
|
|
|
|
|
uint32_t tmp38 = 0;
|
|
|
|
|
uint32_t tmp39 = uint32_t(uint8_t(out[outIdx+0]) << 24);
|
|
|
|
|
uint32_t tmp40 = uint32_t(uint8_t(out[outIdx+1]) << 16);
|
|
|
|
|
uint32_t tmp41 = uint32_t(uint8_t(out[outIdx+2]) << 8);
|
|
|
|
|
uint32_t tmp42 = uint32_t(uint8_t(out[outIdx+3]) << 0);
|
|
|
|
|
tmp38 = tmp39 | tmp40 | tmp41 | tmp42;
|
|
|
|
|
outIdx+=4;
|
|
|
|
|
retValue.SaveFileTo = std::string(out+outIdx, out+outIdx+tmp38);
|
|
|
|
|
outIdx+=tmp38;
|
|
|
|
|
}
|
2022-05-15 03:05:31 +00:00
|
|
|
}
|
|
|
|
|
if (out != NULL) {
|
|
|
|
|
free(out);
|
|
|
|
|
}
|
|
|
|
|
return retValue;
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-12 14:43:20 +00:00
|
|
|
void CloseOldEnv(){
|
|
|
|
|
std::string in;
|
|
|
|
|
char *out = NULL;
|
|
|
|
|
int outLen = 0;
|
|
|
|
|
Go2cppFn_CloseOldEnv((char *)in.data(), in.length(), &out, &outLen);
|
|
|
|
|
if (out != NULL) {
|
|
|
|
|
free(out);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-19 23:32:53 +00:00
|
|
|
GetProgress_Resp GetProgress(){
|
2022-05-15 03:05:31 +00:00
|
|
|
std::string in;
|
|
|
|
|
char *out = NULL;
|
|
|
|
|
int outLen = 0;
|
|
|
|
|
Go2cppFn_GetProgress((char *)in.data(), in.length(), &out, &outLen);
|
2022-06-19 23:32:53 +00:00
|
|
|
GetProgress_Resp retValue;
|
2022-05-15 03:05:31 +00:00
|
|
|
int outIdx = 0;
|
|
|
|
|
{
|
2022-06-19 23:32:53 +00:00
|
|
|
{
|
|
|
|
|
uint32_t tmp3 = uint32_t(uint8_t(out[outIdx+0]) << 24);
|
|
|
|
|
uint32_t tmp4 = uint32_t(uint8_t(out[outIdx+1]) << 16);
|
|
|
|
|
uint32_t tmp5 = uint32_t(uint8_t(out[outIdx+2]) << 8);
|
|
|
|
|
uint32_t tmp6 = uint32_t(uint8_t(out[outIdx+3]) << 0);
|
|
|
|
|
retValue.Percent = tmp3 | tmp4 | tmp5 | tmp6;
|
|
|
|
|
outIdx+=4;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
uint32_t tmp7 = 0;
|
|
|
|
|
uint32_t tmp8 = uint32_t(uint8_t(out[outIdx+0]) << 24);
|
|
|
|
|
uint32_t tmp9 = uint32_t(uint8_t(out[outIdx+1]) << 16);
|
|
|
|
|
uint32_t tmp10 = uint32_t(uint8_t(out[outIdx+2]) << 8);
|
|
|
|
|
uint32_t tmp11 = uint32_t(uint8_t(out[outIdx+3]) << 0);
|
|
|
|
|
tmp7 = tmp8 | tmp9 | tmp10 | tmp11;
|
|
|
|
|
outIdx+=4;
|
|
|
|
|
retValue.Title = std::string(out+outIdx, out+outIdx+tmp7);
|
|
|
|
|
outIdx+=tmp7;
|
|
|
|
|
}
|
2022-05-15 03:05:31 +00:00
|
|
|
}
|
|
|
|
|
if (out != NULL) {
|
|
|
|
|
free(out);
|
|
|
|
|
}
|
|
|
|
|
return retValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string GetWd(){
|
|
|
|
|
std::string in;
|
|
|
|
|
char *out = NULL;
|
|
|
|
|
int outLen = 0;
|
|
|
|
|
Go2cppFn_GetWd((char *)in.data(), in.length(), &out, &outLen);
|
|
|
|
|
std::string retValue;
|
|
|
|
|
int outIdx = 0;
|
|
|
|
|
{
|
|
|
|
|
uint32_t tmp2 = 0;
|
|
|
|
|
uint32_t tmp3 = uint32_t(uint8_t(out[outIdx+0]) << 24);
|
|
|
|
|
uint32_t tmp4 = uint32_t(uint8_t(out[outIdx+1]) << 16);
|
|
|
|
|
uint32_t tmp5 = uint32_t(uint8_t(out[outIdx+2]) << 8);
|
|
|
|
|
uint32_t tmp6 = uint32_t(uint8_t(out[outIdx+3]) << 0);
|
|
|
|
|
tmp2 = tmp3 | tmp4 | tmp5 | tmp6;
|
|
|
|
|
outIdx+=4;
|
|
|
|
|
retValue = std::string(out+outIdx, out+outIdx+tmp2);
|
|
|
|
|
outIdx+=tmp2;
|
|
|
|
|
}
|
|
|
|
|
if (out != NULL) {
|
|
|
|
|
free(out);
|
|
|
|
|
}
|
|
|
|
|
return retValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Qt:
|
|
|
|
|
#include <QMutexLocker>
|
|
|
|
|
#include <QtConcurrent/QtConcurrent>
|
|
|
|
|
|
|
|
|
|
RunOnUiThread::RunOnUiThread(QObject *parent) : QObject(parent), m_done(false)
|
|
|
|
|
{
|
|
|
|
|
// 用signal里的Qt::QueuedConnection 将多线程里面的函数转化到ui线程里调用
|
|
|
|
|
connect(this, SIGNAL(signal_newFn()), this, SLOT(slot_newFn()), Qt::QueuedConnection);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RunOnUiThread::~RunOnUiThread()
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
QMutexLocker lk(&this->m_Mutex);
|
|
|
|
|
this->m_done = true;
|
|
|
|
|
this->m_funcList.clear();
|
|
|
|
|
}
|
|
|
|
|
this->m_pool.clear();
|
|
|
|
|
this->m_pool.waitForDone();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RunOnUiThread::AddRunFnOn_OtherThread(std::function<void ()> fn)
|
|
|
|
|
{
|
|
|
|
|
QMutexLocker lk(&this->m_Mutex);
|
|
|
|
|
if (this->m_done) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
QtConcurrent::run(&this->m_pool, fn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RunOnUiThread::slot_newFn()
|
|
|
|
|
{
|
|
|
|
|
QVector<std::function<void ()>> fn_vector;
|
|
|
|
|
{
|
|
|
|
|
QMutexLocker lk(&this->m_Mutex);
|
|
|
|
|
if (this->m_funcList.empty() || this->m_done) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
fn_vector.swap(this->m_funcList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(std::function<void ()>& fn : fn_vector)
|
|
|
|
|
{
|
|
|
|
|
bool v_done = false;
|
|
|
|
|
{
|
|
|
|
|
QMutexLocker lk(&this->m_Mutex);
|
|
|
|
|
v_done = this->m_done;
|
|
|
|
|
}
|
|
|
|
|
if (v_done) { // 快速结束
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
fn();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RunOnUiThread::AddRunFnOn_UiThread(std::function<void ()> fn)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
QMutexLocker lk(&this->m_Mutex);
|
|
|
|
|
if (this->m_done) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
m_funcList.push_back(fn);
|
|
|
|
|
}
|
|
|
|
|
emit this->signal_newFn();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
#include <QPropertyAnimation>
|
|
|
|
|
#include <QPainter>
|
|
|
|
|
#include <QScreen>
|
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
|
#include <QDesktopWidget>
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
|
|
QString StringToRGBA(const QString &color);
|
|
|
|
|
|
|
|
|
|
Toast::Toast(QObject *parent) : QObject(parent)
|
|
|
|
|
{
|
|
|
|
|
m_myWidget = new QWidget;
|
|
|
|
|
m_myWidget->setFixedHeight(60);
|
|
|
|
|
m_label = new QLabel;
|
|
|
|
|
m_label->setFixedHeight(30);
|
|
|
|
|
m_label->move(0,0);
|
|
|
|
|
QFont ft;
|
|
|
|
|
ft.setPointSize(10);
|
|
|
|
|
m_label->setFont(ft);
|
|
|
|
|
m_label->setAlignment(Qt::AlignCenter);
|
|
|
|
|
m_label->setStyleSheet("color:white");
|
|
|
|
|
m_myWidget->setStyleSheet("border: none;background-color:black;border-radius:10px");
|
|
|
|
|
QHBoxLayout * la = new QHBoxLayout;
|
|
|
|
|
la->addWidget(m_label);
|
|
|
|
|
la->setContentsMargins(0,0,0,0);
|
|
|
|
|
m_myWidget->setLayout(la);
|
|
|
|
|
m_myWidget->hide();
|
|
|
|
|
m_myWidget->setWindowFlags(Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint);
|
|
|
|
|
m_myWidget->setAttribute(Qt::WA_TranslucentBackground,true);
|
|
|
|
|
m_timer = new QTimer();
|
|
|
|
|
m_timer->setInterval(3000);
|
|
|
|
|
connect(m_timer,SIGNAL(timeout()),this,SLOT(onTimerStayOut()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Toast *Toast::Instance()
|
|
|
|
|
{
|
|
|
|
|
static Toast instance;
|
|
|
|
|
return &instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Toast::setText(const QString &color,const QString &bgcolor,const int & mestime,const QString &text){
|
|
|
|
|
QApplication::beep();
|
|
|
|
|
QFontMetrics fm(m_label->font());
|
|
|
|
|
int width = fm.boundingRect(text).width() + 30;
|
|
|
|
|
m_myWidget->setFixedWidth(width);
|
|
|
|
|
m_label->setFixedWidth(width);
|
|
|
|
|
m_label->setText(text);
|
|
|
|
|
QString style = QString("color:").append(StringToRGBA(color));
|
|
|
|
|
m_label->setStyleSheet(style);
|
|
|
|
|
|
|
|
|
|
m_myWidget->setStyleSheet(QString("border: none;border-radius:10px;")
|
|
|
|
|
.append("background-color:").append(StringToRGBA(bgcolor)));
|
|
|
|
|
|
|
|
|
|
QDesktopWidget *pDesk = QApplication::desktop();
|
|
|
|
|
m_myWidget->move((pDesk->width() - m_myWidget->width()) / 2, (pDesk->height() - m_myWidget->height()) / 2);
|
|
|
|
|
m_myWidget->show();
|
|
|
|
|
m_timer->setInterval(mestime);
|
|
|
|
|
m_timer->stop();
|
|
|
|
|
m_timer->start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Toast::SetError(const QString &text,const int & mestime){
|
|
|
|
|
setText("FFFFFF","FF0000",mestime,text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Toast::SetSuccess(const QString &text,const int & mestime){
|
|
|
|
|
setText("000000","00FF00",mestime,text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Toast::SetWaring(const QString &text,const int & mestime){
|
|
|
|
|
setText("FF0000","FFFF00",mestime,text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Toast::SetTips(const QString &text,const int & mestime){
|
|
|
|
|
setText("FFFFFF","0080FF",mestime,text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString StringToRGBA(const QString &color){
|
|
|
|
|
int r = color.mid(0,2).toInt(nullptr,16);
|
|
|
|
|
int g = color.mid(2,2).toInt(nullptr,16);
|
|
|
|
|
int b = color.mid(4,2).toInt(nullptr,16);
|
|
|
|
|
int a = color.length()>=8?color.mid(6,2).toInt(nullptr,16):QString("FF").toInt(nullptr,16);
|
|
|
|
|
QString style = QString("rgba(").append(QString::number(r)).append(",")
|
|
|
|
|
.append(QString::number(g)).append(",")
|
|
|
|
|
.append(QString::number(b)).append(",")
|
|
|
|
|
.append(QString::number(a))
|
|
|
|
|
.append(");");
|
|
|
|
|
return style;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Toast::onTimerStayOut()
|
|
|
|
|
{
|
|
|
|
|
m_timer->stop();
|
|
|
|
|
m_myWidget->hide();
|
|
|
|
|
}
|