mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
#ifndef VINSERTIMAGEDIALOG_H
|
|
#define VINSERTIMAGEDIALOG_H
|
|
|
|
#include <QDialog>
|
|
#include <QImage>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
|
|
class QLabel;
|
|
class QLineEdit;
|
|
class QPushButton;
|
|
|
|
class VInsertImageDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
VInsertImageDialog(const QString &title, const QString &defaultImageTitle,
|
|
const QString &defaultPath,
|
|
QWidget *parent = 0);
|
|
~VInsertImageDialog();
|
|
QString getImageTitleInput() const;
|
|
QString getPathInput() const;
|
|
|
|
void setImage(const QImage &image);
|
|
QImage getImage() const;
|
|
void setBrowseable(bool browseable, bool visible = false);
|
|
|
|
public slots:
|
|
void imageDownloaded(const QByteArray &data);
|
|
|
|
private slots:
|
|
void enableOkButton();
|
|
void handleBrowseBtnClicked();
|
|
|
|
private:
|
|
void setupUI();
|
|
|
|
QLabel *imageTitleLabel;
|
|
QLineEdit *imageTitleEdit;
|
|
QLabel *pathLabel;
|
|
QLineEdit *pathEdit;
|
|
QPushButton *browseBtn;
|
|
QPushButton *okBtn;
|
|
QPushButton *cancelBtn;
|
|
QLabel *imagePreviewLabel;
|
|
|
|
QString title;
|
|
QString defaultImageTitle;
|
|
QString defaultPath;
|
|
QImage *image;
|
|
};
|
|
|
|
#endif // VINSERTIMAGEDIALOG_H
|