找回密码
 立即注册
收起左侧

:-1: warning: Exception at 0x7fefd69965d, code: 0xe06d7363: C++ exception, fl...

0
回复
8032
查看
[复制链接]
累计签到:10 天
连续签到:1 天
来源: 2016-8-29 00:35:00 显示全部楼层 |阅读模式
1Qter豆
本帖最后由 cj747506125 于 2016-8-29 00:39 编辑

简单的小程序,但是执行的时候总是出现两个警告,求大神指点一下,错在哪里,这样的错怎么排查,谢谢
:-1: warning: Exception at 0x7fefd69965d, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance)
:-1: warning: Exception at 0x7fefd69965d, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance)

类定义头文件
#ifndef FINDDLG_H
#define FINDDLG_H
#include<QDialog>
class QHBoxLayout;
class QCheckBox;
class QLineEdit;
class QPushButton;
class QLabel;
class FindDlg:public QDialog
{   
Q_OBJECT
public:   
FindDlg(QWidget *parent=0);   
~FindDlg();
signals:  
  void findText(const QString &str);
public slots:
   void slotclose();
public:   
QHBoxLayout *hboxLayout;
    QPushButton *button;
    QLineEdit *lineEdit;
    QLabel *label;
public:   void adjustRect(const QRect &rect);
   void adjustSize(const QSize &size);};
#endif // FINDDLG_H

类定义实现文件:

#include<QHBoxLayout>
#include<QPushButton>
#include<QLineEdit>
#include<QLabel>
#include"finddlg.h"
FindDlg::FindDlg(QWidget *parent)   
:QDialog(parent)
{   
button=new QPushButton;  
  button->setDefault(false);
    lineEdit=new QLineEdit;
    hboxLayout=new QHBoxLayout;
    label=new QLabel;
    label->setBuddy(lineEdit);
    hboxLayout->addWidget(button);
   hboxLayout->addWidget(lineEdit);
    hboxLayout->addWidget(label);
    this->setLayout(hboxLayout);
    QObject::connect(button,SIGNAL(clicked()),this,SLOT(slotclose()));
   this->setFixedHeight(sizeHint().height());
}
FindDlg::~FindDlg(){}
void FindDlg::slotclose()
{  
  this->close();
}
void FindDlg::adjustRect(const QRect &rect)
{   
this->setGeometry(rect);
}
void FindDlg::adjustSize(const QSize &size)
{   
this->setBaseSize(size);
}

主函数

#include<QApplication>
#include"finddlg.h"
int main(int argc,char *argv[])
{    QApplication app(argc,argv);
    FindDlg fDlg;
    fDlg.show();
    QRect rect;
    rect=QRect(100,100,300,400);
   // fDlg.adjustRect(rect);
    return app.exec();
}

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

公告
可以关注我们的微信公众号yafeilinux_friends获取最新动态,或者加入QQ会员群进行交流:190741849、186601429(已满) 我知道了