PDA

View Full Version : Connecting signal to button



steg90
28th November 2007, 12:23
Hi,

I've got this strange warning on one of my ui forms :

'Warning : The project doesn't contain any class which uses this form!'

Very strange as it does, anybody had this error before?

All I am trying to do is connect a signal to a QPushButton!

Regards,
Steve

wysota
28th November 2007, 12:41
When do you get the error and how does your project file look like?

steg90
28th November 2007, 12:50
I get the error when I double click on my QPushButton on the form.

Project file is built within Visual Studio.net. I've never had this problem before?

wysota
28th November 2007, 13:29
You mean you get the warning while the application is running? Without seeing the .pro file we won't be able to help much.

steg90
28th November 2007, 14:14
I get the warning while I'm editing the form in visual studio.net.

aamer4yu
28th November 2007, 18:01
Is it really an error ?? You say "Warning ...." :confused:

by the warning u must not be using the form anywhere... it is just defined,,,but not used...
am i right ??

Ursa
13th December 2007, 09:14
Hello.
I work with QT 4.2 and Visual Studio 2005. Now there is a strange situation. I try to connect a signal to an element of a form and see the message: 'Warning. The project doesn't contain any class which uses this form!' (in attachment)
There was the same guestion some weeks ago... but without answer unfortunately :(
http://www.qtcentre.org/forum/f-qt-programming-2/t-connecting-signal-to-button-10491.html
Sometimes the message disappears but more often I see it again when I'm trying to connect a signal. Hitherto I couldn't find any logic in its behaviour....

jpn
13th December 2007, 10:05
I've got this strange warning on one of my ui forms :

'Warning : The project doesn't contain any class which uses this form!'

Very strange as it does, anybody had this error before?

All I am trying to do is connect a signal to a QPushButton!


I get the error when I double click on my QPushButton on the form.
Hmm, you don't connect signals by double clicking. When you double click a child widget of a form the integration attempts to insert a slot stub with naming convention of automatic connections (http://doc.trolltech.com/latest/designer-using-a-component.html#automatic-connections). Now, if there is no relevant class, or the integration is unable to detect where the form is being used, such error makes sense.

Ursa
13th December 2007, 11:37
I get the error when I double click on my QPushButton on the form.
Most likely the message appeared not only in case of double clicking. I got it when I tried to use functionality 'Connecting Signals & Slots'. It seems to me I found the reason of the mistake in my case. A namespace was used there.... in such way

namespace Space
{
class TNewDlg : public QWidget
{

private:
Ui::TNewDlgClass ui;
..........

Probably that's why the integration couldn't find relevant class.... I refused from using namespace and it works correctly now (at least I hope so :))