Results 1 to 12 of 12

Thread: local static QMutex

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: static QMutex on the stack

    This will seem to work fine too however is completely incorrect and some day when you least expect it will explode in your face:

    Qt Code:
    1. QString x = "abc";
    2. printf("%s\n", x.toLocal8Bit().constData());
    To copy to clipboard, switch view to plain text mode 

    Sorry, it's no argument for me that something "works".

    By the way, this will also "works" most of the time:
    Qt Code:
    1. int x, y; // uninitialized
    2. int z = x/y;
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 25th January 2012 at 09:21.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. static QMutex
    By mhoover in forum Qt Programming
    Replies: 7
    Last Post: 8th August 2014, 05:39
  2. QMutex QMutex::Recursive is not a type name
    By Qiieha in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2011, 14:01
  3. Using a QMutex as a static class member
    By emostar in forum Qt Programming
    Replies: 2
    Last Post: 15th June 2009, 13:48
  4. QMutex
    By weixj2003ld in forum Qt Programming
    Replies: 6
    Last Post: 14th April 2009, 22:32
  5. New to QMutex
    By durbrak in forum Qt Programming
    Replies: 3
    Last Post: 12th March 2009, 21:16

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
  •  
Qt is a trademark of The Qt Company.