B.hpp
#include <QWidget>
#include <QGridLayout>
#include <QLabel>
#include <QToolButton>
#include <QIcon>
#include <QComboBox>
namespace UpstreamPrivateNamespace{
{
Q_OBJECT
public:
signals:
.....
void bSIgnal(const QString&);
public slots:
void bSlot(const QString& );
private:
};
}
#include <QWidget>
#include <QGridLayout>
#include <QLabel>
#include <QToolButton>
#include <QIcon>
#include <QComboBox>
namespace UpstreamPrivateNamespace{
class B : public QWidget
{
Q_OBJECT
public:
B( QWidget * ParentP = 0 );
signals:
.....
void bSIgnal(const QString&);
public slots:
void bSlot(const QString& );
private:
QIcon * iconVar;
QComboBox * boxVar;
};
}
To copy to clipboard, switch view to plain text mode
B.cpp
{
..
connect(this->boxVar, SIGNAL(currentIndexChanged(const QString& )), this, SLOT(bSlot(const QString& )));
..
}
void b::bSlot(const QString& var)
{
emit bSignal(var);
}
b::b( QWidget * ParentP )
: QWidget( ParentP )
{
..
this->boxVar = new QComboBox(this);
connect(this->boxVar, SIGNAL(currentIndexChanged(const QString& )), this, SLOT(bSlot(const QString& )));
..
}
void b::bSlot(const QString& var)
{
emit bSignal(var);
}
To copy to clipboard, switch view to plain text mode
Bookmarks