Results 1 to 6 of 6

Thread: Can't create a correct child of qApp->activewindow

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Can't create a correct child of qApp->activewindow

    I want to create an instance of a custom widget created 'onthefly' , and I dont want it was viewed at the task bar (Windows).

    Because My class does not receive any Qwidget parent I use qApp->activeWindow())

    QWidget *a=new QWidget(qApp->activeWindow());
    a->setWindowFlags(Qt::Window);
    a->show();

    Ok, I see two applications into the taskbar
    Any help ?

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

    Default Re: Can't create a correct child of qApp->activewindow

    What does qApp->activeWindow() return at this moment?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can't create a correct child of qApp->activewindow

    mmm I'm afraid that... nothing.
    The app is not created because I use:

    Qt Code:
    1. QApplication a(argc, argv);
    2. MainWindow w;
    3. w.show(); return a.exec();
    To copy to clipboard, switch view to plain text mode 

    Inside mainwindow contructor I have a code to create a new Qwidget-Window, but still I have no app.>actiwindow .....
    Any help ? Can I force the creation of main app in some way ?
    Thanks

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

    Default Re: Can't create a correct child of qApp->activewindow

    You need to have an active window for activeWindow() to return something. An active window is a window which has the keyboard focus, apparently this is not the case for you.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can't create a correct child of qApp->activewindow

    Yes I understand it.
    My goal is to create a new window owned by the main and NOT showed at the taskbar (passing the proper QTflags and a parent)
    I can do it if a window is already showed
    Is there a way to do what I want or have I to wait until the mainwindow is showed ?
    Thanks

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

    Default Re: Can't create a correct child of qApp->activewindow

    You can pass a pointer to the other window.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Create a QWidget as child of a Win32 window
    By BenPa in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 29th March 2011, 15:35
  2. How to Create child widget behind parent widget?
    By anupamgee in forum Qt Programming
    Replies: 6
    Last Post: 22nd June 2010, 14:03
  3. Replies: 8
    Last Post: 7th May 2009, 15:38
  4. activeWindow control problem
    By batileon in forum Newbie
    Replies: 3
    Last Post: 17th October 2008, 08:44
  5. ActiveWindow changes after closing QFileDialog
    By mischi in forum Qt Programming
    Replies: 3
    Last Post: 13th July 2006, 13:45

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.