Independant window in an application
I need to create for an application a window which can go out of the main window of the application. So I thought about creatin a widget with no parent. But I then have several problems :
¤ if I destroy the main window I still need to destroy the second window to stop the application,
¤ I have a box for this independant winodw in the systray,
¤ I need absolute coordinates of a UI widget of the main window to place the independant window but I only get relative coordinates atm
Is there an alternative way to do so, or do you know hoiw to avoid the problems I have ?
About destruction I figure how to do but I don't find the solution for the 2 other problems.
Re: Independant window in an application
Quote:
Originally Posted by
titoo
¤ if I destroy the main window I still need to destroy the second window to stop the application,
Delete the window from the other window's destructor.
Quote:
¤ I have a box for this independant winodw in the systray,
Try setting the Qt::Tool window flag while creating the window.
Quote:
¤ I need absolute coordinates of a UI widget of the main window to place the independant window but I only get relative coordinates atm
Use QWidget::mapToGlobal()
Quote:
Is there an alternative way to do so, or do you know hoiw to avoid the problems I have ?
Depends what exactly is that you want to achieve.
Re: Independant window in an application
well a windows son of the main windows should be ok but i need to get this window to be able to be partly or completely out of the main window and i think that inheritance will definitely not allow me to do this.
Re: Independant window in an application
Have you tried this?
Code:
mw->show();
dlg->show();
What inheritance are we talking about here?
Re: Independant window in an application
looks like QDialog allows me to get the window out of the main window, sounds good ty