Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Ticket #116 (new defect)

Opened 11 years ago

Last modified 11 years ago

Problem with Mouse Press Event

Reported by: Anonymous Assigned to:
Priority: major Version: 2.0
Keywords: Cc:

Description

Hello, I`m beginner with QtD, but previously I programming using Qt libs for C++
I wrote the sample code:

( all is in: main.d file that I included in this Ticket )

This code compile ok
I compile that:
dmd *.d -L-lcpp_core -L-lcpp_gui -L-lQtCore -L-lQtGui -L-lqtdcore -L-lqtdgui -O -inline -debug
or without debug:
dmd *.d -L-lcpp_core -L-lcpp_gui -L-lQtCore -L-lQtGui -L-lqtdcore -L-lqtdgui -O -inline
or without debug and optimize:
dmd *.d -L-lcpp_core -L-lcpp_gui -L-lQtCore -L-lQtGui -L-lqtdcore -L-lqtdgui

All compilations complited without error. Great!

This code should:
*track mouse if there is left button pressed
*when mouse move ( and when mouse is tracked ), program change title to display a mouse position
*when left button is released, program don`t track mouse and change title to " "
*mouse press and mouse release are secured by if:

if ( event . button () == Qt . LeftButton ) // Only left button !!!
{
( ... )
}

But:
*mouse press secure don`t work
For examples:
I press a left mouse button and move mouse - title display mouse position - i release left mouse button - title is changed to " "
In this example code of program looks like really good !!!
But in this example:
I press a right or middle mouse button and move mouse - !!! title display mouse position !!! - i release right or middle mouse button - title is not changed to " "
So something in function:

void mousePressEvent ( QMouseEvent event )
{
( ... )
}

from QMainWindow
is broken !!!
Is it a bug ???
Sorry for my bad english. Thank you very much in advance for any reply.

Attachments

main.d (0.7 kB) - added by Anonymous on 12/30/12 22:20:58.

Change History

12/30/12 22:20:58 changed by Anonymous

  • attachment main.d added.

01/03/13 10:32:55 changed by Anonymous

Oh no! Really sorry for two Tickets!