|
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();
}
|
|