Apply Clang Format
This commit is contained in:
@@ -11,36 +11,40 @@
|
||||
#include <QUrl>
|
||||
#include <QtDebug>
|
||||
|
||||
ImageClipboard::ImageClipboard(QObject* parent)
|
||||
: QObject(parent), m_clipboard(QGuiApplication::clipboard()) {
|
||||
connect(m_clipboard, &QClipboard::changed, this,
|
||||
&ImageClipboard::imageChanged);
|
||||
ImageClipboard::ImageClipboard(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_clipboard(QGuiApplication::clipboard())
|
||||
{
|
||||
connect(m_clipboard, &QClipboard::changed, this, &ImageClipboard::imageChanged);
|
||||
}
|
||||
|
||||
bool ImageClipboard::hasImage() const {
|
||||
return !image().isNull();
|
||||
bool ImageClipboard::hasImage() const
|
||||
{
|
||||
return !image().isNull();
|
||||
}
|
||||
|
||||
QImage ImageClipboard::image() const {
|
||||
return m_clipboard->image();
|
||||
QImage ImageClipboard::image() const
|
||||
{
|
||||
return m_clipboard->image();
|
||||
}
|
||||
|
||||
bool ImageClipboard::saveImage(const QUrl& localPath) {
|
||||
if (!localPath.isLocalFile())
|
||||
return false;
|
||||
bool ImageClipboard::saveImage(const QUrl &localPath)
|
||||
{
|
||||
if (!localPath.isLocalFile())
|
||||
return false;
|
||||
|
||||
auto i = image();
|
||||
auto i = image();
|
||||
|
||||
if (i.isNull())
|
||||
return false;
|
||||
if (i.isNull())
|
||||
return false;
|
||||
|
||||
QString path = QFileInfo(localPath.toLocalFile()).absolutePath();
|
||||
QDir dir;
|
||||
if (!dir.exists(path)) {
|
||||
dir.mkpath(path);
|
||||
}
|
||||
QString path = QFileInfo(localPath.toLocalFile()).absolutePath();
|
||||
QDir dir;
|
||||
if (!dir.exists(path)) {
|
||||
dir.mkpath(path);
|
||||
}
|
||||
|
||||
i.save(localPath.toLocalFile());
|
||||
i.save(localPath.toLocalFile());
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user