Results 1 to 4 of 4

Thread: Strange Problem

Threaded View

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

    Default Re: Strange Problem

    There is a number of solutions and what was suggested to you is probably the worst one I suggest to do it the regular C++ way -- assuming you have a class somewhere that contains your OpenGL code, store your "x" as a member variable of that class. Then you can access it from any code from that class and if you make the variable public or provide a getter for it, you'll be able to access it from outside the class too. Furthermore if the variable is constant, you can define it as "const int x" in the class or in any header file.

    As for extern -- "extern" means that "somewhere else" there is a variable declared. But it doesn't create that variable. Somewhere else you need to declare a real variable called the same for the mechanism to work.
    Last edited by wysota; 6th February 2013 at 13:29.
    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. Strange problem
    By wirasto in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2009, 12:24
  2. Strange problem
    By pavel in forum Newbie
    Replies: 4
    Last Post: 18th December 2009, 22:46
  3. Very Strange problem
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 30th April 2008, 10:20
  4. strange problem in QGraphicsView
    By Shawn in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 10:24

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.