Modern C++.

This commit is contained in:
Black Hat
2019-08-04 22:36:32 +08:00
parent 5c75f009eb
commit ced82bd666
17 changed files with 335 additions and 491 deletions

View File

@@ -12,11 +12,11 @@ ImageClipboard::ImageClipboard(QObject* parent)
&ImageClipboard::imageChanged);
}
bool ImageClipboard::hasImage() {
bool ImageClipboard::hasImage() const {
return !image().isNull();
}
QImage ImageClipboard::image() {
QImage ImageClipboard::image() const {
return m_clipboard->image();
}
@@ -31,8 +31,9 @@ bool ImageClipboard::saveImage(const QUrl& localPath) {
QString path = QFileInfo(localPath.toLocalFile()).absolutePath();
QDir dir;
if (!dir.exists(path))
if (!dir.exists(path)) {
dir.mkpath(path);
}
i.save(localPath.toLocalFile());