[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bindings
Subject:    Re: [Kde-bindings] Qt, Qyoto buttons work intermediately
From:       Linuxoid Oz <linuxoidoz () yahoo ! com ! au>
Date:       2010-02-18 21:22:44
Message-ID: 223747.59842.qm () web111003 ! mail ! gq1 ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thank you. I more or less understand how signals/slots operate from the main window. \
I just don't get how they work if I have to open a second window from the main window \
and display a message by clicking a button in the second window with passing some \
variables to it. That's the problem.

I've got a worked example using delegates that I mentioned before. I've
actually separated it out in to a helper function (because I _hate_ the
magic strings and want to type them as little as possible), but the full
code is available online at
http://dev.ibboard.co.uk/projects/warfoundry/browser/IBBoard.WarFoundry.GUI.QtSharp/trunk/MainWindow.cs?rev=486#L76


Basically, if "menuAction" is a QAction (e.g. from a menu) and "method"
is a method that matches the SlotFunction delegate signature then:

QObject.Connect(menuAction, SIGNAL("triggered()"), method);

will add the delegate as a slot method that gets called when the
triggered signal (clicking the menu item) occurs.




      __________________________________________________________________________________
 Yahoo!7: Catch-up on your favourite Channel 7 TV shows easily, legally, and for free \
at PLUS7. www.tv.yahoo.com.au/plus7


[Attachment #5 (text/html)]

<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: \
inherit;">Thank you. I more or less understand how signals/slots operate from the \
main window. I just don't get how they work if I have to open a second window from \
the main window and display a message by clicking a button in the second window with \
passing some variables to it. That's the problem.<br><br><blockquote \
style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: \
5px;"><div class="plainMail">I've got a worked example using delegates that I \
mentioned before. I've<br>actually separated it out in to a helper function (because \
I _hate_ the<br>magic strings and want to type them as little as possible), but the \
full<br>code is available online at<br><a \
href="http://dev.ibboard.co.uk/projects/warfoundry/browser/IBBoard.WarFoundry.GUI.QtSharp/trunk/MainWindow.cs?rev=486#L76"
  target="_blank">http://dev.ibboard.co.uk/projects/warfoundry/browser/IBBoard.WarFoundry.GUI.QtSharp/trunk/MainWindow.cs?rev=486#L76</a><br><br>Basically, \
if "menuAction" is a QAction (e.g. from a menu) and "method"<br>is a method that \
matches the SlotFunction delegate signature then:<br><br>QObject.Connect(menuAction, \
SIGNAL("triggered()"), method);<br><br>will add the delegate as a slot method that \
gets called when the<br>triggered signal (clicking the menu item) \
occurs.<br><br></div></blockquote></td></tr></table><br>



      <hr size=1>
Yahoo!7: Catch-up on your favourite Channel 7 TV shows easily, legally, and for free \
at PLUS7. <a href="http://au.rd.yahoo.com/tv/catchup/tagline/*http://au.tv.yahoo.com/plus7/?cmp=mailtag" \
target=_blank>Check it out</a>.



_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic