diff options
author | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-05-08 10:50:57 (GMT) |
---|---|---|
committer | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-05-08 15:36:23 (GMT) |
commit | 473a73c7112e9fbcd441fa1bf5ff7b1f96ee28bd (patch) | |
tree | 8cbba76ae15b5bbfe9b1e64a2e94266985130bfc /Swift/QtUI/QtTextEdit.h | |
parent | 3932697b0d4c9ca01e6d1d2ae84e7f386389e099 (diff) | |
download | swift-473a73c7112e9fbcd441fa1bf5ff7b1f96ee28bd.zip swift-473a73c7112e9fbcd441fa1bf5ff7b1f96ee28bd.tar.bz2 |
Fix an issue when sending a file in a chat
When you drop a file in the chat input, the file path was being sent to
the chat, instead of initialising a file transfer.
This patch fixes this issue and starts the file transfer.
Test-Information:
Tested on Windows 10 with Qt5.7.
Drag a file and drop in the chat input.
Change-Id: Ie6c31e0ba56ac7171442370bf7d8edbefce208d6
Diffstat (limited to 'Swift/QtUI/QtTextEdit.h')
-rw-r--r-- | Swift/QtUI/QtTextEdit.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Swift/QtUI/QtTextEdit.h b/Swift/QtUI/QtTextEdit.h index 228aa9e..7ce5d88 100644 --- a/Swift/QtUI/QtTextEdit.h +++ b/Swift/QtUI/QtTextEdit.h @@ -8,61 +8,63 @@ #include <QPointer> #include <QTextEdit> #include <Swift/Controllers/Settings/SettingsProvider.h> #include <SwifTools/SpellParser.h> #include <Swift/QtUI/QtSpellCheckHighlighter.h> namespace Swift { class SpellChecker; class QtSpellCheckerWindow; class QtTextEdit : public QTextEdit { Q_OBJECT public: QtTextEdit(SettingsProvider* settings, QWidget* parent = nullptr); virtual ~QtTextEdit(); virtual QSize sizeHint() const; void setEmphasiseFocus(bool emphasise); void setCorrectionHighlight(bool coorectionHighlight); signals: void wordCorrected(QString& word); void returnPressed(); void unhandledKeyPressEvent(QKeyEvent* event); void receivedFocus(); void lostFocus(); + void itemDropped(QDropEvent* event); public slots: void handleSettingChanged(const std::string& settings); protected: virtual void keyPressEvent(QKeyEvent* event); virtual void focusInEvent(QFocusEvent* event); virtual void focusOutEvent(QFocusEvent* event); virtual void contextMenuEvent(QContextMenuEvent* event); + virtual void dropEvent(QDropEvent* event); private slots: void handleTextChanged(); private: void addSuggestions(QMenu* menu, QContextMenuEvent* event); void replaceMisspelledWord(const QString& word, int cursorPosition); void setUpSpellChecker(); void spellCheckerSettingsWindow(); PositionPair getWordFromCursor(int cursorPosition); void updateStyleSheet(); private: SpellChecker* checker_; QtSpellCheckHighlighter* highlighter_; std::vector<QAction*> replaceWordActions_; SettingsProvider* settings_; QPointer<QtSpellCheckerWindow> spellCheckerWindow_; bool emphasiseFocus_ = false; bool correctionHighlight_ = false; }; } |