setMouseTracking(true);
- setContextMenuPolicy(Qt::CustomContextMenu);
- connect(this, SIGNAL(customContextMenuRequested(const QPoint &)),
- SLOT(showContextMenu(const QPoint &)));
-
connect(this, SIGNAL(clicked(const QModelIndex &)),
SLOT(itemActivated(const QModelIndex &)));
connect(this, SIGNAL(entered(const QModelIndex &)),
MainWindow::instance()->showActionInStatusBar(action, false);
}
+void ChannelView::mousePressEvent(QMouseEvent *event) {
+ if (event->button() == Qt::RightButton)
+ showContextMenu(event->pos());
+ else
+ QListView::mousePressEvent(event);
+}
+
void ChannelView::mouseMoveEvent(QMouseEvent *event) {
QListView::mouseMoveEvent(event);
const QModelIndex index = indexAt(event->pos());
void disappear();
protected:
+ void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void leaveEvent(QEvent *event);
void paintEvent(QPaintEvent *event);