hi,
Im using qt4.0 in debian. i want to disable the move in every window.
im using QDialog , QMainwindow. im using frameless window,but when i use alt+spacebar , i can able to move the window.
Is there any way to disable the move option
Thnks
Bala
hi,
Im using qt4.0 in debian. i want to disable the move in every window.
im using QDialog , QMainwindow. im using frameless window,but when i use alt+spacebar , i can able to move the window.
Is there any way to disable the move option
Thnks
Bala
You can override the move event, and move the window back to its position every time it gets moved.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Thnks for the reply
any examples pls
Bala
read the documentation for QWidget::moveEvent()
http://doc.trolltech.com/4.5/qwidget.html#moveEvent
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
hi, highflyer,
i wrote the below code, idea is working but system was hanged .
any other ways to solve?
void MainWindow::moveEvent(QMoveEvent *event)
{
this->move(0,0);
}
Bala
Try this:
Qt Code:
{ event->ignore(); }To copy to clipboard, switch view to plain text mode
hi yogesh
event.ignore() is not working. below is my code
void MainWindow::moveEvent(QMoveEvent *event)
{
event->ignore();
}
Thnks
Bala
come on, read the docs for move() and QMoveEvent! Work with QMoveEvent::oldPos() (As it is mentioned in the docs for QWidget::moveEvent()!!!)
And if you are not able to solve such an easy task, please use the Newbie section next time. We will help you also there...
hi lykurg,
Thnks for the reply. pls understand my question.
i have tried oldpos() and move(0,0),ignore()
but oldpos(),ignore() is not working completely.
move(0,0) is working but the system hangs on.
Below is my code
Qt Code:
{ pos()=event->oldPos(); //event->ignore(); //this->move(0,0); //this->pos().setX(0); //this->pos().setY(0); }To copy to clipboard, switch view to plain text mode
The control goes to moveevent when im moving the window. but im not getting the desired results.
how to disable the MOVE option in the MENU ,[which comes by pressing ALT-SPACEBAR] ?
I want to have a FIXED window, which cannot be moved.
pls direct me to solve this problem
Thnks
Bala
Qt Code:
{ }To copy to clipboard, switch view to plain text mode
or you can use a frameless window.
BalaQT (27th December 2009)
Thnks Lykurg
Its working.
I want one more option.
since the EVENT places the form in new position,
the form is flickering while trying to MOVE. The window is fixed but flickering occurs.
Is there any way to Disable the MOVE option in the MENU [which comes by pressing ALT + SPACE BAR.]
My window is : Frameless MDI window.
im using the setWindowFlags(Qt::FramelessWindowHint);
But it will be helpful,if we can disable the MOVE option in the menu.
Thnks
Bala
Last edited by BalaQT; 27th December 2009 at 11:52.
Bookmarks