Results 1 to 5 of 5

Thread: Independant window in an application

  1. #1
    Join Date
    Feb 2007
    Posts
    12

    Default 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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Independant window in an application

    Quote Originally Posted by titoo View Post
    ¤ 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.

    ¤ I have a box for this independant winodw in the systray,
    Try setting the Qt::Tool window flag while creating the window.

    ¤ 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()
    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.

  3. #3
    Join Date
    Feb 2007
    Posts
    12

    Default 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.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Independant window in an application

    Have you tried this?
    Qt Code:
    1. QDialog dlg = new QDialog(mw);
    2. mw->show();
    3. dlg->show();
    To copy to clipboard, switch view to plain text mode 

    What inheritance are we talking about here?

  5. #5
    Join Date
    Feb 2007
    Posts
    12

    Default Re: Independant window in an application

    looks like QDialog allows me to get the window out of the main window, sounds good ty

Similar Threads

  1. accessing my main application window widget
    By jayw710 in forum Newbie
    Replies: 8
    Last Post: 15th November 2007, 19:33
  2. move parent window to the front.
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2007, 08:41
  3. Background QT application.
    By Thrantor in forum Qt Programming
    Replies: 4
    Last Post: 12th September 2006, 22:29
  4. cannot make a main window modal
    By Dark_Tower in forum Qt Programming
    Replies: 12
    Last Post: 23rd March 2006, 10:21
  5. Replies: 0
    Last Post: 21st February 2006, 16:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.