diff --git a/LedOK/LedOK.pro b/LedOK/LedOK.pro index 80ed842..df065a4 100644 --- a/LedOK/LedOK.pro +++ b/LedOK/LedOK.pro @@ -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 } diff --git a/LedOK/ffplayer.cpp b/LedOK/ffplayer.cpp index 51df954..9e4c26c 100644 --- a/LedOK/ffplayer.cpp +++ b/LedOK/ffplayer.cpp @@ -616,12 +616,12 @@ void FFPlayer::updFrame() { } auto now_epoch = chrono::duration_cast(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"<100000) return; ctx->checkAndUpd(this, now_epoch); viSize = ctx->vi_frms.size; auSize = ctx->au_frms.size; diff --git a/LedOK/progpanel.cpp b/LedOK/progpanel.cpp index 541fd9a..6a8ab07 100644 --- a/LedOK/progpanel.cpp +++ b/LedOK/progpanel.cpp @@ -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")); diff --git a/LedOK/program/progeditorwin.cpp b/LedOK/program/progeditorwin.cpp index 8c32453..c768396 100644 --- a/LedOK/program/progeditorwin.cpp +++ b/LedOK/program/progeditorwin.cpp @@ -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); diff --git a/LedOK/program/progeditorwin.h b/LedOK/program/progeditorwin.h index 4d87931..3e6be21 100644 --- a/LedOK/program/progeditorwin.h +++ b/LedOK/program/progeditorwin.h @@ -1,16 +1,16 @@ #ifndef PROGEDITORWIN_H #define PROGEDITORWIN_H -#include "basewin.h" +#include "QtWidgets/qdialog.h" #include "program/pageeditor.h" #include #include 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();