clicklabel: Add right button click signal
This commit is contained in:
		@@ -7,5 +7,9 @@ void ClickLabel::mousePressEvent(QMouseEvent *event)
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		emit leftClick();
 | 
							emit leftClick();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if(event->button() == Qt::RightButton)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							emit rightClick();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return QLabel::mousePressEvent(event);
 | 
						return QLabel::mousePressEvent(event);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
#ifndef CLICKLABEL_H
 | 
					#ifndef CLICKLABEL_H
 | 
				
			||||||
#define CLICKLABEL_H
 | 
					#define CLICKLABEL_H
 | 
				
			||||||
#include <QLabel>
 | 
					#include <QLabel>
 | 
				
			||||||
 | 
					#include <QMenu>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ClickLabel : public QLabel
 | 
					class ClickLabel : public QLabel
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -9,6 +10,7 @@ class ClickLabel : public QLabel
 | 
				
			|||||||
	using QLabel::QLabel;
 | 
						using QLabel::QLabel;
 | 
				
			||||||
  signals:
 | 
					  signals:
 | 
				
			||||||
	void leftClick();
 | 
						void leftClick();
 | 
				
			||||||
 | 
						void rightClick();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  protected:
 | 
					  protected:
 | 
				
			||||||
	void mousePressEvent(QMouseEvent *event);
 | 
						void mousePressEvent(QMouseEvent *event);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user