I suggest you use the method wysota has suggested. I think it a cleaner way to accomplish your task.
If you still want to use the other way and know what the error is, can you please show us your code ?
I suggest you use the method wysota has suggested. I think it a cleaner way to accomplish your task.
If you still want to use the other way and know what the error is, can you please show us your code ?
Mithin
www.mithin.in
In povezava.ui.h I have:
Qt Code:
void Povezava::Connect_clicked() { . . . GlavnoO->enable_lista_tabel(); close(); };To copy to clipboard, switch view to plain text mode
In GlavnoO.ui.h I have:
Qt Code:
void GlavnoO::enable_lista_tabel() { lista_tabel->setEnabled(true); };To copy to clipboard, switch view to plain text mode
I think I know where the problem is: GlavnoO is class while I would need to call object of that class. The problem is that I have that object defined in main.cpp and I don't know how to include it.
You can use signals and slots mechanism to connect those two objects.Originally Posted by Lebowski
I already have a slot defined:Qt Code:
void GlavnoO::enable_lista_tabel() { lista_tabel->setEnabled(true); };To copy to clipboard, switch view to plain text mode
How do I create signal in designer? Just adding it in Object Explorer doesn't generate anything really. And adding it to .h file in ".ui/" folder won't work cause all changes there are being ignored.
Last edited by Lebowski; 12th April 2006 at 12:55.
You don't implement signals --- it's enough to declare them within class definition (the rest will be handled by moc).Originally Posted by Lebowski
Then just write:Qt Code:
emit someSignal( someParameter );To copy to clipboard, switch view to plain text mode
Then try the subclassing approach: http://doc.trolltech.com/3.3/designer-manual-6.htmlOriginally Posted by Lebowski
Is it enough to just write that line of code in (for example) my povezava.ui.h file within some function (slot)?Originally Posted by jacek
Yes, if you have declared that signal in the Designer. Of course you will also have to make the connection.Originally Posted by Lebowski
Signal and slot are now working ok. Thanx for help.
Where do I make connection though? In main.cpp? Cause QT Designer's wizard only allows creation of connections within same form.
You will have to create the connection by hand. The best place to do it is the one where you have an easy access to both objects, in your case this might be the main() function.Originally Posted by Lebowski
Lebowski (13th April 2006)
It works!!! Thanx a lot![]()
Btw in connect I had to use '&' character in front of object names. What does that mean? Does it mean memory address of that object maybe?
Yes. Connect needs pointers.
Bookmarks