Project

General

Profile

How to use Signals? // How to communicate between Objects? » WNavigation.cpp

Quirin Schwanse, 11/07/2018 10:21 PM

 
#include "WNavigation.h"

WNavigation::WNavigation()
{

//Init Buttons
b_NEWS = addWidget(make_unique<WPushButton>(tr("str.NEWS")));

b_DEV = addWidget(make_unique<WPushButton>(tr("str.DEV")));

b_PROJ = addWidget(make_unique<WPushButton>(tr("str.PROJ")));

b_MEDIA = addWidget(make_unique<WPushButton>(tr("str.MEDIA")));

b_SHOP = addWidget(make_unique<WPushButton>(tr("str.SHOP")));

b_CONTACT = addWidget(make_unique<WPushButton>(tr("str.CONTACT")));

//Connect Buttons with click-event //??????????????? How does it work?
b_NEWS->clicked().connect(std::bind(&TLayout::switchSection, 0));
b_DEV->clicked().connect(std::bind(&TLayout::switchSection, 1));
b_PROJ->clicked().connect(std::bind(&TLayout::switchSection, 2));

}

WNavigation::~WNavigation()
{
//Free da memory!

}
(4-4/4)