diff --git a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/blogentry.o b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/blogentry.o index 32d24036..d57110c2 100644 Binary files a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/blogentry.o and b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/blogentry.o differ diff --git a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/blogsview.o b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/blogsview.o index 76cecb39..163a6724 100644 Binary files a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/blogsview.o and b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/blogsview.o differ diff --git a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/lab1 b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/lab1 index 14eaafae..3db5129c 100755 Binary files a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/lab1 and b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/lab1 differ diff --git a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_blogentry.h b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_blogentry.h index b3dcc4c3..361586ea 100644 --- a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_blogentry.h +++ b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_blogentry.h @@ -36,7 +36,9 @@ public: { if (blogEntry->objectName().isEmpty()) 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->setObjectName(QString::fromUtf8("formLayout")); lineEdit = new QLineEdit(blogEntry); diff --git a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_blogsview.h b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_blogsview.h index db197a40..fd4e0650 100644 --- a/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_blogsview.h +++ b/EGUI/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_blogsview.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -29,6 +30,9 @@ public: QAction *actionExit; QWidget *centralwidget; QGridLayout *gridLayout; + QScrollArea *scrollArea; + QWidget *scrollAreaWidgetContents; + QGridLayout *gridLayout_2; QVBoxLayout *blogsLayout; QStatusBar *statusbar; QMenuBar *menubar; @@ -48,10 +52,22 @@ public: centralwidget->setObjectName(QString::fromUtf8("centralwidget")); gridLayout = new QGridLayout(centralwidget); 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->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); statusbar = new QStatusBar(blogsView); diff --git a/EGUI/lab1/blogentry.ui b/EGUI/lab1/blogentry.ui index aa037cd9..7925d3fb 100644 --- a/EGUI/lab1/blogentry.ui +++ b/EGUI/lab1/blogentry.ui @@ -6,10 +6,22 @@ 0 0 - 400 - 300 + 250 + 250 + + + 0 + 250 + + + + + 16777215 + 250 + + Form diff --git a/EGUI/lab1/blogsview.cpp b/EGUI/lab1/blogsview.cpp index f72233c0..16e8a5c1 100644 --- a/EGUI/lab1/blogsview.cpp +++ b/EGUI/lab1/blogsview.cpp @@ -56,10 +56,7 @@ void blogsView::displayBlogEntriesLoop(const QJsonArray &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); + createNewBlogEntry(); } } @@ -70,15 +67,7 @@ void blogsView::displayBlogEntries() qDebug() << blogId; qDebug() << userBlog["blogId"].toString(); QJsonArray blogEntries = userBlog["items"].toArray(); - qDebug() << blogEntries.size(); - 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); - } + displayBlogEntriesLoop(blogEntries); } diff --git a/EGUI/lab1/blogsview.ui b/EGUI/lab1/blogsview.ui index eadeaf70..abcd4fc1 100644 --- a/EGUI/lab1/blogsview.ui +++ b/EGUI/lab1/blogsview.ui @@ -16,7 +16,26 @@ - + + + true + + + + + 0 + 0 + 780 + 539 + + + + + + + + +