mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-02 21:58:42 +00:00
feat: add try check
This commit is contained in:
parent
7282c70e0d
commit
ef4280f7ff
3 changed files with 21 additions and 0 deletions
|
@ -48,6 +48,10 @@ HEADERS += \
|
||||||
FORMS += \
|
FORMS += \
|
||||||
dialog.ui
|
dialog.ui
|
||||||
|
|
||||||
|
# 试用检查
|
||||||
|
# DEFINES += TRIAL_EXPIRE_CHECK
|
||||||
|
DEFINES += TRIAL_TIMES=10
|
||||||
|
|
||||||
# 子工程
|
# 子工程
|
||||||
include ($$PWD/common/common.pri)
|
include ($$PWD/common/common.pri)
|
||||||
include ($$PWD/adb/adb.pri)
|
include ($$PWD/adb/adb.pri)
|
||||||
|
|
|
@ -343,6 +343,16 @@ QRect VideoForm::getScreenRect()
|
||||||
return screenRect;
|
return screenRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool VideoForm::checkTrialExpire()
|
||||||
|
{
|
||||||
|
static int trialTimes = 0;
|
||||||
|
if (++trialTimes > TRIAL_TIMES) {
|
||||||
|
QMessageBox::warning(this, "QtScrcpy", QStringLiteral("试用已结束,购买正式版本请联系作者"), QMessageBox::Ok);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void VideoForm::updateStyleSheet(bool vertical)
|
void VideoForm::updateStyleSheet(bool vertical)
|
||||||
{
|
{
|
||||||
if (vertical) {
|
if (vertical) {
|
||||||
|
@ -500,6 +510,12 @@ void VideoForm::setDevice(Device *device)
|
||||||
|
|
||||||
void VideoForm::mousePressEvent(QMouseEvent *event)
|
void VideoForm::mousePressEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
#ifdef TRIAL_EXPIRE_CHECK
|
||||||
|
if (checkTrialExpire()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (event->button() == Qt::MiddleButton) {
|
if (event->button() == Qt::MiddleButton) {
|
||||||
if (m_device && !m_device->isCurrentCustomKeymap()) {
|
if (m_device && !m_device->isCurrentCustomKeymap()) {
|
||||||
emit m_device->postGoHome();
|
emit m_device->postGoHome();
|
||||||
|
|
|
@ -45,6 +45,7 @@ private:
|
||||||
void moveCenter();
|
void moveCenter();
|
||||||
void installShortcut();
|
void installShortcut();
|
||||||
QRect getScreenRect();
|
QRect getScreenRect();
|
||||||
|
bool checkTrialExpire();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue