mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-11-21 16:52:24 +01:00
feat: add maximum size of blog entry
This commit is contained in:
parent
c32650ed8c
commit
105587ed16
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -36,7 +36,9 @@ public:
|
|||||||
{
|
{
|
||||||
if (blogEntry->objectName().isEmpty())
|
if (blogEntry->objectName().isEmpty())
|
||||||
blogEntry->setObjectName(QString::fromUtf8("blogEntry"));
|
blogEntry->setObjectName(QString::fromUtf8("blogEntry"));
|
||||||
blogEntry->resize(400, 300);
|
blogEntry->resize(250, 250);
|
||||||
|
blogEntry->setMinimumSize(QSize(0, 250));
|
||||||
|
blogEntry->setMaximumSize(QSize(16777215, 250));
|
||||||
formLayout = new QFormLayout(blogEntry);
|
formLayout = new QFormLayout(blogEntry);
|
||||||
formLayout->setObjectName(QString::fromUtf8("formLayout"));
|
formLayout->setObjectName(QString::fromUtf8("formLayout"));
|
||||||
lineEdit = new QLineEdit(blogEntry);
|
lineEdit = new QLineEdit(blogEntry);
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
#include <QtWidgets/QMainWindow>
|
#include <QtWidgets/QMainWindow>
|
||||||
#include <QtWidgets/QMenu>
|
#include <QtWidgets/QMenu>
|
||||||
#include <QtWidgets/QMenuBar>
|
#include <QtWidgets/QMenuBar>
|
||||||
|
#include <QtWidgets/QScrollArea>
|
||||||
#include <QtWidgets/QStatusBar>
|
#include <QtWidgets/QStatusBar>
|
||||||
#include <QtWidgets/QVBoxLayout>
|
#include <QtWidgets/QVBoxLayout>
|
||||||
#include <QtWidgets/QWidget>
|
#include <QtWidgets/QWidget>
|
||||||
@ -29,6 +30,9 @@ public:
|
|||||||
QAction *actionExit;
|
QAction *actionExit;
|
||||||
QWidget *centralwidget;
|
QWidget *centralwidget;
|
||||||
QGridLayout *gridLayout;
|
QGridLayout *gridLayout;
|
||||||
|
QScrollArea *scrollArea;
|
||||||
|
QWidget *scrollAreaWidgetContents;
|
||||||
|
QGridLayout *gridLayout_2;
|
||||||
QVBoxLayout *blogsLayout;
|
QVBoxLayout *blogsLayout;
|
||||||
QStatusBar *statusbar;
|
QStatusBar *statusbar;
|
||||||
QMenuBar *menubar;
|
QMenuBar *menubar;
|
||||||
@ -48,10 +52,22 @@ public:
|
|||||||
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
|
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
|
||||||
gridLayout = new QGridLayout(centralwidget);
|
gridLayout = new QGridLayout(centralwidget);
|
||||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
|
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
|
||||||
|
scrollArea = new QScrollArea(centralwidget);
|
||||||
|
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
|
||||||
|
scrollArea->setWidgetResizable(true);
|
||||||
|
scrollAreaWidgetContents = new QWidget();
|
||||||
|
scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
|
||||||
|
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 780, 539));
|
||||||
|
gridLayout_2 = new QGridLayout(scrollAreaWidgetContents);
|
||||||
|
gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
|
||||||
blogsLayout = new QVBoxLayout();
|
blogsLayout = new QVBoxLayout();
|
||||||
blogsLayout->setObjectName(QString::fromUtf8("blogsLayout"));
|
blogsLayout->setObjectName(QString::fromUtf8("blogsLayout"));
|
||||||
|
|
||||||
gridLayout->addLayout(blogsLayout, 0, 0, 1, 1);
|
gridLayout_2->addLayout(blogsLayout, 0, 0, 1, 1);
|
||||||
|
|
||||||
|
scrollArea->setWidget(scrollAreaWidgetContents);
|
||||||
|
|
||||||
|
gridLayout->addWidget(scrollArea, 0, 0, 1, 1);
|
||||||
|
|
||||||
blogsView->setCentralWidget(centralwidget);
|
blogsView->setCentralWidget(centralwidget);
|
||||||
statusbar = new QStatusBar(blogsView);
|
statusbar = new QStatusBar(blogsView);
|
||||||
|
|||||||
@ -6,10 +6,22 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>250</width>
|
||||||
<height>300</height>
|
<height>250</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>250</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>250</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@ -56,10 +56,7 @@ void blogsView::displayBlogEntriesLoop(const QJsonArray &blogEntries)
|
|||||||
for(int i = 0; i < blogEntries.size(); i++)
|
for(int i = 0; i < blogEntries.size(); i++)
|
||||||
{
|
{
|
||||||
QJsonObject entry = (blogEntries.at(i)).toObject();
|
QJsonObject entry = (blogEntries.at(i)).toObject();
|
||||||
blogEntry *e = new blogEntry();
|
createNewBlogEntry();
|
||||||
e -> setUserId(userId);
|
|
||||||
e -> setUpBlogEntryFromJson(entry);
|
|
||||||
ui -> blogsLayout -> addWidget(e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,15 +67,7 @@ void blogsView::displayBlogEntries()
|
|||||||
qDebug() << blogId;
|
qDebug() << blogId;
|
||||||
qDebug() << userBlog["blogId"].toString();
|
qDebug() << userBlog["blogId"].toString();
|
||||||
QJsonArray blogEntries = userBlog["items"].toArray();
|
QJsonArray blogEntries = userBlog["items"].toArray();
|
||||||
qDebug() << blogEntries.size();
|
displayBlogEntriesLoop(blogEntries);
|
||||||
for(int i = 0; i < blogEntries.size(); i++)
|
|
||||||
{
|
|
||||||
QJsonObject entry = (blogEntries.at(i)).toObject();
|
|
||||||
blogEntry *e = new blogEntry();
|
|
||||||
e -> setUserId(userId);
|
|
||||||
e -> setUpBlogEntryFromJson(entry);
|
|
||||||
ui -> blogsLayout -> addWidget(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,26 @@
|
|||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<layout class="QVBoxLayout" name="blogsLayout"/>
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>780</width>
|
||||||
|
<height>539</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QVBoxLayout" name="blogsLayout"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user