This commit is contained in:
Gangphon 2023-04-24 15:02:08 +08:00
parent fed2665a90
commit ec7c973d18
5 changed files with 20 additions and 37 deletions

View File

@ -272,18 +272,19 @@ LIBS += -L$$PWD/ffmpeg/lib/\
-lswresample \
-lswscale
copy.path = $$OUT_PWD
copydir.path = $$OUT_PWD
copy.files += $$files(ffmpeg/bin/*.dll)
copy.files += ffmpeg/bin/ffmpeg.exe
copy.files += 7z/7z.dll
copy.files += 7z/7z.exe
# for https requests
copy.files += $$files(OpenSSL/*.dll)
copy.path = $$OUT_PWD
copydir.path = $$OUT_PWD
CONFIG += file_copies
COPIES += copy
COPIES += copydir
}
osx {
INCLUDEPATH += $$PWD/ffmpeg-mac/include
LIBS += -L$$PWD/ffmpeg-mac/lib/\
@ -295,6 +296,9 @@ LIBS += -L$$PWD/ffmpeg-mac/lib/\
-lswresample \
-lswscale
copy.files += $$files(ffmpeg-mac/lib/*.dylib)
copy.path = Contents/MacOS
copydir.path = Contents/MacOS
#QMAKE_BUNDLE_DATA += copy
QMAKE_BUNDLE_DATA += copydir
}

View File

@ -616,12 +616,12 @@ void FFPlayer::updFrame() {
}
auto now_epoch = chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now().time_since_epoch()).count();
dur = now_epoch - last_epoch;
last_epoch = now_epoch;
if(dur>100000) return;
if(dur<4000) {
qWarning()<<"FFPlayer UpdFrame Fail: dur"<<dur;
return;
}
last_epoch = now_epoch;
if(dur>100000) return;
ctx->checkAndUpd(this, now_epoch);
viSize = ctx->vi_frms.size;
auSize = ctx->au_frms.size;

View File

@ -56,8 +56,8 @@ ProgPanel::ProgPanel(QSettings &settings, QWidget *parent) : QWidget(parent) {
auto item = new ProgItem(mProgsDir, dlg.fdName->text(), width, dlg.fdHeight->value(), dlg.fdRemark->toPlainText(), widths, max, mProgTree, this);
item->save();//保存pro.json
mProgTree->adjustCheckState();
auto editor = new ProgEditorWin(item, gMainWin);
editor->show();
ProgEditorWin editor(item, gMainWin);
editor.exec();
});
bnEdit = new QPushButton(tr("Edit"));

View File

@ -2,7 +2,6 @@
#include "progpanel.h"
#include "base/customprogressindicator.h"
#include "base/loemptydialog.h"
#include "base/loqtitlebar.h"
#include "cfg.h"
#include "ebase.h"
#include "pagelistitem.h"
@ -38,41 +37,21 @@
ProgItem *gProgItem{0};
QWidget *gProgEditorWin;
ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : BaseWin(parent), mProgItem(progItem) {
ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : QDialog(parent), mProgItem(progItem) {
gProgEditorWin = this;
gProgItem = progItem;
setWindowModality(Qt::WindowModal);
setAttribute(Qt::WA_AlwaysShowToolTips);
if(parent && ! parent->isMaximized()) resize(parent->size());
else resize(1280, 720);
setWindowFlag(Qt::Window);
setAttribute(Qt::WA_DeleteOnClose);
auto plt = palette();
plt.setBrush(QPalette::Window, QColor(0xdddddd));
setPalette(plt);
// auto plt = palette();
// plt.setBrush(QPalette::Window, QColor(0xdddddd));
// setPalette(plt);
setWindowTitle(progItem->mName);
icon = QPixmap(":/res/Logo.ico").scaledToHeight(16);
auto vBox = new QVBoxLayout(center);
auto vBox = new QVBoxLayout(this);
vBox->setContentsMargins(0, 0, 0, 0);
vBox->setSpacing(0);
auto titleBar = new LoQTitleBar(this);
titleBar->bn_Minimize->setVisible(false);
auto hBox = new QHBoxLayout(titleBar);
hBox->setContentsMargins(0, 0, 0, 0);
hBox->setSpacing(0);
hBox->addStretch();
hBox->addWidget(titleBar->bn_Minimize);
hBox->addWidget(titleBar->bn_Maximize);
hBox->addWidget(titleBar->bn_Close);
vBox->addWidget(titleBar);
auto line = new QFrame();
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
vBox->addWidget(line);
auto toolBar = new QToolBar();
toolBar->setFloatable(false);
toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
@ -367,13 +346,13 @@ ProgEditorWin::ProgEditorWin(ProgItem *progItem, QWidget *parent) : BaseWin(pare
});
vBox->addWidget(toolBar);
line = new QFrame();
auto line = new QFrame();
line->setFrameStyle(QFrame::Sunken);
line->setFrameShape(QFrame::HLine);
vBox->addWidget(line);
//主区域横向布局(幻灯片页列表,编辑窗,属性窗)
hBox = new QHBoxLayout();
auto hBox = new QHBoxLayout();
hBox->setContentsMargins(0, 0, 0, 0);
hBox->setSpacing(0);

View File

@ -1,16 +1,16 @@
#ifndef PROGEDITORWIN_H
#define PROGEDITORWIN_H
#include "basewin.h"
#include "QtWidgets/qdialog.h"
#include "program/pageeditor.h"
#include <QListWidget>
#include <QJsonObject>
class ProgPanel;
class ProgItem;
class ProgEditorWin : public BaseWin {
class ProgEditorWin : public QDialog {
Q_OBJECT
public:
explicit ProgEditorWin(ProgItem *progItem, QWidget *parent = nullptr);
explicit ProgEditorWin(ProgItem *progItem, QWidget *parent = 0);
public slots:
void onSave();