/* * Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd. * * Author: ZhangYong * * Maintainer: ZhangYong * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef IMGINFODIALOG_H #define IMGINFODIALOG_H #include #include //#include #include #include DWIDGET_USE_NAMESPACE class QFormLayout; class QVBoxLayout; class QWidget; class ImgInfoDialog : public DDialog { Q_OBJECT public: explicit ImgInfoDialog(const QString &path, QWidget *parent = nullptr); int height(); private: void initUI(); void setImagePath(const QString &path); void updateInfo(); void clearLayout(QLayout *layout); const QString trLabel(const char *str); void updateBaseInfo(const QMap &infos); void updateDetailsInfo(const QMap &infos); QList addExpandWidget(const QStringList &titleList); void initExpand(QVBoxLayout *layout, DDrawer *expand); int contentHeight() const; private: int m_title_maxwidth; int m_maxFieldWidth; int m_currentFontSize; bool m_isBaseInfo; bool m_isDetailsInfo; QString m_path; QFrame *m_exif_base; QFrame *m_exif_details; QFormLayout *m_exifLayout_base; QFormLayout *m_exifLayout_details; QList m_expandGroup; QVBoxLayout *m_mainLayout; DScrollArea *m_scrollArea; bool m_mousePress = false; int m_mouseY = 0; void keyPressEvent(QKeyEvent *e) override; void paintEvent(QPaintEvent *event) override; bool event(QEvent *event)override; bool eventFilter(QObject *obj, QEvent *e) Q_DECL_OVERRIDE; }; #endif // IMGINFODIALOG_H