Results 1 to 13 of 13

Thread: how to solve the bug:the inferior stopped because it received a singal from ...

  1. #1
    Join Date
    Jan 2011
    Posts
    40
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default how to solve the bug:the inferior stopped because it received a singal from ...

    I use a dialog to call the mainwindow,but it appear the bug: the inferior stopped because it received a singal from ....I don't know why.because if i only debug the ui_mainwindow with the main.cpp,it is very normal .But once I use anther dialog to call the mainwindow , it appears
    .Someone think maybe it is the pointer's problem .so how to fix it .please,thanks.
    the full bug is :
    the inferior stopped because it received a singal from oprating system,
    signal name:sigsegv
    signal meaning:segmentation fault.


    ui_mainwindow.h file content:
    Qt Code:
    1. /********************************************************************************
    2. ** Form generated from reading UI file 'gkxt2uW4872.ui'
    3. **
    4. ** Created: Fri Dec 31 12:17:38 2010
    5. ** by: Qt User Interface Compiler version 4.7.0
    6. **
    7. ** WARNING! All changes made in this file will be lost when recompiling UI file!
    8. ********************************************************************************/
    9.  
    10. #ifndef UI_MAINWINDOW_H
    11. #define UI_MAINWINDOW_H
    12.  
    13. #include <QtCore/QVariant>
    14. #include <QtGui/QAction>
    15. #include <QtGui/QApplication>
    16. #include <QtGui/QButtonGroup>
    17. #include <QtGui/QHeaderView>
    18. #include <QtGui/QLabel>
    19. #include <QtGui/QMainWindow>
    20. #include <QtGui/QMenu>
    21. #include <QtGui/QMenuBar>
    22. #include <QtGui/QPushButton>
    23. #include <QtGui/QRadioButton>
    24. #include <QtGui/QScrollArea>
    25. #include <QtGui/QScrollBar>
    26. #include <QtGui/QStatusBar>
    27. #include <QtGui/QWidget>
    28.  
    29. QT_BEGIN_NAMESPACE
    30.  
    31. class Ui_m_window
    32. {
    33. public:
    34. QAction *menu_start;
    35. QAction *menu_exit;
    36. QAction *action_3;
    37. QAction *action_5;
    38. QAction *action_6;
    39. QAction *menu_sysset;
    40. QAction *menu_queset;
    41. QAction *menu_login;
    42. QAction *menu_bbs;
    43. QAction *menu_learn;
    44. QAction *action_12;
    45. QAction *action_14;
    46. QWidget *centralWidget;
    47. QScrollArea *scrollArea;
    48. QWidget *scrollAreaWidgetContents;
    49. QPushButton *pBut_up;
    50. QPushButton *pBut_next;
    51. QRadioButton *rBut_ans_a;
    52. QRadioButton *rBut_ans_b;
    53. QRadioButton *rBut_ans_c;
    54. QRadioButton *rBut_ans_d;
    55. QScrollArea *scrollArea_2;
    56. QWidget *scrollAreaWidgetContents_2;
    57. QScrollBar *verticalScrollBar;
    58. QLabel *label_hint;
    59. QLabel *label_time;
    60. QMenuBar *menuBar;
    61. QMenu *menu_file;
    62. QMenu *menu_tool;
    63. QMenu *menu_set;
    64. QMenu *menu_help;
    65. QStatusBar *statusBar;
    66.  
    67. void setupUi(QMainWindow *m_window)
    68. {
    69. if (m_window->objectName().isEmpty())
    70. m_window->setObjectName(QString::fromUtf8("m_window"));
    71. m_window->setEnabled(true);
    72. m_window->resize(650, 420);
    73. m_window->setMinimumSize(QSize(650, 420));
    74. m_window->setMaximumSize(QSize(650, 420));
    75. /*
    76.   menu_start = new QAction(m_window);[COLOR="red"]//the line which is wrong with something i dont know[/COLOR]
    77.   menu_start->setObjectName(QString::fromUtf8("menu_start"));
    78.   menu_start->setAutoRepeat(false);
    79.   menu_exit = new QAction(m_window);
    80.   menu_exit->setObjectName(QString::fromUtf8("menu_exit"));
    81.  
    82.   action_3 = new QAction(m_window);
    83.   action_3->setObjectName(QString::fromUtf8("action_3"));
    84.   action_5 = new QAction(m_window);
    85.   action_5->setObjectName(QString::fromUtf8("action_5"));
    86.   action_6 = new QAction(m_window);
    87.   action_6->setObjectName(QString::fromUtf8("action_6"));
    88.   menu_sysset = new QAction(m_window);
    89.   menu_sysset->setObjectName(QString::fromUtf8("menu_sysset"));
    90.   menu_queset = new QAction(m_window);
    91.   menu_queset->setObjectName(QString::fromUtf8("menu_queset"));
    92.   menu_login = new QAction(m_window);
    93.   menu_login->setObjectName(QString::fromUtf8("menu_login"));
    94.   menu_bbs = new QAction(m_window);
    95.   menu_bbs->setObjectName(QString::fromUtf8("menu_bbs"));
    96.   menu_learn = new QAction(m_window);
    97.   menu_learn->setObjectName(QString::fromUtf8("menu_learn"));
    98.   ……………some code ……………………………………
    99.   statusBar->setObjectName(QString::fromUtf8("statusBar"));
    100.   m_window->setStatusBar(statusBar);
    101.  
    102.   menuBar->addAction(menu_file->menuAction());
    103.   menuBar->addAction(menu_tool->menuAction());
    104.   menuBar->addAction(menu_set->menuAction());
    105.   menuBar->addAction(menu_help->menuAction());
    106.   menu_file->addAction(menu_start);
    107.   menu_file->addAction(menu_exit);
    108.   menu_tool->addAction(menu_login);
    109.   menu_tool->addAction(menu_bbs);
    110.   menu_tool->addAction(menu_learn);
    111.   menu_tool->addSeparator();
    112.   menu_tool->addAction(action_12);
    113.   menu_tool->addAction(action_14);
    114.   menu_set->addAction(menu_sysset);
    115.   menu_set->addAction(menu_queset);
    116.   menu_help->addAction(action_3);
    117.   menu_help->addAction(action_5);
    118.   menu_help->addAction(action_6);
    119. */
    120. retranslateUi(m_window);
    121.  
    122.  
    123. QMetaObject::connectSlotsByName(m_window);
    124. } // setupUi
    125.  
    126. void retranslateUi(QMainWindow *m_window)
    127. {
    128. m_window->setWindowTitle(QApplication::translate("m_window", "\350\200\203\350\257\225\346\265\213\350\257\225\347\263\273\347\273\237", 0, QApplication::UnicodeUTF8));
    129. menu_start->setText(QApplication::translate("m_window", "\345\274\200\345\247\213\346\265\213\350\257\225", 0, QApplication::UnicodeUTF8));
    130. menu_exit->setText(QApplication::translate("m_window", "\351\200\200\345\207\272", 0, QApplication::UnicodeUTF8));
    131. action_3->setText(QApplication::translate("m_window", "\346\263\250\345\206\214", 0, QApplication::UnicodeUTF8));
    132. action_5->setText(QApplication::translate("m_window", "\344\275\277\347\224\250\350\257\264\346\230\216", 0, QApplication::UnicodeUTF8));
    133. action_6->setText(QApplication::translate("m_window", "\347\211\210\346\235\203", 0, QApplication::UnicodeUTF8));
    134. menu_sysset->setText(QApplication::translate("m_window", "\347\263\273\347\273\237\350\256\276\347\275\256", 0, QApplication::UnicodeUTF8));
    135. menu_queset->setText(QApplication::translate("m_window", "\351\242\230\345\272\223\350\256\276\347\275\256", 0, QApplication::UnicodeUTF8));
    136. menu_login->setText(QApplication::translate("m_window", "\347\231\273\351\231\206\347\263\273\347\273\237", 0, QApplication::UnicodeUTF8));
    137. menu_bbs->setText(QApplication::translate("m_window", "\350\256\277\351\227\256\350\256\272\345\235\233", 0, QApplication::UnicodeUTF8));
    138. menu_learn->setText(QApplication::translate("m_window", "\345\234\250\347\272\277\345\255\246\344\271\240", 0, QApplication::UnicodeUTF8));
    139. action_12->setText(QApplication::translate("m_window", "\350\256\260\345\277\206\345\212\233\346\265\213\350\257\225", 0, QApplication::UnicodeUTF8));
    140. action_14->setText(QApplication::translate("m_window", "\346\216\250\347\220\206\346\265\213\350\257\225", 0, QApplication::UnicodeUTF8));
    141. pBut_up->setText(QApplication::translate("m_window", "\344\270\212\344\270\200\351\242\230\347\233\256", 0, QApplication::UnicodeUTF8));
    142. pBut_next->setText(QApplication::translate("m_window", "\344\270\213\344\270\200\351\242\230\347\233\256", 0, QApplication::UnicodeUTF8));
    143. rBut_ans_a->setText(QApplication::translate("m_window", "A", 0, QApplication::UnicodeUTF8));
    144. rBut_ans_b->setText(QApplication::translate("m_window", "B", 0, QApplication::UnicodeUTF8));
    145. rBut_ans_c->setText(QApplication::translate("m_window", "C", 0, QApplication::UnicodeUTF8));
    146. rBut_ans_d->setText(QApplication::translate("m_window", "D", 0, QApplication::UnicodeUTF8));
    147. label_hint->setText(QApplication::translate("m_window", "\351\200\211\346\213\251\347\255\224\346\241\210", 0, QApplication::UnicodeUTF8));
    148. label_time->setText(QApplication::translate("m_window", "____________", 0, QApplication::UnicodeUTF8));
    149. menu_file->setTitle(QApplication::translate("m_window", "\346\226\207\344\273\266", 0, QApplication::UnicodeUTF8));
    150. menu_tool->setTitle(QApplication::translate("m_window", "\345\267\245\345\205\267", 0, QApplication::UnicodeUTF8));
    151. menu_set->setTitle(QApplication::translate("m_window", "\350\256\276\347\275\256", 0, QApplication::UnicodeUTF8));
    152. menu_help->setTitle(QApplication::translate("m_window", "\345\270\256\345\212\251", 0, QApplication::UnicodeUTF8));
    153. } // retranslateUi
    154.  
    155. };
    156.  
    157. namespace Ui {
    158. class m_window: public Ui_m_window {};
    159. } // namespace Ui
    160.  
    161. QT_END_NAMESPACE
    162.  
    163. #endif // 5GKXT2UW4872_H
    To copy to clipboard, switch view to plain text mode 
    Last edited by Lykurg; 7th January 2011 at 08:42. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    Please note that we have [code] tags here. Further it is most unlikely that something inside the Qt generated ui-cpp file crashes. So please show us, how you use the ui file in the application. Also try to debug and see what the backtrace is saying.

  3. The following user says thank you to Lykurg for this useful post:

    wter27 (7th January 2011)

  4. #3
    Join Date
    Nov 2010
    Posts
    315
    Thanked 53 Times in 51 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    Cant you read, comments in this file?
    /************************************************** ******************************
    ** Form generated from reading UI file 'gkxt2uW4872.ui'
    **
    ** Created: Fri Dec 31 12:17:38 2010
    ** by: Qt User Interface Compiler version 4.7.0
    **
    ** WARNING! All changes made in this file will be lost when recompiling UI file!
    ************************************************** ******************************/
    This is auto generated file. So this file where error in YOUR code cause critical error. So actual error happened sooner somewhere deeper in you code.

    Run you app in debug mode from IDE. When it crushes, go to IDE window called "Call Stack". Find first file from top with YOUR code (code you have written). Click this entry in "Call stack" window.
    Check values of variables, pointer and so and try find the reason of this crush.

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

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    Just by looking at what you commented out you can see that you don't create many of the objects that you later refer to from within retranslateUi().
    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.


  6. #5
    Join Date
    Jan 2011
    Posts
    40
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    what do you mean ?create many of the objects that you later refer to from within retranslateUi(). ?
    When I debug the program file,I found that there are some tips about the win@16.My OS is windows xp sp3/NT4.0,I also installed the visual studio c++ 6.0.
    The target of the main program compiled by the QT may be the WINCE,because I found the var of Q_WINCE .Do I need to move on to the GNU/Linux or just reinstall the QT and some *.h files?

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

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    I mean that you commented out some code which is needed for another part of the code to work. This is basic C++ you know...
    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.


  8. #7
    Join Date
    Jan 2011
    Posts
    40
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    if i dont commented the code.the debug will say that:the inferior stopped...
    if i commented them ,there would be no bugs and run normally.
    so what's the reason?

  9. #8
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    Please make a minimal compilable example reproducing your problem.

  10. #9
    Join Date
    Jan 2011
    Posts
    40
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    my program was qt-sdk-win-opensource-2010.05,the os is windows xp sp3;
    my program contains :
    1.main.cpp
    2.dialog_login.cpp
    3.dialog_login.h
    4.ui_dialog_login.h
    5.temp.cpp
    6.temp.h
    7.ui_temp.h
    when i run the program and push the cancel button of dialog ,here debug comes the resualt:

    the inferior stopped beacause it recieved a signal of operating system.;
    signal name:SIGSEGV;
    signal meaning:segmentation fault;

    here's the code:

    main.cpp file content:

    Qt Code:
    1. #include <QtGui>
    2. #include <QtGui/QApplication>
    3. #include "dialog_login.h"
    4. #include "temp.h"
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc, argv);
    8. dialog_login login_box;
    9. login_box.show();
    10. if(login_box.exec()==QDialog::Rejected)//
    11. {
    12. MainWindow mainwindow;
    13. mainwindow.show();
    14. }
    15. return app.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 


    dialog_login.cpp file content:

    Qt Code:
    1. #include "dialog_login.h"
    2. dialog_login:: dialog_login(QDialog *parent)
    3. : QDialog(parent)
    4. {
    5. ui2->setupUi(this);
    6. }
    7. dialog_login::~dialog_login()
    8. {
    9. delete ui2;
    10. }
    To copy to clipboard, switch view to plain text mode 


    dialog_login.h file content:
    Qt Code:
    1. #ifndef DIALOG_LOGIN_H
    2. #define DIALOG_LOGIN_H
    3.  
    4. #include <QtGui/QDialog>
    5. #include "ui_dialog_login.h"
    6. class dialog_login : public QDialog
    7. {
    8. Q_OBJECT
    9. public:
    10. explicit dialog_login(QDialog *parent = 0);
    11. ~dialog_login();
    12. private:
    13. Ui2::dialog_login *ui2;
    14. };
    15. #endif // DIALOG_LOGIN_H
    To copy to clipboard, switch view to plain text mode 


    ui_dialog_login.h file content:

    Qt Code:
    1. #ifndef DIALOG_LOGINGK4464_H
    2. #define DIALOG_LOGINGK4464_H
    3.  
    4. #include <QtCore/QVariant>
    5. #include <QtGui/QAction>
    6. #include <QtGui/QApplication>
    7. #include <QtGui/QButtonGroup>
    8. #include <QtGui/QCheckBox>
    9. #include <QtGui/QDialog>
    10. #include <QtGui/QHeaderView>
    11. #include <QtGui/QLabel>
    12. #include <QtGui/QLineEdit>
    13. #include <QtGui/QPushButton>
    14. #include <QtWebKit/QWebView>
    15.  
    16. QT_BEGIN_NAMESPACE
    17.  
    18. class Ui_dialog_login
    19. {
    20. public:
    21. QLineEdit *lineEdit_username;
    22. QLineEdit *lineEdit_password;
    23. QLabel *label;
    24. QLabel *label_2;
    25. QPushButton *pushButton_login;
    26. QPushButton *pushButton_cancel;
    27. QCheckBox *checkBox_remberpass;
    28. QCheckBox *checkBox_loginauto;
    29. QWebView *webView_ad_login;
    30. QWebView *webView_register;
    31. QWebView *webView_getpassword;
    32.  
    33. void setupUi(QDialog *dialog_login)
    34. {
    35. if (dialog_login->objectName().isEmpty())
    36. dialog_login->setObjectName(QString::fromUtf8("dialog_login"));
    37. dialog_login->resize(393, 229);
    38. dialog_login->setMinimumSize(QSize(393, 229));
    39. dialog_login->setMaximumSize(QSize(393, 229));
    40. label = new QLabel(dialog_login);
    41. label->setObjectName(QString::fromUtf8("label"));
    42. label->setGeometry(QRect(70, 90, 61, 21));
    43. QFont font;
    44. font.setFamily(QString::fromUtf8("\345\256\213\344\275\223"));
    45. font.setPointSize(12);
    46. font.setBold(true);
    47. font.setWeight(75);
    48. label->setFont(font);
    49. label_2 = new QLabel(dialog_login);
    50. label_2->setObjectName(QString::fromUtf8("label_2"));
    51. label_2->setGeometry(QRect(70, 120, 61, 21));
    52. label_2->setFont(font);
    53. pushButton_login = new QPushButton(dialog_login);
    54. pushButton_login->setObjectName(QString::fromUtf8("pushButton_login"));
    55. pushButton_login->setGeometry(QRect(100, 180, 75, 23));
    56. pushButton_cancel = new QPushButton(dialog_login);
    57. pushButton_cancel->setObjectName(QString::fromUtf8("pushButton_cancel"));
    58. pushButton_cancel->setGeometry(QRect(210, 180, 75, 23));
    59. checkBox_remberpass = new QCheckBox(dialog_login);
    60. checkBox_remberpass->setObjectName(QString::fromUtf8("checkBox_remberpass"));
    61. checkBox_remberpass->setGeometry(QRect(100, 150, 71, 16));
    62. checkBox_loginauto = new QCheckBox(dialog_login);
    63. checkBox_loginauto->setObjectName(QString::fromUtf8("checkBox_loginauto"));
    64. checkBox_loginauto->setGeometry(QRect(190, 150, 71, 16));
    65.  
    66. retranslateUi(dialog_login);
    67. QObject::connect(pushButton_cancel, SIGNAL(clicked()), dialog_login, SLOT(reject()));
    68. QMetaObject::connectSlotsByName(dialog_login);
    69. } // setupUi
    70.  
    71. void retranslateUi(QDialog *dialog_login)
    72. {
    73. dialog_login->setWindowTitle(QApplication::translate("dialog_login", "\347\231\273\351\231\206", 0, QApplication::UnicodeUTF8));
    74. label->setText(QApplication::translate("dialog_login", "\347\224\250\346\210\267\345\220\215", 0, QApplication::UnicodeUTF8));
    75. label_2->setText(QApplication::translate("dialog_login", "\345\257\206 \347\240\201", 0, QApplication::UnicodeUTF8));
    76. pushButton_login->setText(QApplication::translate("dialog_login", "\347\231\273\351\231\206", 0, QApplication::UnicodeUTF8));
    77. pushButton_cancel->setText(QApplication::translate("dialog_login", "\345\217\226\346\266\210", 0, QApplication::UnicodeUTF8));
    78. checkBox_remberpass->setText(QApplication::translate("dialog_login", "\350\256\260\344\275\217\345\257\206\347\240\201", 0, QApplication::UnicodeUTF8));
    79. checkBox_loginauto->setText(QApplication::translate("dialog_login", "\350\207\252\345\212\250\347\231\273\351\231\206", 0, QApplication::UnicodeUTF8));
    80. } // retranslateUi
    81. };
    82.  
    83. namespace Ui2 {
    84. class dialog_login: public Ui_dialog_login {};
    85. } // namespace Ui
    86.  
    87. QT_END_NAMESPACE
    88.  
    89. #endif // DIALOG_LOGINGK4464_H
    To copy to clipboard, switch view to plain text mode 


    temp.cpp file content:

    Qt Code:
    1. #include "temp.h"
    2. MainWindow:: MainWindow(QMainWindow *parent)
    3. : QMainWindow(parent)
    4.  
    5. {
    6. ui->setupUi(this);
    7. }
    8.  
    9. MainWindow::~MainWindow()
    10. {
    11. delete ui;
    12. }
    To copy to clipboard, switch view to plain text mode 


    temp.h file content:

    Qt Code:
    1. #ifndef TEMP_H
    2. #define TEMP_H
    3.  
    4. #include <QtGui/QMainWindow>
    5. #include "ui_temp.h"
    6. class MainWindow : public QMainWindow
    7. {
    8. Q_OBJECT
    9.  
    10. public:
    11. explicit MainWindow(QMainWindow *parent = 0);
    12. ~MainWindow();
    13. private:
    14. Ui::MainWindow *ui;
    15.  
    16. };
    17. #endif // WIDGET_H
    To copy to clipboard, switch view to plain text mode 

    ui_temp.h file content,
    Qt Code:
    1. #ifndef DESIGNERKQ5184_H
    2. #define DESIGNERKQ5184_H
    3.  
    4. #include <QtCore/QVariant>
    5. #include <QtGui/QAction>
    6. #include <QtGui/QApplication>
    7. #include <QtGui/QButtonGroup>
    8. #include <QtGui/QHeaderView>
    9. #include <QtGui/QMainWindow>
    10. #include <QtGui/QMenu>
    11. #include <QtGui/QMenuBar>
    12. #include <QtGui/QStatusBar>
    13. #include <QtGui/QWidget>
    14.  
    15. QT_BEGIN_NAMESPACE
    16.  
    17. class Ui_MainWindow
    18. {
    19. public:
    20. QAction *actionMenu_login;
    21. QWidget *centralwidget;
    22. QMenuBar *menubar;
    23. QMenu *menuOpen;
    24. QStatusBar *statusbar;
    25.  
    26. void setupUi(QMainWindow *MainWindow)
    27. {
    28. if (MainWindow->objectName().isEmpty())
    29. MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
    30. MainWindow->resize(800, 600);
    31.  
    32. actionMenu_login = new QAction(MainWindow);
    33. actionMenu_login->setObjectName(QString::fromUtf8("actionMenu_login"));
    34. centralwidget = new QWidget(MainWindow);
    35. centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
    36. MainWindow->setCentralWidget(centralwidget);
    37. menubar = new QMenuBar(MainWindow);
    38. menubar->setObjectName(QString::fromUtf8("menubar"));
    39. menubar->setGeometry(QRect(0, 0, 800, 19));
    40. menuOpen = new QMenu(menubar);
    41. menuOpen->setObjectName(QString::fromUtf8("menuOpen"));
    42. MainWindow->setMenuBar(menubar);
    43. statusbar = new QStatusBar(MainWindow);
    44. statusbar->setObjectName(QString::fromUtf8("statusbar"));
    45. MainWindow->setStatusBar(statusbar);
    46.  
    47. menubar->addAction(menuOpen->menuAction());
    48. menuOpen->addAction(actionMenu_login);
    49.  
    50. retranslateUi(MainWindow);
    51.  
    52. QMetaObject::connectSlotsByName(MainWindow);
    53. } // setupUi
    54.  
    55. void retranslateUi(QMainWindow *MainWindow)
    56. {
    57. MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
    58. actionMenu_login->setText(QApplication::translate("MainWindow", "menu_login", 0, QApplication::UnicodeUTF8));
    59. menuOpen->setTitle(QApplication::translate("MainWindow", "open", 0, QApplication::UnicodeUTF8));
    60. } // retranslateUi
    61.  
    62. };
    63.  
    64. namespace Ui {
    65. class MainWindow: public Ui_MainWindow {};
    66. } // namespace Ui
    67.  
    68. QT_END_NAMESPACE
    69.  
    70. #endif // DESIGNERKQ5184_H
    To copy to clipboard, switch view to plain text mode 
    Last edited by wter27; 9th January 2011 at 13:03.

  11. #10
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    Here you use an uninitialized pointer:
    Qt Code:
    1. MainWindow:: MainWindow(QMainWindow *parent)
    2. : QMainWindow(parent)
    3.  
    4. {
    5. //should have a line like this:
    6. ui = new Ui::MainWindow;
    7. ui->setupUi(this);
    8. }
    To copy to clipboard, switch view to plain text mode 

    LE:
    same in dialog_login constructor:
    Qt Code:
    1. ui = new Ui2::dialog_login;
    2. //only then you can use
    3. ui->setupUi(this);
    To copy to clipboard, switch view to plain text mode 
    Last edited by Zlatomir; 9th January 2011 at 13:04.

  12. #11
    Join Date
    Jan 2011
    Posts
    40
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    i changed the code like you said.But it comes out the same error code.
    do i need to initializ the pointer of actionMenu_login ?Because it stopped line 32 of the file ui_temp.h .

  13. #12
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    That should be Ok, since that code is generated by UIC (unless you modified manually the ui_CLASS.h, you shouldn't do that)

    One other problem that i see (might not be related to this, i don't know what could be the result of it, but it is a problem) is that you call show() then you call exec() (i'm pretty sure that is not recommended)
    This happens in main.cpp:
    Qt Code:
    1. // login_box.show(); //comment or delete this line, because exec() will also show your (modal) dialog... so you don't need this
    2. if(login_box.exec()==QDialog::Rejected)//
    3. {
    To copy to clipboard, switch view to plain text mode 

  14. The following user says thank you to Zlatomir for this useful post:

    wter27 (9th January 2011)

  15. #13
    Join Date
    Jan 2011
    Posts
    40
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to solve the bug:the inferior stopped because it received a singal from ...

    thank you very much for the tips you give.Because my english is poor.So it's hard for me to understand the word you said .
    I would modified the code later to see the problem .

Similar Threads

  1. Got "the inferior stopped ..." when debug
    By hashb in forum Qt Programming
    Replies: 3
    Last Post: 25th December 2009, 03:16
  2. Debugging singal-slot connections
    By gnik in forum Qt-based Software
    Replies: 0
    Last Post: 11th July 2009, 19:50
  3. QResource Stopped Working
    By JPNaude in forum Qt Programming
    Replies: 0
    Last Post: 22nd October 2008, 12:26
  4. singal send twice?
    By masoroso in forum Qt Programming
    Replies: 1
    Last Post: 12th April 2007, 13:47
  5. Signals/Slots stopped working
    By Jimmy2775 in forum Qt Programming
    Replies: 8
    Last Post: 31st March 2006, 21:11

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
  •  
Qt is a trademark of The Qt Company.