2014-06-25 04:11:11 +08:00
|
|
|
#ifndef GROUPWIDGET_H
|
|
|
|
#define GROUPWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
class GroupWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
GroupWidget(int GroupId, QString Name);
|
|
|
|
void onUserListChanged();
|
|
|
|
void mouseReleaseEvent (QMouseEvent* event);
|
2014-06-28 02:22:53 +08:00
|
|
|
void mousePressEvent(QMouseEvent *event);
|
2014-06-25 04:11:11 +08:00
|
|
|
void contextMenuEvent(QContextMenuEvent * event);
|
2014-06-28 02:22:53 +08:00
|
|
|
void enterEvent(QEvent* event);
|
|
|
|
void leaveEvent(QEvent* event);
|
|
|
|
|
2014-06-25 04:11:11 +08:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void groupWidgetClicked(GroupWidget* widget);
|
|
|
|
void removeGroup(int groupId);
|
|
|
|
|
|
|
|
public:
|
|
|
|
int groupId;
|
|
|
|
QLabel avatar, name, nusers;
|
|
|
|
QHBoxLayout layout;
|
|
|
|
QVBoxLayout textLayout;
|
2014-06-27 09:47:16 +08:00
|
|
|
void setAsInactiveChatroom();
|
|
|
|
void setAsActiveChatroom();
|
2014-06-28 02:22:53 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
QColor lastColor;
|
|
|
|
int isActiveWidget;
|
2014-06-25 04:11:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GROUPWIDGET_H
|