Welcome to mirror list, hosted at ThFree Co, Russian Federation.

OverlayPositionableItem.h « mumble « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 469cf38a5d52e5ef7ec0f5e33cf38fdb69522d2f (plain)
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
26
27
28
29
30
31
32
33
// Copyright 2015-2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.

#ifndef MUMBLE_MUMBLE_OVERLAYPOSITIONABLEITEM_H
#define MUMBLE_MUMBLE_OVERLAYPOSITIONABLEITEM_H

#include <QtCore/QtGlobal>
#include <QtWidgets/QGraphicsItem>

class OverlayPositionableItem : public QObject, public QGraphicsPixmapItem {
	Q_OBJECT
	Q_DISABLE_COPY(OverlayPositionableItem);

public:
	OverlayPositionableItem(QRectF *posPtr, const bool isPositionable = false);
	virtual ~OverlayPositionableItem();
	void updateRender();
	void setItemVisible(const bool &visible);

private:
	/// Float value between 0 and 1 where 0,0 is top left, and 1,1 is bottom right
	QRectF *m_position;
	const bool m_isPositionEditable;
	QGraphicsEllipseItem *m_qgeiHandle;
	void createPositioningHandle();
	bool sceneEventFilter(QGraphicsItem *, QEvent *) Q_DECL_OVERRIDE;
private slots:
	void onMove();
};

#endif