#include "channelselected.h"
#include <qcheckbox.h>
#include <qpushbutton.h>
ChannelSelected
::ChannelSelected ( QWidget *parent,
const char *name
){
QVBoxLayout *box = new QVBoxLayout(this);
QHBox *hbox = new QHBox(box);
QHbox *hboxbutt= new QHBox(box);
hbox->addWidget(c0cb);
hbox->addWidget(c1cb);
hbox->addWidget(c2cb);
hbox->addWidget(c3cb);
hbox->addWidget(c4cb);
hbox->addWidget(c5cb);
hbox->addWidget(c6cb);
hboxbutt->addWidget(allpb);
hboxbutt->addWidget(clearpb);
box->addWidget(hbox);
box->addWidget(hboxbutt);
connect (allpb, SIGNAL(clicked()), c0cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c1cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c2cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c3cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c4cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c5cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c6cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c0cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c1cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c2cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c3cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c4cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c5cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c6cb, SLOT(setChecked()));
}
bool ChannelSelected::isChecked() const
{
return;
}
void ChannelSelected::setChecked()
{
c0cb->setChecked(TRUE);
c1cb->setChecked(TRUE);
c2cb->setChecked(TRUE);
c3cb->setChecked(TRUE);
c4cb->setChecked(TRUE);
c5cb->setChecked(TRUE);
c6cb->setChecked(TRUE);
}
void ChannelSelected::setUnChecked()
{
c0cb->setChecked(FALSE);
c1cb->setChecked(FALSE);
c2cb->setChecked(FALSE);
c3cb->setChecked(FALSE);
c4cb->setChecked(FALSE);
c5cb->setChecked(FALSE);
c6cb->setChecked(FALSE);
}
#include "channelselected.h"
#include <qcheckbox.h>
#include <qpushbutton.h>
ChannelSelected::ChannelSelected ( QWidget *parent, const char *name)
: QVBoxLayout (parent, name);
{
QCheckBox *c0cb = new QCheckBox ("Channel 0", this, "c0cb");
QCheckBox *c1cb = new QCheckBox ("Channel 1", this, "c1cb");
QCheckBox *c2cb = new QCheckBox ("Channel 2", this, "c2cb");
QCheckBox *c3cb = new QCheckBox ("Channel 3", this, "c3cb");
QCheckBox *c4cb = new QCheckBox ("Channel 4", this, "c4cb");
QCheckBox *c5cb = new QCheckBox ("Channel 5", this, "c5cb");
QCheckBox *c6cb = new QCheckBox ("Channel 6", this, "c6cb");
QPushButton *allpb = new QPushButton("All", this, "allpb");
QPushButton *clearpb = new QPushButton("Clear", this, "clearpb);
QVBoxLayout *box = new QVBoxLayout(this);
QHBox *hbox = new QHBox(box);
QHbox *hboxbutt= new QHBox(box);
hbox->addWidget(c0cb);
hbox->addWidget(c1cb);
hbox->addWidget(c2cb);
hbox->addWidget(c3cb);
hbox->addWidget(c4cb);
hbox->addWidget(c5cb);
hbox->addWidget(c6cb);
hboxbutt->addWidget(allpb);
hboxbutt->addWidget(clearpb);
box->addWidget(hbox);
box->addWidget(hboxbutt);
connect (allpb, SIGNAL(clicked()), c0cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c1cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c2cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c3cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c4cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c5cb, SLOT(setChecked()));
connect (allpb, SIGNAL(clicked()), c6cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c0cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c1cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c2cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c3cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c4cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c5cb, SLOT(setChecked()));
connect(clearpb, SIGNAL(clicked()), c6cb, SLOT(setChecked()));
}
bool ChannelSelected::isChecked() const
{
return;
}
void ChannelSelected::setChecked()
{
c0cb->setChecked(TRUE);
c1cb->setChecked(TRUE);
c2cb->setChecked(TRUE);
c3cb->setChecked(TRUE);
c4cb->setChecked(TRUE);
c5cb->setChecked(TRUE);
c6cb->setChecked(TRUE);
}
void ChannelSelected::setUnChecked()
{
c0cb->setChecked(FALSE);
c1cb->setChecked(FALSE);
c2cb->setChecked(FALSE);
c3cb->setChecked(FALSE);
c4cb->setChecked(FALSE);
c5cb->setChecked(FALSE);
c6cb->setChecked(FALSE);
}
To copy to clipboard, switch view to plain text mode
#include <qapplication.h>
#include <qpushbutton.h>
#include <qfont.h>
#include <qvbox.h>
#include <qlayout.h>
#include <qobject.h>
#include "channelselected.h"
{
public:
MyWidget
( QWidget *parent
=0,
const char *name
=0);
};
MyWidget
::MyWidget ( QWidget *parent,
int,
int,
const char *name
){
connect( quit, SIGNAL(clicked()), qApp, SLOT(quit()) );
ChannelSelected* channelPanel = new ChannelSelected (vbox, 10, 10, "channelPanel")
vbox->addWidget(channelPanel);
vbox->addWidget(quit);
}
int main ( int argc, char **argv)
{
MyWidget w;
a.setMainWidget(&w);
w.show();
return a.exec();
}
#include <qapplication.h>
#include <qpushbutton.h>
#include <qfont.h>
#include <qvbox.h>
#include <qlayout.h>
#include <qobject.h>
#include "channelselected.h"
class MyWidget : public QVBoxLayout
{
public:
MyWidget( QWidget *parent=0, const char *name=0);
};
MyWidget::MyWidget ( QWidget *parent, int, int, const char *name)
:QVBoxLayout(parent, int, int, name)
{
QVBoxLayout *vbox = new QVBoxLayout ( this, 10, 10, "vbox");
QPushButton *quit = new QPushButton ("&Quit", vbox, "quit" );
quit->setFont ( QFont("Times", 18, QFont::Bold));
connect( quit, SIGNAL(clicked()), qApp, SLOT(quit()) );
ChannelSelected* channelPanel = new ChannelSelected (vbox, 10, 10, "channelPanel")
vbox->addWidget(channelPanel);
vbox->addWidget(quit);
}
int main ( int argc, char **argv)
{
QApplication a (argc, argv);
MyWidget w;
a.setMainWidget(&w);
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks