有个不必现错误,预览初步完成
This commit is contained in:
@@ -1,14 +1,46 @@
|
||||
#include "frmalbum.h"
|
||||
#include "ui_frmalbum.h"
|
||||
#include <QUrl>
|
||||
|
||||
FrmAlbum::FrmAlbum(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::FrmAlbum)
|
||||
|
||||
FrmAlbum::FrmAlbum(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
initForm();
|
||||
}
|
||||
|
||||
FrmAlbum::~FrmAlbum()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void FrmAlbum::initForm()
|
||||
{
|
||||
layout = new QHBoxLayout(this);
|
||||
panelWidget = new PanelWidget(this);
|
||||
layout->addWidget(panelWidget);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
this->setLayout(layout);
|
||||
panelWidget->setObjectName("widget");
|
||||
panelWidget->setStyleSheet("background-color: rgb(63, 60, 55)");
|
||||
panelWidget->setAutoHeight(false);
|
||||
panelWidget->setAutoWidth(false);
|
||||
panelWidget->setAutoHeight(false);
|
||||
panelWidget->setAutoWidth(false);
|
||||
|
||||
// qDebug() << ui->widget;
|
||||
|
||||
QList<QUrl> urls = {
|
||||
QUrl("https://imagehyj.oss-cn-hangzhou.aliyuncs.com/blog/20250320201317.png"),
|
||||
QUrl("https://imagehyj.oss-cn-hangzhou.aliyuncs.com/blog/EDH386.jpeg"),
|
||||
QUrl("https://imagehyj.oss-cn-hangzhou.aliyuncs.com/blog/20250321103557.png"),
|
||||
};
|
||||
|
||||
foreach (const QUrl& u, urls) {
|
||||
FrmImgShow* widget = new FrmImgShow(this);
|
||||
widget->loadImage(u);
|
||||
picWidgetList.push_front(widget);
|
||||
}
|
||||
|
||||
panelWidget->setWidget(picWidgetList, 3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user