PDA

View Full Version : Stop window moving when clicking LMB



steg90
11th June 2007, 09:15
Hi,

Is it possible to stop my window from being moved around when user holds left mouse button and moves cursor around? I only want window to be able to move when use cursor is in caption bar.

Regards,
Steve

high_flyer
11th June 2007, 09:19
what are you talking about?
Windows only move when you grab them by the title bar...

steg90
11th June 2007, 09:20
Hi,

I thought that also, but I can move my windows by holding mouse button anywhere, this is why I asked.

high_flyer
11th June 2007, 09:21
what OS are you on?
Is should be a setting in the OS then - this is not Qt feature.

This also means you can't make selections in your windows...

steg90
11th June 2007, 09:32
Windows XP. If the window has list widget, tree widget then it is fine if you click inside them, you can't move the window around.

I just basically create a form derived from QWidget, I then add it to QWorkspace.



m_pPlotterView = new PlotterView( this );
m_pworkspace->addWindow( m_pPlotterView );
m_pPlotterView->show();



Where m_pPlotterView is the derived QWidget class and 'this' is derived QMainWindow.

Regards,
Steve

high_flyer
11th June 2007, 09:42
I then add it to QWorkspace.
Oh!!
So you can't move windows around on your desktop, but only in your work space.
Actually I am not sure if this is normal behaviour for work space either... but I don't really know - try to open another applications that use works psace and see.
Then think good if it is indeed workspace what you need.
If you really need all that works space gives you and you just don't want to move the windows in it, you can catch the move events of the windows and reimplement them.

steg90
11th June 2007, 09:47
Nope, I can move windows around, I just want to be able to move windows around when user clicks the title bar, just like normal behaviour. Don't want user to be able to hold LMB down anywhere and be able to move the window - very strange...

If I have a window derived from QDialog, then all is ok?

Regards,
Steve

high_flyer
11th June 2007, 10:08
you mean on the desktop? out side your workspace?
Then this must be some OS setting.

steg90
11th June 2007, 10:11
This is really annoying as I have a QwtPlotZoomer object on my form which allows you to create a rubber band over your graph and zoom in and out, but I can't do this as I cannot move the cursor within the QwtPlotZoomer object as the whole window moves! The only way I can do this is to have the window maximized.:mad::mad:

Regards,
Steve

steg90
11th June 2007, 10:38
Hi,

I changed my QWorkspace to QMdiArea and the functions to add my windows to the main area with addSubWindow and now it works!

Regards,
Steve

high_flyer
11th June 2007, 10:48
which means that it WAS only in the work space, not system wide, which was what I asked you...
I am glad you solved it though.

steg90
11th June 2007, 10:59
Yes. Although I would have thought this wouldn't have been default behaviour within QWorkspace, doesn't seem correct to me?

Kind regards,
Steve