#include <QtGui>
#include "holamensaje.h"
holamensaje
::holamensaje(QWidget *parent
){
connect(holabutton, SIGNAL(clicked()),this, SLOT(hola()));
QObject::connect(salirbutton,
SIGNAL(clicked
()),
this,
SLOT(quit
()));
layout->addWidget(holabutton);
layout->addWidget(salirbutton);
mainLayout->addWidget(holabutton, 0, 0);
mainLayout->addWidget(salirbutton, 0, 1);
setLayout(layout);
setWindowTitle("Hola Mensaje");
resize(250, 100);
}
void holamensaje::hola()
{
msgBox.setText("Hola Mundo!!!");
msgBox.exec();
}
#include <QtGui>
#include "holamensaje.h"
holamensaje::holamensaje(QWidget *parent)
: QWidget(parent)
{
holabutton = new QPushButton("Hola");
salirbutton = new QPushButton("Salir");
connect(holabutton, SIGNAL(clicked()),this, SLOT(hola()));
QObject::connect(salirbutton, SIGNAL(clicked()),this, SLOT(quit()));
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(holabutton);
layout->addWidget(salirbutton);
QGridLayout *mainLayout = new QGridLayout;
mainLayout->addWidget(holabutton, 0, 0);
mainLayout->addWidget(salirbutton, 0, 1);
setLayout(layout);
setWindowTitle("Hola Mensaje");
resize(250, 100);
}
void holamensaje::hola()
{
QMessageBox msgBox;
msgBox.setText("Hola Mundo!!!");
msgBox.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks