From c4d2e44836c5aefa6ae2b98c94385996b389ef1d Mon Sep 17 00:00:00 2001 From: kgmd111 Date: Wed, 19 Feb 2025 15:23:20 +0100 Subject: [PATCH] first version --- .gitignore | 1 + Kallery.pro | 2 ++ .../index/mainwindow.cpp.8830BAD72745C6A6.idx | Bin 1016 -> 940 bytes .../index/mainwindow.h.11433B5592F9DC8D.idx | Bin 1036 -> 930 bytes .../.qtc_clangd/compile_commands.json | 2 +- imagegallery.cpp | 27 ++++++++++++++++++ imagegallery.h | 25 ++++++++++++++++ main.cpp | 12 ++++---- mainwindow.cpp | 10 ++++--- mainwindow.h | 13 ++------- 10 files changed, 70 insertions(+), 22 deletions(-) create mode 100644 .gitignore create mode 100644 imagegallery.cpp create mode 100644 imagegallery.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/Kallery.pro b/Kallery.pro index b915c09..7ed5ffd 100644 --- a/Kallery.pro +++ b/Kallery.pro @@ -9,10 +9,12 @@ CONFIG += c++17 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ + imagegallery.cpp \ main.cpp \ mainwindow.cpp HEADERS += \ + imagegallery.h \ mainwindow.h FORMS += \ diff --git a/build/Desktop-Debug/.qtc_clangd/.cache/clangd/index/mainwindow.cpp.8830BAD72745C6A6.idx b/build/Desktop-Debug/.qtc_clangd/.cache/clangd/index/mainwindow.cpp.8830BAD72745C6A6.idx index 1b3358be9b194daf172f945d3a5790aed013e3ec..5e4d61e93794e47db664328481e77b6d6408f4b2 100644 GIT binary patch delta 878 zcmeytzJ^^f$kWYj2{QwObBbq0ZfZ#)3j+g#Fc24)6lJR1~Y9T(Mw+;TAm} zu_MVPg?UY_$-B2LZmIh#60~B~wp+K_JuIK!D=w~iGlS8fp<&$ugS>rrmY82pVAWW; znvE;gaK_q6B|^tfr%ZBr`Q6vXSM2nT>tBv%b}3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BZqVP6kc^m@v$tOsG~u zd;xR)ZpUYQ`Um>Upq_)d=UMIM@}iIH>wrdbOL42h9I&@(!n4B6TYW%b0e%57SOBJR zztk1`+c#s|bgP5G;Q5*S|T__h;fqG_R<958(! diff --git a/build/Desktop-Debug/.qtc_clangd/compile_commands.json b/build/Desktop-Debug/.qtc_clangd/compile_commands.json index f49b6f6..bdc7f1f 100644 --- a/build/Desktop-Debug/.qtc_clangd/compile_commands.json +++ b/build/Desktop-Debug/.qtc_clangd/compile_commands.json @@ -1 +1 @@ -[{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++","/home/krzys/programy/own/Kallery/main.cpp"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/main.cpp"},{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++","/home/krzys/programy/own/Kallery/mainwindow.cpp"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/mainwindow.cpp"},{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++-header","/home/krzys/programy/own/Kallery/mainwindow.h"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/mainwindow.h"},{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++-header","/home/krzys/programy/own/Kallery/build/Desktop-Debug/ui_mainwindow.h"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/ui_mainwindow.h"}] \ No newline at end of file +[{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++","/home/krzys/programy/own/Kallery/imagegallery.cpp"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/imagegallery.cpp"},{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++","/home/krzys/programy/own/Kallery/main.cpp"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/main.cpp"},{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++","/home/krzys/programy/own/Kallery/mainwindow.cpp"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/mainwindow.cpp"},{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++-header","/home/krzys/programy/own/Kallery/imagegallery.h"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/imagegallery.h"},{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++-header","/home/krzys/programy/own/Kallery/mainwindow.h"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/mainwindow.h"},{"arguments":["clang","-Wno-documentation-unknown-command","-Wno-unknown-warning-option","-Wno-unknown-pragmas","-nostdinc","-nostdinc++","-pipe","-g","-std=gnu++1z","-Wall","-Wextra","-D_REENTRANT","-fPIC","-fsyntax-only","-m64","--target=x86_64-pc-linux-gnu","-DQT_QML_DEBUG","-DQT_WIDGETS_LIB","-DQT_GUI_LIB","-DQT_CORE_LIB","-DQ_CREATOR_RUN","-DQT_ANNOTATE_FUNCTION(x)=__attribute__((annotate(#x)))","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders","-I/usr/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore","-I/home/krzys/programy/own/Kallery","-I/usr/include/qt","-I/usr/include/qt/QtWidgets","-I/usr/include/qt/QtGui","-I/usr/include/qt/QtCore","-I/home/krzys/programy/own/Kallery/build/Desktop-Debug","-I/usr/lib/qt/mkspecs/linux-clang","-isystem","/usr/include/c++/14.2.1","-isystem","/usr/include/c++/14.2.1/x86_64-pc-linux-gnu","-isystem","/usr/include/c++/14.2.1/backward","-isystem","/usr/local/include","-isystem","/usr/lib/clang/19/include","-isystem","/usr/include","-fmessage-length=0","-fdiagnostics-show-note-include-stack","-fretain-comments-from-system-headers","-fmacro-backtrace-limit=0","-ferror-limit=1000","-x","c++-header","/home/krzys/programy/own/Kallery/build/Desktop-Debug/ui_mainwindow.h"],"directory":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/.qtc_clangd","file":"/home/krzys/programy/own/Kallery/build/Desktop-Debug/ui_mainwindow.h"}] \ No newline at end of file diff --git a/imagegallery.cpp b/imagegallery.cpp new file mode 100644 index 0000000..fc29b47 --- /dev/null +++ b/imagegallery.cpp @@ -0,0 +1,27 @@ +#include "imagegallery.h" +#include + +ImageGallery::ImageGallery(QWidget *parent) : QWidget(parent) +{ + scrollArea = new QScrollArea(this); + scrollWidget = new QWidget(scrollArea); + scrollLayout = new QVBoxLayout(scrollWidget); + + scrollArea->setWidgetResizable(true); + scrollArea->setWidget(scrollWidget); + + QVBoxLayout *mainLayout = new QVBoxLayout(this); + mainLayout->addWidget(scrollArea); + setLayout(mainLayout); +} + +void ImageGallery::addImage(const QString &imagePath) +{ + QLabel *imageLabel = new QLabel(scrollWidget); + QPixmap pixmap(imagePath); + imageLabel->setPixmap(pixmap.scaledToWidth(400, Qt::SmoothTransformation)); + imageLabel->setAlignment(Qt::AlignCenter); + + scrollLayout->addWidget(imageLabel); + imageLabels.append(imageLabel); +} diff --git a/imagegallery.h b/imagegallery.h new file mode 100644 index 0000000..3153373 --- /dev/null +++ b/imagegallery.h @@ -0,0 +1,25 @@ +#ifndef IMAGEGALLERY_H +#define IMAGEGALLERY_H + +#include +#include +#include +#include +#include + +class ImageGallery : public QWidget +{ + Q_OBJECT + +public: + explicit ImageGallery(QWidget *parent = nullptr); + void addImage(const QString &imagePath); + +private: + QScrollArea *scrollArea; + QWidget *scrollWidget; + QVBoxLayout *scrollLayout; + QList imageLabels; +}; + +#endif // IMAGEGALLERY_H diff --git a/main.cpp b/main.cpp index fd3e533..f239cdd 100644 --- a/main.cpp +++ b/main.cpp @@ -1,11 +1,11 @@ -#include "mainwindow.h" - #include +#include "mainwindow.h" int main(int argc, char *argv[]) { - QApplication a(argc, argv); - MainWindow w; - w.show(); - return a.exec(); + QApplication app(argc, argv); + MainWindow mainWindow; + + mainWindow.show(); + return app.exec(); } diff --git a/mainwindow.cpp b/mainwindow.cpp index 2740a6e..9bd2474 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,14 +1,16 @@ #include "mainwindow.h" -#include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) - , ui(new Ui::MainWindow) { - ui->setupUi(this); + imageGallery = new ImageGallery(this); + setCentralWidget(imageGallery); + setWindowTitle("Image Gallery"); + imageGallery->addImage("/home/krzys/Obrazy/kod.png"); + imageGallery->addImage("/home/krzys/Obrazy/kod.png"); + resize(800, 600); } MainWindow::~MainWindow() { - delete ui; } diff --git a/mainwindow.h b/mainwindow.h index f7a3da3..20efb10 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -1,13 +1,5 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - #include - -QT_BEGIN_NAMESPACE -namespace Ui { -class MainWindow; -} -QT_END_NAMESPACE +#include "imagegallery.h" class MainWindow : public QMainWindow { @@ -18,6 +10,5 @@ public: ~MainWindow(); private: - Ui::MainWindow *ui; + ImageGallery *imageGallery; }; -#endif // MAINWINDOW_H