This commit is contained in:
Gangphon 2023-04-21 11:06:47 +08:00
parent 8bd2a98dd7
commit f9db8e5e85
11 changed files with 16 additions and 33 deletions

View File

@ -8,7 +8,7 @@ QT += webenginewidgets
greaterThan(QT_MAJOR_VERSION, 5) {
QT += openglwidgets
}
CONFIG += c++20
CONFIG += c++14
CONFIG += lrelease
CONFIG += embed_translations
# CONFIG += console

View File

@ -4,7 +4,6 @@
#include <QPainter>
#include <QPainterPath>
#include <QIcon>
#include <windows.h>
BaseWin::BaseWin(QWidget *parent) : QWidget(parent){
setWindowFlag(Qt::FramelessWindowHint);

View File

@ -11,6 +11,7 @@
#include <QCheckBox>
#include <QFile>
#include <QThread>
#include <QComboBox>
class CtrlAdvancedPanel : public QWidget {
Q_OBJECT

View File

@ -11,6 +11,7 @@
#include <QLineEdit>
#include <QGroupBox>
#include <QCheckBox>
#include <QComboBox>
struct ApnInfo {
QString apn;

View File

@ -154,6 +154,7 @@ public:
avcodec_free_context(&ctx);
}
};
class FFPlayer;
class AVFmt {
friend class FFPlayer;
public:

View File

@ -4,7 +4,7 @@
#include <QGraphicsObject>
#include <QVBoxLayout>
#include <QPen>
#include <float.h>
#define m_handleLen 10
class EBase : public QGraphicsObject {

View File

@ -3,6 +3,7 @@
#include "basewin.h"
#include "program/pageeditor.h"
#include <QListWidget>
#include <QJsonObject>
class ProgPanel;
class ProgItem;

View File

@ -1,5 +1,4 @@
#include "usbdetectdialog.h"
#include <windows.h>
#include <QVBoxLayout>
#include <QPushButton>
#include <QLabel>
@ -65,29 +64,10 @@ UsbDetectDialog::UsbDetectDialog(QWidget *parent) : BaseDlg(parent) {
vBox->addLayout(hBox);
detectDriver();
timerId = startTimer(3000);
}
void UsbDetectDialog::timerEvent(QTimerEvent *e) {
if(e->timerId() == timerId) detectDriver();
}
void UsbDetectDialog::detectDriver() {
auto drives = QDir::drives(); //获取当前系统的盘符
QStringList movables;
for(auto drive : drives) if(GetDriveType((WCHAR *) drive.filePath().utf16())==2) movables.append(drive.filePath());
if(movables.size() == lastCnt) return;
if(movables.size() > lastCnt) {
for(auto movable : movables) {
for(int n=0; n < fdDrives->count(); n++) if(movable == fdDrives->item(n)->text()) goto exist;
fdDrives->addItem(movable);
exist:;
}
} else {
fdDrives->clear();
fdDrives->addItems(movables);
}
lastCnt = movables.size();
if(lastCnt==1) {
QListWidgetItem *item = fdDrives->item(0);
item->setSelected(true);
}
fdDrives->clear();
foreach(auto drive, drives) fdDrives->addItem(drive.filePath());
}

View File

@ -8,18 +8,12 @@ class UsbDetectDialog : public BaseDlg {
Q_OBJECT
public:
explicit UsbDetectDialog(QWidget *parent = nullptr);
~UsbDetectDialog() {if(timerId!=0) killTimer(timerId);}
protected:
void timerEvent(QTimerEvent *) override;
signals:
void acceptData(QString string1, QString string2);
private:
void detectDriver();
QListWidget *fdDrives;
QLineEdit *fdPassword;
int timerId = 0;
int lastCnt = 0;
};
#endif // USBDETECTDIALOG_H

View File

@ -2,6 +2,7 @@
#define VIDEOSPLITTHREAD_H
#include <QThread>
#include <QPointF>
class VideoSplitThread : public QThread {
Q_OBJECT

View File

@ -1,8 +1,9 @@
#include "synctimer.h"
#include <QDateTime>
#include <QDebug>
#ifdef Q_OS_WINDOWS
#include <windows.h>
#endif
SyncTimer::SyncTimer(int inter) {
this->inter = inter;
connect(this, &QThread::finished, this, &QThread::deleteLater);
@ -11,7 +12,9 @@ void SyncTimer::run(){
qint64 curTime;
sleep = inter;
if(sleep <= 0) return;
#ifdef Q_OS_WINDOWS
timeBeginPeriod(1);
#endif
msleep(sleep);
qint64 exeTime = QDateTime::currentMSecsSinceEpoch();
while(inter > 0) {
@ -25,5 +28,7 @@ void SyncTimer::run(){
if(exeTime > curTime) msleep(sleep);
else exeTime = curTime;
}
#ifdef Q_OS_WINDOWS
timeEndPeriod(1);
#endif
}