|
|
Re: [Kde-games-devel] Problem with signals and slots: msg#00083
kde-games-devel
|
Subject: |
Re: [Kde-games-devel] Problem with signals and slots |
Hi, you did not create your m_gameTheme before you make connection to it, just put setupGame() before m_gameTheme can fix your problem. line23:24 in MainWindow.cpp On Sun, Jul 12, 2009 at 10:17 AM, ahmmahfuz rubel <65mahfuz90@xxxxxxxxx> wrote:
I am having some problem when I tried to connect signals and slots of different classes. It was not a problem when I connected signals and slots within the same class(I even don't included the moc file!).
This is what I have done to connect two different classes:
I have a signal declared in MainWindow(inheritx kxmlGuiWindow) class named signalLoadTheme() and a slot in ThemeManager class(inherits QSvgRenderer) named slotLoadTheme().
I created a instance of ThemeManager in MainWindow name m_gameTheme( ThemeManager* m_Theme)
and connected them in MainWindow using:
connect(this, SIGNAL( signalLoadTheme()), m_gameTheme, SLOT( slotLoadTheme() ));
I used Q_OBJECT in both of the classes at first (tried also including moc files).
But, this is not working, my program is crashing.
mahfuz@mahfuz-desktop:/usr/local/bin$ ./TestSignalSlot KCrash: Application 'TestSignalSlot' crashing... sock_file=/home/mahfuz/.kde/socket-mahfuz-desktop/kdeinit4__0 Warning: connect() failed: : No such file or directory
KCrash cannot reach kdeinit, launching directly.
The necessary parts of my program is attached here(Not full, it is big).
Please Help. Also, let me know, when and why including the moc file is must.
Thanks in advance. Mahfuz
_______________________________________________
kde-games-devel mailing list
kde-games-devel@xxxxxxx
https://mail.kde.org/mailman/listinfo/kde-games-devel
-- Cheers, Zeng Huan
_______________________________________________
kde-games-devel mailing list
kde-games-devel@xxxxxxx
https://mail.kde.org/mailman/listinfo/kde-games-devel
|
|