Is there a way, for example, to show the faces of 5 people attending a public event?
Thank you
Yes, all attending lists are public
You can call http://graph.facebook.com/eventid/attending then get the user details from there
Related
At the beginning I want to tell that I just started learning QT so my knowledge about this is really not deep. I wrote simple tasks management it's a console application of course. I used logic which resembles MVC pattern (controllers, views, actions, models).
For example let's take user login. I create instance of LoginController class, then LoginController creates instance of LoginView who is waiting for user to enter data - login, password. Login and password is saved as LoginView members. Then in LoginController I read this data and passes them as parameters to UserVerificationAction constructor. Constructor of this class saved this data as members of their class. Next in LoginController I calls method of class UserVerification - action() which validates login and password. Then depending on the result of validation I create instance of MenuController or instance of LoginFailiedView. This mechanism is user throughout the program (CreateUserController, AddTaskController) etc. I used virtual methods so MenuController consists of about 20 lines of code and is very easy to read.
I want to use Qt to implement a GUI to be more precise I want to use signals and slots mechanism but I have a dilemma. Maybe it would by better to create a slot in the LoginView class and then creates action instance instead passes entered data to LoginView members and then in LoginController creates instance od action class. maybe there is a better way to do this. I want you to give me some tips on how I should do it properly
p.s.
Sorry for my English
In Qt, the concept of a "controller" is slightly blurred. It tends to be part of both the model and view. This does not mean that you can't write a controller to link a model and view logic.
Normally what you will see is a view that emits signals for its actions. And then you wire these either directly into compatible slots on a model or a subclass where you have written your own slots.
If for instance you have a main window. This window might create a model and a view as children. And it may then define slots on the window subclass that wire between the model and view. This means your window is a view and a controller.
Qt provides Model/View architecture.
It introduces 3 classes: Model, View and Delegate to store, present and edit data.
I believe that is what you are looking for.
The event comment.create fired when the user adds a comment (fb:comments) and the event comment.remove fired when the user removes a comment (fb:comments)
view : http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
If I want to detect the same events in (fb:live-stream) http://developers.facebook.com/docs/reference/plugins/live-stream/
may I use comment.create and comment.remove or
something else like event stream.publish and stream.remove
Neither https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ nor http://developers.facebook.com/docs/reference/plugins/live-stream/ indicate there's any public event you can subscribe to for the Live Stream plugin. If you think this is valuable to have, log a bug/enhancement request with Facebook and post the link to the bug report here. Thanks :)
I am facing a problem regarding Signals and Slots mechanism of Qt. The core of the problem is here :
My application consists of 2 classes:
MainGUI : this class has all the core functionality of the app, and has some variables which store values relevant to the app.
Preferences : This class is used to draw and show a Settings panel, and has line-edit fields for updating the variables in MainGUI (using Signal-Slot mechanism)
Currently, i have connected them as follows:
Preferences *Pref;
MainGUI *M;
.
.
.
connect(Pref, SIGNAL(pref_varAChanged(QString)), M, SLOT(setVarA(QString)));
connect(Pref, SIGNAL(pref_varBChanged(QString)), M, SLOT(setVarB(QString)));
connect(Pref, SIGNAL(pref_varCChanged(QString)), M, SLOT(setVarC(QString)));
.
.
.
But, what this part does is that AS SOON AS the values are changed, the variables are updated, even though i have not click on 'APPLY' button (or an equivalent ACCEPT button...)
Please help me in implementing this functionality that the values A,B,C get updated only when a button, say, btn_accept is clicked...
PS : I know this seems a very easy problem, and should be only a few lines long, but i've been trying to solve it and have been hitting the wall every time. I'd appreciate if someone could point me in the right direction
Well, it seems i have figured out the problem.
It was simply a matter of emitting the 'variableChanged' signals when the ACCEPT button was clicked. This would update the variables in the MainGUI class.
It seems I had found the solution (read my comment), but I had misread the output my program gave, thus I had not realized that I had solved the problem until much later.
Thank you all for your comments. I'm sorry that this turned out to be such a waste of time.
Regards,
Harsh
Do the Qt signals/slots follow the scope of native C++?
Let's say I have the following classes: House, Kitchen, Cellar, Stove and Shelf.
class House {Kitchen kitchen, Cellar cellar;};
class Kitchen {Stove stove;};
class Cellar {Shelf shelf;};
Now I want to send a signal from the shelf in the cellar to the stove in the kitchen. Is the only way to do this by connecting a signal from the shelf to the cellar and a slot from kitchen to the stove and then in house connecting cellar and kitchen? Or is there a way to do this directly?
I have a class that needs to communicate with a user interface and I wonder if I need to "proxy" all the various signals/slots through intermediate classes. Or is this an indicator of bad design?
You can do the connection in any method of House, as there you can access both objects. The "connector" must be able to access both sender and receiver, at compile time, that's all there is to it.
You should be able to just link a signal from the Shelf instance to the Stove instance
in House,
connect(cellar->shelf,SIGNAL(signalHere()),kitchen->stove,SLOT(slotHere()));
just make sure that shelf and stove are public variables in Kitchen and Cellar and you'll be set
You cant use signals/slots on classes which are no QObjects, so no, your example wont work whatsoever.
You can circumvent the encapsulation if you initilaize the child objects with their parent object, so you can do dirty tricks like: connect(this->shelf, SIGNAL(signalHere()), kitchen->children()[0], SLOT(aStoveSlot())). however this will only work if the first child of Kitchen is really a Stove... so since this is a obvious dependency, you should make this visible by making stove public, or by adding a stove accessor method.
In an instance of a class derived from CWnd, is it possible to forward (redirect) all MFC messages to another object, without writing separate handlers and message mappings for each possible message? Specifically, I'd like to forward all unhandled WM_ messages to another object. If this isn't possible, then is it possible for objects to listen to events that occur within other objects? I can provide details if that would help clarify my question.
Thanks.
You'll need to aim a little lower than MFC. You should override the PreTranslateMessage method of your window and process the messages directly.
Once you have the main message loop, you can pick and choose which ones are handled by your app and which ones are Sent/Posted to another. If you choose to send the message, I'd recommend SendMessageTimeout(...)
I think you need subclassing.
SubclassWindow()
CodeProject article
No, you can't really do what you're asking, but you probably don't have to. (Some more details of your problem may be in order.) When you create a message map, you specify both the class to which it applies and the base class for that class. If your derived class doesn't have a message map entry for a particular message, MFC will check the message map for the base class. If the base class message map has no entry, it will check the message map for its base class, and so on.
For example, suppose you have a bunch of dialogs with common functionality. You could lay out your classes thusly:
class CMyBaseDialog : public CDialog {
DECLARE_MESSAGE_MAP();
}
BEGIN_MESSAGE_MAP(CMyBaseDialog, CDialog)
// Handle any common messages here...
END_MESSAGE_MAP()
class CDerivedDialog : public CMyBaseDialog {
DECLARE_MESSAGE_MAP();
}
BEGIN_MESSAGE_MAP(CDerivedDialog, CMyBaseDialog)
// Handle any specific messages here...
END_MESSAGE_MAP()
The same applies to all other HWND based classes, such as CWnd, CView, CFrame, and so on. If you're dealing specifically with command messages, then you have some additional options.
Well since I can't seem to be able to post a comment I'll post this as an answer. I had a problem following Brad's answer where some WM_COMMANd messages where not routed through the PreTranslateMessage function (see my answer to my question How to stop MFC from disabling my controls if I don't declare a message map entry for it's corresponding command?) but were through OnCommand so basically I overriden the OnCommand function to forward all WM_COMMAND messages too. I'm posting this in case anyone get the same problem.
Anyway thanks for the helps Brad, your answer helped me a lot.