Results 1 to 2 of 2

Thread: Adding dialogs in MainWindow as New Tab

  1. #1
    Join Date
    Apr 2014
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Adding dialogs in MainWindow as New Tab

    I am new to QT and using QT 4.8. I have an application code which has a MainDialog and at certain time or user actions some new modeless dialogs comes.
    Now I want to show these new modeless dialogs within the MainDialog window in new tab.(may be stackedwidget is what they call in QT) I want to have both options in my application based on some pref in registry. so if user check this option the new dialogs will come in a new tab or else the same way.
    The dialogs are shown as show() method as of now.
    My main window is like class MainWindow : public QMainWindow
    and new dialogs which I am talkin about is derived by QDialog
    class mydialog : public QDialog
    How can I do this to show existing modeless dialogs as Tabbed in main window... ? Please suggest

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Adding dialogs in MainWindow as New Tab

    You can reparent a QDialog to remove the top level window hints.

    But I think in your case it makes more sense to have the actual content as a QWidget derived class and then, depending on preference, either add it to a QTabWidget or to a QDialog.

    Cheers,
    _

Similar Threads

  1. Replies: 13
    Last Post: 26th March 2014, 13:31
  2. Closing Modeless Dialogs from MainWindow Application
    By jeffd589 in forum Qt Programming
    Replies: 1
    Last Post: 12th February 2013, 01:36
  3. Dialogs in MainWindow
    By darkav17 in forum Qt Programming
    Replies: 4
    Last Post: 15th January 2013, 01:14
  4. Closing all of the mainWindow's child dialogs
    By JPNaude in forum Qt Programming
    Replies: 4
    Last Post: 2nd October 2008, 14:18
  5. MainWindow+Dialogs
    By fruzzo in forum Qt Programming
    Replies: 3
    Last Post: 20th May 2008, 09:52

Tags for this Thread

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.