Results 1 to 3 of 3

Thread: Unhandled exception at 0x671b13c2 (QtCored4.dll), Breaking there

  1. #1
    Join Date
    Oct 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Unhandled exception at 0x671b13c2 (QtCored4.dll), Breaking there

    I am trying to include a widget i created in another file in my main window file. I get no compile or link errors ,but it will end up breaking on this line in my qobject.h file. I think maybe i am not declaring something right ,but i really have no idea. Any help that can be provided is welcome
    Qt Code:
    1. inline QObject *parent() const { return d_ptr->parent; }
    To copy to clipboard, switch view to plain text mode 

    iconArea.h

    Qt Code:
    1. #ifndef ICONAREA_H
    2. #define ICONAREA_H
    3.  
    4. #include <QtGui/QMainWindow>
    5. #include <QWidget>
    6.  
    7. class iconArea : public QWidget
    8. {
    9. Q_OBJECT
    10.  
    11. public:
    12. iconArea(QWidget *parent =0);
    13. void setIcon(const QIcon &icon);
    14. void setSize(const QSize &size);
    15. private:
    16. QIcon icon;
    17. QSize size;
    18. void createIcons();
    19.  
    20. };
    21.  
    22. #endif // ICONAREA_H
    To copy to clipboard, switch view to plain text mode 

    iconarea.cpp

    Qt Code:
    1. #include "iconarea.h"
    2.  
    3. #include <QLayout>
    4. #include <QPushButton>
    5.  
    6. iconArea::iconArea(QWidget *parent)
    7. : QWidget(parent)
    8. {
    9. QGridLayout *mainLayout = new QGridLayout;
    10. setLayout(mainLayout);
    11.  
    12. QPushButton *button1 = new QPushButton;
    13. button1->setIcon(QIcon("light.png"));
    14. button1->setIconSize(QSize(80,80));
    15.  
    16. QPushButton *button2 = new QPushButton;
    17. button2->setIcon(QIcon("cloud.png"));
    18. button2->setIconSize(QSize(80,80));
    19.  
    20. QPushButton *button3 = new QPushButton;
    21. button3->setIcon(QIcon("Control.gif"));
    22. button3->setIconSize(QSize(80,80));
    23.  
    24. QPushButton *button4 = new QPushButton;
    25. button4->setIcon(QIcon("images.jpg"));
    26. button4->setIconSize(QSize(80,80));
    27.  
    28. QPushButton *button5 = new QPushButton;
    29. button5->setIcon(QIcon("upgrade.png"));
    30. button5->setIconSize(QSize(80,80));
    31.  
    32. QPushButton *button6 = new QPushButton;
    33. button6->setIcon(QIcon("power.gif"));
    34. button6->setIconSize(QSize(80,80));
    35.  
    36. mainLayout->addWidget(button1, 0,0);
    37. mainLayout->addWidget(button2, 0,1);
    38. mainLayout->addWidget(button3, 1,0);
    39. mainLayout->addWidget(button4, 1,1);
    40. mainLayout->addWidget(button5, 2,0);
    41. mainLayout->addWidget(button6, 2,1);
    42. }
    43.  
    44. void createIcons()
    45. {
    46.  
    47. }
    To copy to clipboard, switch view to plain text mode 

    seniorgui.cpp

    Qt Code:
    1. #include "seniorgui.h"
    2. #include "iconArea.h"
    3. #include <QtGui>
    4. seniorGui::seniorGui(QWidget *parent, Qt::WFlags flags)
    5. : QMainWindow(parent, flags)
    6. {
    7. centralWidget = new QWidget;
    8. setCentralWidget(centralWidget);
    9.  
    10. QGridLayout *mainLayout = new QGridLayout;
    11. mainLayout->addWidget(previewArea, 0, 0, 0, 0);
    12. centralWidget->setLayout(mainLayout);
    13.  
    14. createActions();
    15. createMenus();
    16. createToolBars();
    17.  
    18. setWindowTitle(tr("ModBus TCP/IP Senior Gui"));
    19. resize(minimumSizeHint());
    20.  
    21. }
    22.  
    23. void seniorGui::closeEvent(QCloseEvent *event)
    24. {
    25.  
    26. }
    27.  
    28. void seniorGui::about()
    29. {
    30. QMessageBox::about(this, tr("About Application"),
    31. tr("This is a <b>Application</b> that will use"
    32. "ModBus TCP/IP to connect and control several devices"));
    33. }
    34.  
    35. void seniorGui::createActions()
    36. {
    37. connectAct = new QAction(QIcon("connect.png"), tr("&Connect"), this);
    38. //connectAct = setShortcuts(QKeySequence::Connect);
    39. connectAct->setStatusTip(tr("Connect to IP Address"));
    40. //connect(connectAct, SIGNAL(clicked()), this, SLOT(connectFile()));
    41.  
    42. helpAct = new QAction(QIcon("help.gif"), tr("&help"), this);
    43. //connectAct = setShortcuts(QKeySequence::Connect);
    44. helpAct->setStatusTip(tr("Let's Help you out"));
    45. //connect(helpAct, SIGNAL(clicked()), this, SLOT(helpFile()));
    46.  
    47. qtAct = new QAction(QIcon("qt.png"), tr("&Qt"), this);
    48. //connectAct = setShortcuts(QKeySequence::Connect);
    49. qtAct->setStatusTip(tr("Learn more about Qt"));
    50. //connect(newAct, SIGNAL(clicked()), this, SLOT(qtHelp()));
    51.  
    52. disconnectAct = new QAction(QIcon("Disconnect.png"), tr("&Disconnect"), this);
    53. //connectAct = setShortcuts(QKeySequence::Connect);
    54. disconnectAct->setStatusTip(tr("Disconnecting from Module"));
    55. //connect(newAct, SIGNAL(clicked()), this, SLOT(disconnectFile()));
    56.  
    57. }
    58.  
    59. void seniorGui::createToolBars()
    60. {
    61. fileToolBar = addToolBar(tr("Connect"));
    62. fileToolBar->addAction(connectAct);
    63. fileToolBar->addAction(disconnectAct);
    64.  
    65. fileToolBar = addToolBar(tr("Help"));
    66. fileToolBar->addAction(helpAct);
    67. fileToolBar->addAction(qtAct);
    68.  
    69.  
    70. }
    71. void seniorGui::createMenus()
    72. {
    73. fileMenu = menuBar()->addMenu(tr("&File"));
    74. fileMenu->addAction(connectAct);
    75. fileMenu->addAction(disconnectAct);
    76.  
    77. fileMenu = menuBar()->addMenu(tr("&Help"));
    78. fileMenu->addAction(helpAct);
    79. fileMenu->addAction(qtAct);
    80. }
    81. /*
    82.  void seniorGui::createStatusBars()
    83.  {
    84. statusBar()->showMessage(tr("Ready"));
    85.  }
    86. */
    To copy to clipboard, switch view to plain text mode 

    seniorgui.h

    Qt Code:
    1. #ifndef SENIORGUI_H
    2. #define SENIORGUI_H
    3.  
    4. #include <QtGui>
    5. #include <QIcon>
    6. #include <QLayout>
    7.  
    8. class QAction;
    9. class QMenu;
    10. class iconArea;
    11.  
    12. class seniorGui : public QMainWindow
    13. {
    14. Q_OBJECT
    15.  
    16. public:
    17. seniorGui(QWidget *parent = 0, Qt::WFlags flags = 0);
    18.  
    19. protected:
    20. void closeEvent(QCloseEvent *event);
    21. private slots:
    22. void about();
    23.  
    24. private:
    25. void createActions();
    26. void createMenus();
    27. void createToolBars();
    28.  
    29. QWidget *centralWidget;
    30.  
    31. // QGroupBox *previewGroupBox;
    32. iconArea *previewArea;
    33.  
    34. QMenu *fileMenu;
    35. QMenu *editMenu;
    36. QMenu *helpMenu;
    37.  
    38. QToolBar *fileToolBar;
    39. QToolBar *editToolBar;
    40.  
    41. QAction *aboutAct;
    42. QAction *aboutQtAct;
    43. QAction *connectAct;
    44. QAction *disconnectAct;
    45. QAction *helpAct;
    46. QAction *qtAct;
    47.  
    48. };
    49.  
    50. #endif // SENIORGUI_H
    To copy to clipboard, switch view to plain text mode 

    main.cpp

    Qt Code:
    1. #include "seniorgui.h"
    2. #include <QtGui/QApplication>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. a.setOrganizationName("");
    8. a.setApplicationName("");
    9. seniorGui w;
    10. w.show();
    11. return a.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

  2. #2
    Join Date
    Oct 2011
    Location
    CHINA
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Unhandled exception at 0x671b13c2 (QtCored4.dll), Breaking there

    you forgot this previewArea = new iconArea(); in seniorGui

  3. #3
    Join Date
    Oct 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Unhandled exception at 0x671b13c2 (QtCored4.dll), Breaking there

    Well crap that worked perfectly. So i was declaring a new object based off my iconArea class? Why was it breaking there tho?

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Unhandled Exception from DLL QT 4.6.0
    By qlarity_three in forum Newbie
    Replies: 2
    Last Post: 5th February 2010, 19:11
  3. Unhandled Exception
    By dougbroadwell in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2009, 22:32
  4. Unhandled Exception in QTableView->setModel(QSqlTableModel)
    By dougbroadwell in forum Qt Programming
    Replies: 0
    Last Post: 19th March 2009, 19:35
  5. Unhandled Exception Err
    By Masih in forum Newbie
    Replies: 9
    Last Post: 25th July 2007, 20:28

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