File: FocusList.cpp

package info (click to toggle)
obs-studio 32.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,868 kB
  • sloc: ansic: 191,636; cpp: 110,959; makefile: 877; python: 675; sh: 287; javascript: 19
file content (25 lines) | stat: -rw-r--r-- 537 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "FocusList.hpp"

#include <QDragMoveEvent>

#include "moc_FocusList.cpp"

FocusList::FocusList(QWidget *parent) : QListWidget(parent) {}

void FocusList::focusInEvent(QFocusEvent *event)
{
	QListWidget::focusInEvent(event);

	emit GotFocus();
}

void FocusList::dragMoveEvent(QDragMoveEvent *event)
{
	QPoint pos = event->position().toPoint();
	int itemRow = row(itemAt(pos));

	if ((itemRow == currentRow() + 1) || (currentRow() == count() - 1 && itemRow == -1))
		event->ignore();
	else
		QListWidget::dragMoveEvent(event);
}