Applied a bit of foutf's suggestions. Replace uploadQueue.size() with .empty() and swap if/else bodies, move non empty queue check outside of the timer on line 60, move getImageFileFormat to an anonymous namespace, rename pasteFromClipoard to upload(), removed usesless comment, shortened message on line 83, use QMimeData.hasUrls() and QMimeData.urls(), moved GIF format case in upload() more to the top, call original functions in canInsertFromMimeData and dragEnterEvent which are overriden

This commit is contained in:
Mm2PL
2019-09-25 22:21:26 +02:00
parent 298c013fa0
commit 4e9951371f
4 changed files with 99 additions and 97 deletions
+9 -2
View File
@@ -264,7 +264,10 @@ bool ResizingTextEdit::canInsertFromMimeData(const QMimeData *source) const
{
return true;
}
return false;
else
{
return QTextEdit::canInsertFromMimeData(source);
}
}
void ResizingTextEdit::insertFromMimeData(const QMimeData *source)
@@ -285,8 +288,12 @@ void ResizingTextEdit::dragEnterEvent(QDragEnterEvent *event)
{
event->acceptProposedAction();
}
// QTextEdit doesn't implement dragEnterEvent, so there's nothing to call here.
else
{
QAbstractScrollArea::dragEnterEvent(event);
}
}
void ResizingTextEdit::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasImage() || event->mimeData()->hasUrls())