Solved Connecting Buttons with custom signals and slots
-
@Thank-You said in Connecting Buttons with custom signals and slots:
why this is not functioning
What is not functioning?
-
@Thank-You I'm almost 100% sure, this "nav_bar" is not the one you see on your screen:
{ ui->setupUi(this); //connection to buttons nav_bar = new navigation; connect(nav_bar,SIGNAL(homeButtonClickedSignal()),this,SLOT(homeButtonClickedSlot())); }
change it to the following and see if you suddenly have 2 Navbars
{ ui->setupUi(this); //connection to buttons nav_bar = new navigation; nav_bar->resize(100,500); nav_bar->show(); connect(nav_bar,SIGNAL(homeButtonClickedSignal()),this,SLOT(homeButtonClickedSlot())); }
-
@jsulm The buttons are not functioning
-
@J-Hilk You can exactly see my code
https://filebin.net/3o8y2q5zwxb0l0sa
Yes it is the same -
I just checked and its not!!!!!
inside mainwin ui is a navigation item, thats the one you see on screen, the one you create inside the constructor and connect your signals to is a 2nd one and not show!!
You should really test what I wrote and you will see it for yourself instead of simply refusing it.
-
![alt text]( image url)
Yes its working but i dont need this I just want the one in right side not separately
-
@Thank-You
from looking at sour source code,this should work:
{ ui->setupUi(this); //connection to buttons connect(ui->navigation_menu,SIGNAL(homeButtonClickedSignal()),this,SLOT(homeButtonClickedSlot())); }
-
-
@jsulm Yes it did work.
Silly me just using new instead of assigning it to ui->navigation_menu(it is the object name in ui).Thank You
-
@Thank-You said in Connecting Buttons with custom signals and slots:
assigning it to ui->navigation
Not sure what you mean. You should not assign anything to ui->navigation - it is set up when you call
ui->setupUi(this);
-
@jsulm Sorry It was mistake.
I have corrected it.