Results 1 to 4 of 4

Thread: Struggling with value space

  1. #1
    Join Date
    May 2008
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Struggling with value space

    I'm using Qtopia 4.3.

    Background:
    Having read the documentation, it seems that my application should create a QValueSpaceObject for each item it wishes to publish, and that these should exist for the lifetime of the application. Each object is essentially a server.

    I also understand that wherever I need to read, be notified of changes, *or even change* a value space item, I can use an instance of QValueSpaceItem. The lifetime can be whatever I need in the context. Each object is essentially a client.

    The documentation says that QValueSpaceItem::setValue requests the server to change the value, which it may or may not do. I assume the relevant QValueSpaceObject instance is located by some sort of cleverness involving shared memory - no direct signal/slot connection is made.

    Problem:
    My problem is that the signal QValueSpaceObject::itemSetValue() does not seem to be fired when I call setValue() on a QValueSpaceItem object. The objects use the same value space path.

    Is this broken? Perhaps I have misunderstood the documentation, but the examples in the code seem to be what I'd expect. I'd be grateful for any examples of how to correctly set up the two ends of this virtual connection. I'm a bit confused by what would happen if a I create a temporary QValueSpaceObject in an attempt to update the value.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Struggling with value space

    Have you tried invoking the sync() method? QValueSpaceItem documentation doesn't say much about it, but it is being used in QValueSpaceObject examples.

  3. #3
    Join Date
    May 2008
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Struggling with value space

    Quote Originally Posted by jacek View Post
    Have you tried invoking the sync() method? QValueSpaceItem documentation doesn't say much about it, but it is being used in QValueSpaceObject examples.
    Thanks for replying. Yes, I had tried that. The application either terminated abruptly or hung, so I suspect I fell foul of the non-threadsafe-ness. I think QValueSpaceItem does not work as advertised.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Struggling with value space

    Quote Originally Posted by UnicycleBloke View Post
    so I suspect I fell foul of the non-threadsafe-ness.
    You didn't mention that you use threads in your first post.

    The docs say:
    Note: The QValueSpaceItem class is not thread safe and may only be used from an application's main thread.
    so if you are using it in a non-GUI thread, it has right to misbehave.

Similar Threads

  1. appBar: allocated space problem
    By mito in forum Qt Programming
    Replies: 4
    Last Post: 29th February 2008, 13:17
  2. QListWidget in ListMode - still has icon space
    By high_flyer in forum Newbie
    Replies: 10
    Last Post: 30th March 2007, 20:43
  3. space between lines in QTextEdit
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 19th September 2006, 14:05
  4. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 9th March 2006, 00:11
  5. QTableWidget click in empty space results in error?
    By Giel Peters in forum Qt Programming
    Replies: 4
    Last Post: 21st January 2006, 01:07

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.