#include <QLabel>
#include <QTextLine>
#include <QtGui>
//#include <QLineEdit>
#include "ojimetro.h"
Window::Window()
{
setFixedSize(800, 600);
// salir->setGeometry(1, 1, 75, 30);
//probar->setGeometry(76, 1, 75, 30);
//viendo->setGeometry(150,1,40,40);
connect(salir, SIGNAL(clicked()), qApp, SLOT(quit()));
connect(probar,SIGNAL(clicked()),this,SLOT(copia()));
//renderArea->setGeometry(90,100,350,200);
mainLayout->setColumnStretch(0, 1);
mainLayout->setColumnStretch(3, 1);
mainLayout->addWidget(renderArea, 0, 0, 1, 4);
mainLayout->setRowMinimumHeight(1, 6);
mainLayout->addWidget(viendo, 2, 1, Qt::AlignRight);
mainLayout->addWidget(lineat, 2, 2);
mainLayout->addWidget(salir, 3, 1, Qt::AlignRight);
mainLayout->addWidget(probar, 3, 2);
setLayout(mainLayout);
//renderArea->adjustSize();
//dato=lineat->text();
setWindowTitle(tr("Ojimetro v0.1"));
}
void Window::copia()
{
int a,b,c;
int poin;
a=1;
//texto1=lineat->text();
//this->lineat->setText("oo");
//qDebug() << this->lineat->text();
b=2;
c=0;
lineat->setText("hola!!!");
c=a+b;
a=2;
}
#include <QLabel>
#include <QTextLine>
#include <QtGui>
//#include <QLineEdit>
#include "ojimetro.h"
Window::Window()
{
setFixedSize(800, 600);
QPushButton *salir = new QPushButton(tr("Salir"), this);
// salir->setGeometry(1, 1, 75, 30);
salir->setFont(QFont("Times", 18, QFont::Bold));
QPushButton *probar = new QPushButton(tr("Probar"), this);
//probar->setGeometry(76, 1, 75, 30);
probar->setFont(QFont("Times", 18, QFont::Bold));
QLabel *viendo=new QLabel(tr("viendo"),this);
//viendo->setGeometry(150,1,40,40);
QLineEdit *lineat=new QLineEdit("casa",this);
connect(salir, SIGNAL(clicked()), qApp, SLOT(quit()));
connect(probar,SIGNAL(clicked()),this,SLOT(copia()));
//renderArea->setGeometry(90,100,350,200);
QGridLayout *mainLayout = new QGridLayout;
mainLayout->setColumnStretch(0, 1);
mainLayout->setColumnStretch(3, 1);
mainLayout->addWidget(renderArea, 0, 0, 1, 4);
mainLayout->setRowMinimumHeight(1, 6);
mainLayout->addWidget(viendo, 2, 1, Qt::AlignRight);
mainLayout->addWidget(lineat, 2, 2);
mainLayout->addWidget(salir, 3, 1, Qt::AlignRight);
mainLayout->addWidget(probar, 3, 2);
setLayout(mainLayout);
//renderArea->adjustSize();
//dato=lineat->text();
setWindowTitle(tr("Ojimetro v0.1"));
}
void Window::copia()
{
int a,b,c;
QString texto1;
int poin;
a=1;
//texto1=lineat->text();
//this->lineat->setText("oo");
//qDebug() << this->lineat->text();
b=2;
c=0;
lineat->setText("hola!!!");
c=a+b;
a=2;
}
To copy to clipboard, switch view to plain text mode
when im debugging, the debugger stops at lineat->setText("hola!!!") and shows the segmentation fault
Bookmarks