qt ElaWidgetTools添加Page页面
添加page页面:
实现代码:
(1)T_Home1.h
#ifndef T_HOME1_H
#define T_HOME1_H
#include <ElaScrollPage.h>
class ElaMenu;
class ElaTableView;
class T_Home1 : public ElaScrollPage
{
Q_OBJECT
public:
Q_INVOKABLE explicit T_Home1(QWidget* parent = nullptr);
~T_Home1();
Q_SIGNALS:
Q_SIGNAL void elaScreenNavigation();
private:
ElaMenu* _homeMenu{nullptr};
ElaTableView* _tableView{ nullptr };
};
#endif // T_HOME_H
(2)T_Home1.cpp
#include "T_Home1.h"
#include <QDebug>
#include <QDesktopServices>
#include <QHBoxLayout>
#include <QMouseEvent>
#include <QPainter>
#include <QVBoxLayout>
#include <QHeaderView>
#include <QVBoxLayout>
#include "ElaAcrylicUrlCard.h"
#include "ElaFlowLayout.h"
#include "ElaImageCard.h"
#include "ElaMenu.h"
#include "ElaMessageBar.h"
#include "ElaNavigationRouter.h"
#include "ElaPopularCard.h"
#include "ElaScrollArea.h"
#include "ElaText.h"
#include "ElaToolTip.h"
#include "ElaMenu.h"
#include "ElaText.h"
#include "ElaTheme.h"
#include "ElaToolButton.h"
#include "ElaTableView.h"
#include "ElaText.h"
#include "ElaPushButton.h"
T_Home1::T_Home1(QWidget* parent)
: ElaScrollPage(parent)
{
ElaPopularCard* homeCard1 = new ElaPopularCard(this);
{
connect(homeCard1, &ElaPopularCard::popularCardButtonClicked, this, [=]() {
int ttt = 666;
});
homeCard1->setTitle("Pdf提取文本操作");
homeCard1->setSubTitle("5.0⭐ 实用程序与工具");
homeCard1->setCardPixmap(QPixmap(":/Resource/Image/control/AutomationProperties.png"));
homeCard1->setInteractiveTips("免费使用");
homeCard1->setDetailedText("将pdf文本保存为txt文本");
homeCard1->setCardFloatPixmap(QPixmap(":/Resource/Image/IARC/IARC_7+.svg.png"));
}
ElaFlowLayout* flowLayout = new ElaFlowLayout(0, 5, 5);
flowLayout->setContentsMargins(30, 0, 0, 0);
flowLayout->setIsAnimation(true);
flowLayout->addWidget(homeCard1);
QWidget* centralWidget = new QWidget(this);
centralWidget->setWindowTitle("文档转换");
QVBoxLayout* centerVLayout = new QVBoxLayout(centralWidget);
centerVLayout->setContentsMargins(0, 0, 0, 0);
centerVLayout->addSpacing(10);
centerVLayout->addLayout(flowLayout);
centerVLayout->addStretch();
addCentralWidget(centralWidget, true, false, 0);
}
T_Home1::~T_Home1()
{
}