Results 1 to 5 of 5

Thread: Error in adding QTabWidget to QDialog

  1. #1
    Join Date
    Jun 2009
    Location
    Bangalore
    Posts
    21
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Error in adding QTabWidget to QDialog

    Hi,

    I am trying to create UI like..

    template.jpg
    for this created a subclass from QDialog and trying to add Menubar and Tabwidget via QVBoxLayout, I am able to add MenuBar successfully, but when I add Tabwidget ..

    Qt Code:
    1. TabWidget = new QTabWidget();
    2. TabWidget->addTab(new QWidget(),tr("Tab 1"));
    3. VerticalLayout->addWidget(TabWidget);
    To copy to clipboard, switch view to plain text mode 

    Getting a runtime error as "Microsoft Visual C++ Runtime Library This application has requested the Runtime to terminate it in an unusual way. Please contact the application support team for more information" with OK button.

    and when I Use debugger it gives the error "Signal Received, The inferior stopped because it received a signal from Operating system"

    could someone help me out to fix this problem ?

    I am using Qt 4.8.1 in Qt Creator 2.4.1 in win 7

    Thanks,

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Error in adding QTabWidget to QDialog

    I would guess that VerticalLayout is null or not initialised. You could find out for sure by running the program in your debugger. When it stops look at the back trace to see which line of your code is the culprit.

  3. #3
    Join Date
    Jun 2009
    Location
    Bangalore
    Posts
    21
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Error in adding QTabWidget to QDialog

    I have initialized vertical layout before using it
    Qt Code:
    1. QVBoxLayout* VerticalLayout = new QVBoxLayout;
    To copy to clipboard, switch view to plain text mode 
    in the same way I am adding a menu bar to the layout, and it works as I said in my post, but only the problem with adding the tab widget to the layout, the debugger exactly showing the "Signal received" error in
    Qt Code:
    1. VerticalLayout->addWidget(TabWidget);
    To copy to clipboard, switch view to plain text mode 
    line.

    any help ?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Error in adding QTabWidget to QDialog

    You haven't bothered with the advice already given.
    You could find out for sure by running the program in your debugger. When it stops look at the back trace to see which line of your code is the culprit.
    If that is the line it dies on the one or both of the pointers is probably null or invalid.

  5. #5
    Join Date
    Jun 2009
    Location
    Bangalore
    Posts
    21
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Error in adding QTabWidget to QDialog

    Got it ... It was my mistake that, not calling a method which initialising the TabWidget object. Thanks Chris.

Similar Threads

  1. Replies: 2
    Last Post: 21st November 2011, 17:48
  2. Adding a widget to a QTabWidget
    By alitoh in forum Newbie
    Replies: 2
    Last Post: 8th November 2011, 06:57
  3. Adding tabs in a QTabWidget
    By Hogwarts in forum Qt Programming
    Replies: 3
    Last Post: 8th February 2011, 19:40
  4. [QTabWidget] Adding additional button
    By winuser in forum Newbie
    Replies: 1
    Last Post: 3rd December 2010, 12:56
  5. Adding QGroupBox to QTabWidget
    By mclark in forum Newbie
    Replies: 2
    Last Post: 17th January 2007, 16:27

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.