Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: static function/object accessibility

  1. #21
    Join Date
    Apr 2007
    Location
    Rakovnik, Czech Republic
    Posts
    175
    Thanks
    43
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: static function/object accessibility

    right again! ...this was just a test: the label "vuXLocLabel" will exist somewhere else--not on the zXag QStack or any other Stack--but I put it there just to test this out for convenience... by mistake (putting it on a stack).

    huh- this was the cause of my original error, before I got into the Singleton stuff, i bet. Nevertheless, I'm glad ya'll helped me thru it: I still don't understand fully why, but I gather from this and other threads global variables--apparently even the kind I had coded in my original post--are a bad idea. I'll have to go back and re-do dafo.h/dafo.cpp using this singleton approach, I guess.

    I'm still curious how this will work after I make the proper connections: for this test the QLabel is updated just once with a function call, but I'm going to created 3 QLabels that are updated by movement of the camera... ~25/sec. I'll be interested to see how making 3 getLabel()->setText("x/y/z") calls, 25/sec, works out.

  2. #22
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: static function/object accessibility

    I'm still curious how this will work after I make the proper connections: for this test the QLabel is updated just once with a function call, but I'm going to created 3 QLabels that are updated by movement of the camera... ~25/sec. I'll be interested to see how making 3 getLabel()->setText("x/y/z") calls, 25/sec, works out.
    I wouldn't worry about that. There will be 25 function calls + signals/slots overhead.
    There shouldn't be any problem with calling a function 25 times/second.

    Eventually you could skip some of those values since no one can really see 25 coordinates/second anyway.

    Regards

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 10:12
  2. Accessing to a static variable from the same class
    By xgoan in forum General Programming
    Replies: 6
    Last Post: 5th March 2007, 10:50

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.