Results 1 to 2 of 2

Thread: How to hide from taskbar a form showed form mainwindow

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

    Default How to hide from taskbar a form showed form mainwindow

    I'm used exec() to show my form in 'modal' way from the main window.

    Qt Code:
    1. NewForm newform(this);
    2. newform.exec();
    To copy to clipboard, switch view to plain text mode 

    But, I see the my main app and the second form names at the task bar.
    Logically i'm talking about Windows...
    Any idea ?
    Thanks

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to hide from taskbar a form showed form mainwindow

    Hi!

    If NewForm is a descendant of QDialog and this refers to a Widget this should work as it is!

    For a normal window you need to set the parent, and the windowFlags to Window if you still want a resizable window frame..

    Qt Code:
    1. #include <QtCore>
    2. #include <QtGui>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7.  
    8. a.show();
    9.  
    10. QWidget b(&a);
    11. b.setWindowFlags(Qt::Window);
    12. b.show();
    13.  
    14. QDialog d(&a);
    15. d.exec();
    16.  
    17. return app.exec();
    18. }
    To copy to clipboard, switch view to plain text mode 

    The above code produces 3 windows with only one taskbar entry..

    Joh

Similar Threads

  1. Pass variable from a form to another form
    By dark1988 in forum Qt Programming
    Replies: 5
    Last Post: 8th February 2011, 19:19
  2. Hiding a form and opening another form
    By anafor2004 in forum Newbie
    Replies: 1
    Last Post: 20th February 2008, 16:04
  3. Replies: 3
    Last Post: 15th November 2007, 14:09
  4. Show or hide a form
    By Gayathri in forum Newbie
    Replies: 11
    Last Post: 17th November 2006, 13:39
  5. Menubar in mainwindow form
    By Draximillian in forum Qt Tools
    Replies: 5
    Last Post: 13th April 2006, 03:26

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.