Moved RSTextBrowser::checkImage to ImageUtil for use in MimeTextEdit

This commit is contained in:
thunder2 2023-04-19 00:42:26 +02:00
parent 44bb2c0f05
commit 7b28bf5256
7 changed files with 121 additions and 67 deletions

View file

@ -22,15 +22,19 @@
#define IMAGEUTIL_H
#include <QTextCursor>
#include <QWidget>
#include <QByteArray>
#include <qiterator.h>
class QWidget;
class QTextEdit;
class QByteArray;
class ImageUtil
{
public:
ImageUtil();
static bool checkImage(const QTextEdit *edit, const QPoint &pos, QRect *cursorRectStartOut = NULL, QRect *cursorRectLeftOut = NULL, QRect *cursorRectRightOut = NULL, QRect *cursorRectEndOut = NULL);
static bool checkImage(const QTextEdit *edit, const QPoint &pos, QString &imageStr, QRect *cursorRectStartOut = NULL, QRect *cursorRectLeftOut = NULL, QRect *cursorRectRightOut = NULL, QRect *cursorRectEndOut = NULL);
static void extractImage(QWidget *window, QTextCursor cursor, QString file = "");
static void copyImage(QWidget *window, QTextCursor cursor);
static bool optimizeSizeHtml(QString &html, const QImage& original, QImage &optimized, int maxPixels = -1, int maxBytes = -1);