Hi,<br>Sorry for my typo.<br>you did not create your m_gameTheme before you make
connection to it, just put setupGame() before setupWidgets()* can fix your
problem. line23:24 in MainWindow.cpp<br><br><div class="gmail_quote">On Sun, Jul 12, 2009 at 10:35 AM, Zeng Huan <span dir="ltr">&lt;<a href="mailto:zh.issac@gmail.com">zh.issac@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>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<br><br><div class="gmail_quote"><div><div></div><div class="h5">
On Sun, Jul 12, 2009 at 10:17 AM, ahmmahfuz rubel <span dir="ltr">&lt;<a href="mailto:65mahfuz90@gmail.com" target="_blank">65mahfuz90@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">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&#39;t included the moc file!).<br>

<br>This is what I have done to connect two different classes:<br>
<br>I have a signal declared in MainWindow(inheritx kxmlGuiWindow) class named signalLoadTheme() <br>and a slot in ThemeManager class(inherits QSvgRenderer) named slotLoadTheme(). <br><br>I created a instance of ThemeManager in MainWindow name m_gameTheme( ThemeManager* m_Theme)<br>


and connected them in MainWindow using:<br><br>

<p style="margin: 0px; text-indent: 0px;"><b>connect(this, SIGNAL( signalLoadTheme()), m_gameTheme, SLOT( slotLoadTheme() ));</b></p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">


I used Q_OBJECT in both of the classes at first (tried also including moc files).</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">But, this is not working, my program is crashing.<br>


</p><br><b>mahfuz@mahfuz-desktop:/usr/local/bin$ ./TestSignalSlot <br>KCrash: Application &#39;TestSignalSlot&#39; crashing...<br>sock_file=/home/mahfuz/.kde/socket-mahfuz-desktop/kdeinit4__0<br>Warning: connect() failed: : No such file or directory<br>


KCrash cannot reach kdeinit, launching directly.<br><br></b><br>The necessary parts of my program is attached here(Not full, it is big).<br><br>Please Help. Also, let me know, when and why including the moc file is must.<br>


<br>Thanks in advance.<br>Mahfuz<br><br>
<br></div></div>_______________________________________________<br>
kde-games-devel mailing list<br>
<a href="mailto:kde-games-devel@kde.org" target="_blank">kde-games-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kde-games-devel" target="_blank">https://mail.kde.org/mailman/listinfo/kde-games-devel</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Cheers,<br><font color="#888888">Zeng Huan<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Cheers,<br>Zeng Huan<br>