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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user