view widgets/GenericItemList.h @ 59:57c85a9d9b4a

(none)
author benoitrigolleau
date Mon, 28 May 2007 08:14:40 +0000
parents 81921835ddf1
children afcf540ae3a2
line wrap: on
line source
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */

/*   
	Sound Access
		EASAIER client application.
		Silogic 2007. Benoit Rigolleau.

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License as
	published by the Free Software Foundation; either version 2 of the
	License, or (at your option) any later version.  See the file
	COPYING included with this distribution for more information.
*/


#ifndef _GENERIC_ITEM_LIST_H
#define _GENERIC_ITEM_LIST_H

#include <QFrame>
#include <QPoint>

class GenericItemList : public QFrame{
	Q_OBJECT	

public:
	GenericItemList(QWidget *parent=0);
	void setData(QVariant &data);
	void setIndex(int index);
	virtual void configAction();
	void setAcceptDrag(bool status);

signals :
	void doubleClicked();
	void selected(int index=0);
	void itemDropped(int origine, int destination);

protected:
	void mousePressEvent(QMouseEvent *evt);
	void mouseReleaseEvent(QMouseEvent *evt);
	void mouseMoveEvent(QMouseEvent *evt);
	void dragEnterEvent(QDragEnterEvent *evt);
	void dragMoveEvent(QDragMoveEvent *evt);
	void mouseDoubleClickEvent(QMouseEvent *evt);
	void dropEvent(QDropEvent *evt);
	//void focusOutEvent ( QFocusEvent *evt ); 
	//void focusInEvent ( QFocusEvent *evt ); 
	int m_index;


private: 
	void startDrag();
	QPoint m_startPos;
	bool m_clicked;
	bool m_acceptDrag;


};
#endif