trouble with signals and slots
hey there, i have created a push button inside a tab called demandsTab() and i have connected the button to a method. the method and the connection is shown below:
QPushButton *shortestPathButton = new QPushButton(tr("Shortest Path"));
connect(shortestPathButton, SIGNAL(clicked()), this, SLOT(PermissionsTab::outputTable()));
the slot function that i created is shown below:
void PermissionsTab::outputTable()
{
int result = 5;
display->setText(QString::number(result));
}
i basically just want the display to output the number 5 in the permissions tab when i press the button from the demands tab, but it isnt working....any idea's??? Jag
Re: trouble with signals and slots
Try omitting PermissionsTab:
Code:
connect(shortestPathButton, SIGNAL(clicked()), this, SLOT(outputTable()));
If that does not help build in debug mode and run your app so that you can see the standard (error) output - if your IDE does not support it - from the commandline. Qt will then warn about non-existing signals and slots.
Re: trouble with signals and slots
Quote:
Originally Posted by Codepoet
If that does not help build in debug mode and run your app so that you can see the standard (error) output - if your IDE does not support it - from the commandline.
To see those messages on windows console, you will have to add "CONFIG += console" to your .pro file.
Re: trouble with signals and slots
i tried adding CONFIG += console to my .pro file but it isnt working, i dont understand why and its really annoying.
Re: trouble with signals and slots
Quote:
Originally Posted by therealjag
i tried adding CONFIG += console to my .pro file but it isnt working, i dont understand why and its really annoying.
Do you have Qt libraries compiled in debug mode? Did you compile your program in debug mode?