[Kde-bindings] Simple KCrash question

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Apr 27 17:13:01 UTC 2004


On Tuesday 27 April 2004 17:14, Martin Welch wrote:
> One other possibility: can I eliminate the signal/slot mechanism. Is it
> possible to override KMainWindow/Kpopup to handle the menu event via a
> virtual function instead?

You could override mouse press event, and look for the right mouse button and 
show the popup, like this from the Qt Scribble example in 'Programming with 
Qt' in java:

		/**
		  * This method is called whenever the user presses the
		  * mouse over the window. It just records the position of the mouse
		  * at the time of the click.
		  */
		protected void mousePressEvent(QMouseEvent event)
		{
			if ( event.button() == RightButton )
				_popupmenu.exec( QCursor.pos() );
			else
			  {
				_last = event.pos();	// retrieve the coordinates from the event
			  }
		}

There's no such thing as a menu event though. But signals and slots should be 
fine I would have thought - I would be surprised if there was any sort of 
problem with them.

-- Richard



More information about the Kde-bindings mailing list