Re: [Qt-qml] QDeclarativeItem subclasses and mouse events

2010-08-02 Thread michael.brasser
Hi, On 03/08/2010, at 4:27 PM, ext Jan Ekholm wrote: > On Tuesday 03 August 2010 04:55:46 Gregory Schlomoff wrote: >> Hello ! >> >> You may want to have a look at our code for drag and drop, it's working >> well: >> >> http://bitbucket.org/gregschlom/qml-drag-drop >> >> (and more specifically >

Re: [Qt-qml] QDeclarativeItem subclasses and mouse events

2010-08-02 Thread Jan Ekholm
On Tuesday 03 August 2010 04:55:46 Gregory Schlomoff wrote: > Hello ! > > You may want to have a look at our code for drag and drop, it's working > well: > > http://bitbucket.org/gregschlom/qml-drag-drop > > (and more specifically > http://bitbucket.org/gregschlom/qml-drag-drop/src/tip/Declarati

Re: [Qt-qml] Orientation listener

2010-08-02 Thread joona.t.petrell
Ø So I think I need to create a C++ class which listens for the orientation changes, declare this class in my QML and then use signals so that my QML view can act upon these changes. Is this correct? That is one way to achieve your goals. In the future you don't necessarily need to write C++

Re: [Qt-qml] QDeclarativeItem subclasses and mouse events

2010-08-02 Thread Gregory Schlomoff
Hello ! You may want to have a look at our code for drag and drop, it's working well: http://bitbucket.org/gregschlom/qml-drag-drop (and more specifically http://bitbucket.org/gregschlom/qml-drag-drop/src/tip/DeclarativeDragArea.cpp ) On Tue, Aug 3, 2010 at 3:13 AM, Jan Ekholm wrote: > On Mond

Re: [Qt-qml] QDeclarativeItem subclasses and mouse events

2010-08-02 Thread Jan Ekholm
On Monday 02 August 2010 22:22:25 alexis.men...@nokia.com wrote: > Hello, > > QDeclarativeItemPrivate constructor does this : > > QGraphicsItemPrivate::acceptedMouseButtons = 0; > > which means that no mousePress/mouseMove/mouseRelease will be delivered. > > You need to call setAcceptedMouseBut

[Qt-qml] RE : QDeclarativeItem subclasses and mouse events

2010-08-02 Thread alexis.menard
Hello, QDeclarativeItemPrivate constructor does this : QGraphicsItemPrivate::acceptedMouseButtons = 0; which means that no mousePress/mouseMove/mouseRelease will be delivered. You need to call setAcceptedMouseButtons in your C++ item with the buttons you want. All default options in QDeclarat

[Qt-qml] QDeclarativeItem subclasses and mouse events

2010-08-02 Thread Jan Ekholm
Hi, I was recommended to make a C++ QDeclarativeItem subclass for my game map tiles to get better performance. This worked well and the class was easy to implement, register and get to work. However, I can't seem to get mouse press/release events to work, whatever I do the events aren't relaye

Re: [Qt-qml] Orientation listener

2010-08-02 Thread Ben Marinic
Hi Joona. Thanks for your help. So I think I need to create a C++ class which listens for the orientation changes, declare this class in my QML and then use signals so that my QML view can act upon these changes. Is this correct? I'm attempting to add a C++ class to my QML project in Qt

Re: [Qt-qml] QML signal not firing c++ slot

2010-08-02 Thread Diego Marcos
Hi Chandraprakash, This is how I'm calling now C++ slots from QML: You define the slots in your C++ class: class MyClass : public QObject{ Q_OBJECT public slots: void sayText(QString txt); } You make an object of your class available within th

[Qt-qml] QML signal not firing c++ slot

2010-08-02 Thread Chandraprakash Sharma
my qml file import Qt 4.7 import "qml" import "jscript.js" as CalcEngine Item { id:container width: 1024 height: 768 signal ttsrequired(string txt); function doOp(operation){CalcEngine.doOperation(operation

Re: [Qt-qml] Orientation listener

2010-08-02 Thread joona.t.petrell
Hi Ben, QML Viewer provides a simple context property runtime.orientation for listening to orientation changes on a device. It can update to four different values: portrait, portrait inverted, landscape and landscape inverted. Currently the property is updated on N900 and Symbian S60 5.0 and ne