CCIMXDesktop
 
Loading...
Searching...
No Matches
ImageBrowser.h
1#ifndef IMAGEBROWSER_H
2#define IMAGEBROWSER_H
3
4#include <QWidget>
5#include <QMap>
6#include <QString>
7#include <QStringList>
8#include <QImage>
9#include <memory>
10
11class ImageCore;
12class ImageInfoWindow;
13
14namespace Ui {
15class ImageBrowser;
16}
17
23class ImageBrowser : public QWidget {
24 Q_OBJECT
25
26public:
38
44 explicit ImageBrowser(QWidget* parent = nullptr);
45
51 void enDirSupports(const QString& where);
52
59 void enDirSupports(const QString& where, const QStringList& prefixs);
60
66 void remove_from_name(const QStringList& names);
67
73 bool is_fileview_visible() const;
74
80 void show_from_name(const QString& name);
81
87 void show_from_index(const int index);
88
95 QStringList from_name(const QStringList& names);
96
101
102public slots:
107
111 void show_next();
112
116 void show_start();
117
121 void show_end();
122
126 void show_prev();
127
131 void show_infoWindow();
132
136 void remove_select();
137
141 void clear();
142
143signals:
150
151private:
155 Ui::ImageBrowser* ui;
156
160 std::unique_ptr<ImageCore> core;
161
165 QMap<QString, QString> mappings;
166
170 void init_memory();
171
175 void init_connections();
176
182 void enmappings(const QStringList& paths);
183
189 void demappings(const QStringList& removeWhat);
190
196 void process_set_images(const QString& images);
197
201 void reset_listwidgets();
202
206 QImage current_image;
207
211 int current_index { -1 };
212
216 ImageInfoWindow* infoWindow;
217};
218
219#endif // IMAGEBROWSER_H
The ImageBrowser class.
Definition ImageBrowser.h:23
void enDirSupports(const QString &where)
Enables directory supports.
Definition ImageBrowser.cpp:42
void show_next()
Shows the next image.
Definition ImageBrowser.cpp:123
QStringList from_name(const QStringList &names)
Converts names to paths.
Definition ImageBrowser.cpp:63
bool is_fileview_visible() const
Checks if the file view is visible.
Definition ImageBrowser.cpp:75
~ImageBrowser()
Destructor.
Definition ImageBrowser.cpp:114
void show_from_name(const QString &name)
Shows an image based on its name.
Definition ImageBrowser.cpp:79
void clear()
Clears the image list.
Definition ImageBrowser.cpp:159
void remove_select()
Removes the currently selected image.
Definition ImageBrowser.cpp:146
void show_prev()
Shows the previous image.
Definition ImageBrowser.cpp:135
void show_end()
Shows the last image.
Definition ImageBrowser.cpp:131
void oppose_fileview_visible()
Toggles the visibility of the file view.
Definition ImageBrowser.cpp:118
void errorOccur(const ImageBrowser::ErrorType e)
Signal emitted when an error occurs.
void show_infoWindow()
Displays the image information window.
Definition ImageBrowser.cpp:139
void show_from_index(const int index)
Shows an image based on its index.
Definition ImageBrowser.cpp:88
void show_start()
Shows the first image.
Definition ImageBrowser.cpp:127
void remove_from_name(const QStringList &names)
Removes images from the browser based on their names.
Definition ImageBrowser.cpp:55
ErrorType
The ErrorType enum.
Definition ImageBrowser.h:32
@ IMAGEREQ_UNDERFLOW
Underflow request.
@ IMAGEREQ_LOST
Image is lost.
@ IMAGEREQ_EMPTY
Images are empty.
@ IMAGEREQ_OVERFLOW
Overflow request.
ImageCore indicates the basic image core utils, by providing the loadable image path.
Definition ImageCore.h:10
ImageInfo Window class holds the display of image info.
Definition ImageInfoWindow.h:14