Debian Codegraph @

src/album/widgets/dialogs/videoinfodialog.h

raw
1 /*
2 * Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd.
3 *
4 * Author: ZhangYong <[email protected]>
5 *
6 * Maintainer: ZhangYong <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 #ifndef VIDEOINFODIALOG_H
22 #define VIDEOINFODIALOG_H
23
24 #include <DDialog>
25 #include <DScrollArea>
26 #include <DDrawer>
27 #include <denhancedwidget.h>
28
29 #include "movieservice.h"
30
31 DWIDGET_USE_NAMESPACE
32
33 class QFormLayout;
34 class QVBoxLayout;
35 class QWidget;
36
37 class VideoInfoDialog : public DDialog
38 {
39 Q_OBJECT
40 public:
41 explicit VideoInfoDialog(const QString &path, QWidget *parent = nullptr);
42 private:
43 void initUI();
44 void setVideoInfo(const QString &path);
45
46 //基本信息
47 void updateBasicInfo();
48 //编码信息
49 void updateCodecInfo();
50 //音频流信息
51 void updateAudioInfo();
52 // void clearLayout(QLayout *layout);
53
54 // QList<DDrawer *> addExpandWidget(const QStringList &titleList);
55 void appendExpandWidget(const QString &title);
56 void initExpand(QVBoxLayout *layout, DDrawer *expand);
57 int contentHeight() const;
58 QString SpliteText(const QString &text, const QFont &font, int nLabelSize);
59 protected:
60 bool event(QEvent *event)override;
61 void showEvent(QShowEvent *e) override;
62 private:
63 MovieInfo m_movieInfo;
64
65 QList<DDrawer *> m_expandGroup;
66 QVBoxLayout *m_scrollAreaLayout = nullptr;
67 int m_title_maxwidth;
68 int m_maxFieldWidth;
69 int m_currentFontSize;
70
71 QFrame *m_basicInfoFrame = nullptr; //基本信息
72 QFormLayout *m_basicInfoFrameLayout = nullptr;
73 bool m_containBaseInfo = false; //含基本信息
74
75 QFrame *m_codecInfoFrame = nullptr; //编码信息
76 QFormLayout *m_codecInfoFrameLayout = nullptr;
77 bool m_containCodecInfo = false; //含编码信息
78
79 QFrame *m_audioInfoFrame = nullptr; //音频流信息
80 QFormLayout *m_audioInfoFrameLayout = nullptr;
81 bool m_containAudioInfo = false; //含音频流信息
82
83 QVBoxLayout *m_mainLayout = nullptr;
84 DScrollArea *m_scrollArea = nullptr;
85 };
86
87 #endif // VIDEOINFODIALOG_H