Been trying to create a custom tab widget that will auto-fill itself with a user-definable number of Faders.. each fader being a custom widget composed of a few buttons and a slider. I'm not really sure how to get started at defining a custom widget though. I've read the docs concerning the "vcr" example, but I can't find the original sources for the example. They say:
Vcr
::Vcr( QWidget *parent,
const char *name
) {
layout->setMargin( 0 );
layout->addWidget( rewind );
Vcr::Vcr( QWidget *parent, const char *name )
: QWidget( parent, name )
{
QHBoxLayout *layout = new QHBoxLayout( this );
layout->setMargin( 0 );
QPushButton *rewind = new QPushButton( QPixmap( rewind_xpm ), 0, this, "vcr_rewind" );
layout->addWidget( rewind );
To copy to clipboard, switch view to plain text mode
We create a QHBoxLayout in which we'll place the buttons. We've only shown the rewind button in the code above since all the others are identical except for the names of the buttons, pixmaps and signals. For each of the buttons we require we call the QPushButton constructor passing it the appropriate embedded pixmap. We then add it to the layout. Finally we connect the button's clicked() signal to the appropriate signal. Since the clicked() signals aren't specific to our widget we want to emit signals that reflect the widget's use. The rewind(), play(), etc. signals are meaningful in the context of our widget so we propagate each button's clicked() signal to the appropriate widget-specific signal.
I dont understand, though, which part of that code composes the "signal" aspect.. as I see no "emit" or "connect" or anything of the sort.
Could someone perhaps give me an example of a qpushbutton ("Foo"), that will cause the parent container to give a "button1-presseddown" signal when it is pressed? I dont need custom pixmaps or anything, I just need a way to get three or four widgets into one container, and to be able to receive signals from the container instead of the individual buttons.
Thank you
Bookmarks