/**
** This file is owned by VisualGear Technology Co., Ltd.
** Unauthorized copying of this file, via any medium is strictly prohibited
** Otherwise VisualGear Technology Co., Ltd. will have the right to pursue
** maximum responsibilities within scope of legal.
**
** Copyright 2018-2020 VisualGear All rights reserved.
**/

#pragma once

#include <QtWidgets/QLabel>
#include "UIGearsQtLib.h"
#include "UIGQScrollView.h"

namespace UIGQtLib
{
	class UIGQPropertyListImpl;
	class UIGEARSQTLIB_EXPORT UIGQPropertyList : public UIGQScrollView
	{
		Q_OBJECT
	public:
		UIGQPropertyList(QWidget* pParent = nullptr);
		~UIGQPropertyList();

		UIG_QT_CTRL_DEF("qtproperty", UIGQPropertyList);

		void removeAll();
		void addItem(const PropertyDef& prop);
		void updateValue(PropertyDef* propDef);

	Q_SIGNALS:
		void selectEvent(PropertyDef* propDef);
		void valueChanged(PropertyDef* propDef);

		friend class UIGQPropertyListImpl;
	protected:
		void layout();
		void paintEvent(QPaintEvent* pPainterEvent);
		void resizeEvent(QResizeEvent* evt);


	private:
		UIGQPropertyListImpl*	_ctrlImpl;
	};
}
