Results 1 to 2 of 2

Thread: Points selection

  1. #1
    Join Date
    May 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Points selection

    Hi all,
    I need a suggestion about the better tecnique to perform a points selection: I implemented an OpenGL viewer that is composed of a QMainWindow that contains (in a cental widget) a QGLWidget. All works fine but I have a doubt about the implementation of points selection.
    What I want to do is this: when a point selection is requires the main application (QMainWindow) signal to the QGLWidget the needing for a point selection and then it waits untill the point is selected in the QGLWidget (or ESC is pressed). When the point is selected in the QGLWidget it can be returned to the QMainWindow and then the QMainWindow can cotinue to use the point to do something.
    The problem is that if the QMainWindow stops to wait for the QGLWidget reasponse, pratically the requirement for points selection never arrive to the QGLWidget and so the software enters in loop.
    Does anyone have experience in it? What is the best solution? Thank you very much.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Points selection

    You are thinking synchronously while you need to think asynchronously.
    Your main application should NEVER wait on something. Yet, it should offer functionality for other processes to signal the main application that something is done.

    Hence, try signals and slots.

Similar Threads

  1. Remove points from a QPainterPath
    By JaV0 in forum Qt Programming
    Replies: 0
    Last Post: 3rd March 2010, 16:27
  2. Extracting points from GL_QAUD
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2010, 21:38
  3. Basic Points of QT
    By BalaQT in forum Newbie
    Replies: 1
    Last Post: 14th August 2009, 06:39
  4. drawing an Arc using points
    By chethana in forum Qt Programming
    Replies: 2
    Last Post: 11th July 2009, 03:59
  5. Plotting points
    By afflictedd2 in forum Qt Programming
    Replies: 8
    Last Post: 26th February 2009, 08:20

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.