Results 1 to 3 of 3

Thread: [SOLVED] QDeclarativeView mousearea and mouseEvents problems.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question [SOLVED] QDeclarativeView mousearea and mouseEvents problems.

    Hi all!

    I photoshopped a custom user interface for a application i want to bring to life someday primarily for the windows platform. It has a custom titlebar with custom buttons and i designed tree-state windows actions buttons for closing, minimizing and maximazing.

    First off: would you advice against using QML for this, or is that exactly what QML could be used for?

    The problem I'm striving with is mouse-events. I must have done something wrong because when I implement my QML-file (witch work as expected in the qmlviewer) in the QDecalarativeView it doesn't handle mouse-events at all (no hover, click, or anything realy).
    I also would preferably need the mouseevents that arent handled in my qml-file to propagate eighter to a subclassed QDeclarativeView (in c++) or all the way up to my QMainWindow::mousePressEvent(..). So that I can implement moving the window and resizing it.

    Has anybody got any ideas for me? I'll be happy to look myself, I'm just kinda stuck right now. A point in the right direction would go a long way

    Thanks!

    EDIT:

    Okay so I ended up sub-classing the QDeclarativeView and using its mouseEvent functions (also calling QDecalarativeView::mouseXEvent(event); every time to have the qml work aswell) to implement moving and resizing functionality.

    Then I used a normal QWidget sub-classed class to set the titlebar together with the rest of the content and complete the custom window.

    Thanks for the help viulskiez.
    Last edited by acidr; 16th July 2011 at 14:35.

Similar Threads

  1. Using QDeclarativeView::Show()
    By proj_symbian in forum Qt Quick
    Replies: 17
    Last Post: 30th May 2011, 19:26
  2. Replies: 2
    Last Post: 9th May 2011, 02:04
  3. Problem with MouseArea element
    By chiru in forum Qt Quick
    Replies: 1
    Last Post: 27th November 2010, 00:23
  4. QTableWidget mouseEvents
    By QAir in forum Qt Programming
    Replies: 6
    Last Post: 28th July 2009, 16:11
  5. qwt mouseEvents
    By halberdier83 in forum Qwt
    Replies: 7
    Last Post: 22nd April 2009, 12:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.