Results 1 to 7 of 7

Thread: Error "has triggered a breakpoint" when trying to call members of QSpinBox in Debug

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2015
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Error "has triggered a breakpoint" when trying to call members of QSpinBox in Deb

    Dear d_stranz,

    I posted the minimal example for better overview, however, the problem is still there, if i incorporate it into a "proper GUI application" (see below).

    main.cpp:
    Qt Code:
    1. #include <QApplication>
    2.  
    3. #include <TestWindow.h>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. int i=777; //some random value
    8.  
    9. QApplication app(argc, argv);
    10. TestWindow w;
    11. w.show();
    12. i= app.exec();
    13.  
    14. return i;
    15. }
    To copy to clipboard, switch view to plain text mode 


    TestWindow.h:
    Qt Code:
    1. #ifndef TESTWINDOW_H
    2. #define TESTWINDOW_H
    3.  
    4. #include <QMainWindow>
    5.  
    6. namespace Ui {
    7. class TestWindow;
    8. }
    9.  
    10. class TestWindow : public QMainWindow
    11. {
    12. Q_OBJECT
    13.  
    14. public:
    15. explicit TestWindow(QWidget *parent = 0);
    16. ~TestWindow();
    17.  
    18. private:
    19. Ui::TestWindow *ui;
    20. };
    21.  
    22. #endif // TESTWINDOW_H
    To copy to clipboard, switch view to plain text mode 


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


    TestWindow.ui:
    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <?xml version="1.0" encoding="UTF-8"?>
    3. <ui version="4.0">
    4. <class>TestWindow</class>
    5. <widget class="QWidget" name="TestWindow">
    6. <property name="geometry">
    7. <rect>
    8. <x>0</x>
    9. <y>0</y>
    10. <width>400</width>
    11. <height>300</height>
    12. </rect>
    13. </property>
    14. <property name="windowTitle">
    15. <string>Form</string>
    16. </property>
    17. <widget class="QSpinBox" name="spinBox">
    18. <property name="geometry">
    19. <rect>
    20. <x>100</x>
    21. <y>70</y>
    22. <width>42</width>
    23. <height>22</height>
    24. </rect>
    25. </property>
    26. </widget>
    27. </widget>
    28. <resources/>
    29. <connections/>
    30. </ui>
    To copy to clipboard, switch view to plain text mode 


    If I run this in DEBUG, then I get the runtime error "..has triggered a breakpoint" as soon as I close the window.
    If I replace the QSpinBox with a QLineEdit, then the runtime error at closing of the window disappears.
    However, if I add some text to the QLineEdit while the window is open, I get the same error. It seems that the application can not handle it, if any QWidgets (like QLineEdit or QSpinBox) hold data during runtime.

    I also noticed that when compiling in DEBUG, I get the warning
    "Warning 1 warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification C:\svn\SpielwieseQt\_build_x64_vc11\LINK". Not sure, if this is related to the problem I described.

    Any ideas on how to approach this?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,233
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Error "has triggered a breakpoint" when trying to call members of QSpinBox in Deb

    When I create a new project and paste your code into the UI file, it runs just fine. This is with VS 2013, Qt 5.4.1. I doubt the VS version has anything to do with it. Are you sure you are linking with the same version of Qt that is loaded at run-time? That is, is your PATH environment variable pointing to the same location for Qt runtime DLLs as you are specifying in your linker options?

  3. #3
    Join Date
    Jul 2015
    Posts
    22
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Error "has triggered a breakpoint" when trying to call members of QSpinBox in Deb

    It turned out that it was a problem with the 5.4.1 build of the lib. Using another build (Qt5.5) solved the problem.

  4. #4
    Join Date
    Apr 2020
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Error "has triggered a breakpoint" when trying to call members of QSpinBox in Deb

    how do you change the build of qt ??

  5. #5
    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 "has triggered a breakpoint" when trying to call members of QSpinBox in Deb

    Use the Maintenance Tool to download a different version of the Qt libraries, or download Qt and build from source if that's how you get Qt, and rebuild your application using it.

    Hijacking a five year old thread is not the best way to get attention.

Similar Threads

  1. Replies: 5
    Last Post: 15th August 2014, 03:04
  2. Replies: 1
    Last Post: 10th October 2012, 08:46
  3. Replies: 0
    Last Post: 21st February 2010, 18:09
  4. Replies: 3
    Last Post: 15th February 2010, 17:27
  5. Replies: 3
    Last Post: 29th August 2009, 22:24

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.