parent nodes: QtApuntes

Making Connections

Un programa con un botón para cerrar.

// quit.cpp file
#include <qapplication.h>
#include <qpushbutton.h>
int main( int argc, char * argv[] )
{
    QApplication app( argc, argv );
    QPushButton * button = new QPushButton( "Quit", 0 );
    QObject::connect( button, SIGNAL( clicked() ),  &app, SLOT( quit() ) );
    app.setMainWidget( button );
    button->show();
    return app.exec();
}

cd quit
qmake -project
qmake quit.pro


Abrir el editor de IU y crear lo siguiente:

QHBox (horizontal layout box) que será el main widget.
Dentro de la caja horizontal pondremos un QSpinBox y un QSlider