mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Change more things.
Things changed: - make getImageFileFormat case insensitive - use QTextEdit::dragEnterEvent instead of QAbstractScrollArea::dragEnterEvent, - Make dragEnterEvent() and dropEvent() overrides.
This commit is contained in:
parent
bf434f3ac5
commit
77af5d54cf
3 changed files with 4 additions and 4 deletions
|
@ -16,7 +16,7 @@ QString getImageFileFormat(QString path)
|
|||
static QStringList listOfImageFormats = {".png", ".jpg", ".jpeg"};
|
||||
for (const QString &format : listOfImageFormats)
|
||||
{
|
||||
if (path.endsWith(format))
|
||||
if (path.endsWith(format, Qt::CaseInsensitive))
|
||||
{
|
||||
return format.mid(1);
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ void ResizingTextEdit::dragEnterEvent(QDragEnterEvent *event)
|
|||
}
|
||||
else
|
||||
{
|
||||
QAbstractScrollArea::dragEnterEvent(event);
|
||||
QTextEdit::dragEnterEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ protected:
|
|||
bool canInsertFromMimeData(const QMimeData *source) const override;
|
||||
void insertFromMimeData(const QMimeData *source) override;
|
||||
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void dropEvent(QDropEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
|
||||
private:
|
||||
// hadSpace is set to true in case the "textUnderCursor" word was after a
|
||||
|
|
Loading…
Reference in a new issue