有个不必现错误,预览初步完成
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);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#define FRMALBUM_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "panelwidget.h"
|
||||
#include "frmimgshow.h"
|
||||
#include <QHBoxLayout>
|
||||
|
||||
namespace Ui {
|
||||
class FrmAlbum;
|
||||
@@ -17,6 +20,10 @@ public:
|
||||
|
||||
private:
|
||||
Ui::FrmAlbum *ui;
|
||||
QList<QWidget*> picWidgetList;
|
||||
PanelWidget* panelWidget;
|
||||
QHBoxLayout* layout;
|
||||
void initForm();
|
||||
};
|
||||
|
||||
#endif // FRMALBUM_H
|
||||
|
||||
@@ -6,13 +6,30 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<width>632</width>
|
||||
<height>414</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
Reference in New Issue
Block a user