QDrag exec moved to timeout for 0.8.34.dev

This commit is contained in:
John Preston 2015-06-28 16:16:25 +03:00
parent 51451181f8
commit 9c91bc1677
5 changed files with 14 additions and 7 deletions

View File

@ -491,7 +491,9 @@ void HistoryList::dragActionCancel() {
historyWidget->noSelectingScroll();
}
void HistoryList::dragExec() {
void HistoryList::onDragExec() {
if (_dragAction != Dragging) return;
bool uponSelected = false;
if (_dragItem) {
bool afterDragSymbol;
@ -1168,6 +1170,7 @@ void HistoryList::leaveEvent(QEvent *e) {
HistoryList::~HistoryList() {
delete _menu;
_dragAction = NoDrag;
}
void HistoryList::adjustCurrent(int32 y) {
@ -1364,7 +1367,7 @@ void HistoryList::onUpdateSelected() {
if (item != _dragItem || (m - _dragStartPos).manhattanLength() >= QApplication::startDragDistance()) {
if (_dragAction == PrepareDrag) {
_dragAction = Dragging;
dragExec();
QTimer::singleShot(1, this, SLOT(onDragExec()));
} else if (_dragAction == PrepareSelect) {
_dragAction = Selecting;
}

View File

@ -59,7 +59,6 @@ public:
void dragActionUpdate(const QPoint &screenPos);
void dragActionFinish(const QPoint &screenPos, Qt::MouseButton button = Qt::LeftButton);
void dragActionCancel();
void dragExec();
void touchScrollUpdated(const QPoint &screenPos);
QPoint mapMouseToItem(QPoint p, HistoryItem *item);
@ -107,6 +106,7 @@ public slots:
void onMenuDestroy(QObject *obj);
void onTouchSelect();
void onTouchScrollTimer();
void onDragExec();
private:

View File

@ -2458,7 +2458,7 @@ namespace Local {
set.stickers.reserve(scnt);
QMap<uint64, bool> read;
for (uint32 j = 0; j < scnt; ++j) {
for (int32 j = 0; j < scnt; ++j) {
quint64 id, access;
QString name, mime, alt;
qint32 date, dc, size, width, height, type, typeOfSet;

View File

@ -486,7 +486,9 @@ void OverviewInner::dragActionFinish(const QPoint &screenPos, Qt::MouseButton bu
_overview->updateTopBarSelection();
}
void OverviewInner::dragExec() {
void OverviewInner::onDragExec() {
if (_dragAction != Dragging) return;
bool uponSelected = false;
if (_dragItem) {
bool afterDragSymbol;
@ -936,7 +938,7 @@ void OverviewInner::onUpdateSelected() {
if (_mousedItem != _dragItem || (m - _dragStartPos).manhattanLength() >= QApplication::startDragDistance()) {
if (_dragAction == PrepareDrag) {
_dragAction = Dragging;
dragExec();
QTimer::singleShot(1, this, SLOT(onDragExec()));
} else if (_dragAction == PrepareSelect) {
_dragAction = Selecting;
}
@ -1631,6 +1633,7 @@ void OverviewInner::showAll(bool recountHeights) {
}
OverviewInner::~OverviewInner() {
_dragAction = NoDrag;
}
OverviewWidget::OverviewWidget(QWidget *parent, const PeerData *peer, MediaOverviewType type) : QWidget(parent)

View File

@ -44,7 +44,6 @@ public:
void dragActionUpdate(const QPoint &screenPos);
void dragActionFinish(const QPoint &screenPos, Qt::MouseButton button = Qt::LeftButton);
void dragActionCancel();
void dragExec();
void touchScrollUpdated(const QPoint &screenPos);
QPoint mapMouseToItem(QPoint p, MsgId itemId, int32 itemIndex);
@ -89,6 +88,8 @@ public slots:
void onTouchSelect();
void onTouchScrollTimer();
void onDragExec();
private:
void fixItemIndex(int32 &current, MsgId msgId) const;