Generalize Qt link gestures while preserving drag selection
This commit is contained in:
1 parent
3482e4a327
commit
5b321c6304
2 files changed
+7
-7
No files matched your search
@@ -33,11 +33,11 @@ public:
|
||||
|
||||
bool isRowSelected(const QModelIndex &idx) const;
|
||||
void setTextSelChars(int start, int end) { m_textSel.startChar = start; m_textSel.endChar = end; }
|
||||
void setInviteHitTest(std::function<QString(const QModelIndex&, const QPoint&)> fn) { m_inviteHitTest = std::move(fn); }
|
||||
void setLinkHitTest(std::function<QString(const QModelIndex&, const QPoint&)> fn) { m_linkHitTest = std::move(fn); }
|
||||
|
||||
signals:
|
||||
void animationTriggered();
|
||||
void inviteLinkActivated(const QString& link);
|
||||
void linkActivated(const QString& link);
|
||||
|
||||
protected:
|
||||
bool viewportEvent(QEvent *event) override;
|
||||
@@ -62,6 +62,6 @@ private:
|
||||
QPersistentModelIndex m_pressIndex;
|
||||
QPoint m_pressPos;
|
||||
bool m_selecting = false;
|
||||
std::function<QString(const QModelIndex&, const QPoint&)> m_inviteHitTest;
|
||||
std::function<QString(const QModelIndex&, const QPoint&)> m_linkHitTest;
|
||||
QPushButton *m_scrollDownBtn = nullptr;
|
||||
};
|
||||
Reference in new issue
Block a user