Results 1 to 4 of 4

Thread: How can I share a same variable in different cpp files in Qt creator...??

  1. #1
    Join Date
    Apr 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Lightbulb How can I share a same variable in different cpp files in Qt creator...??

    How can I share a same variable in different cpp files in Qt creator...??

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can I share a same variable in different cpp files in Qt creator...??

    Quote Originally Posted by Samir Shah View Post
    How can I share a same variable in different cpp files in Qt creator...??
    Exactly the same way you do it in C++ using any other text editor, e.g. using references, pointers or global variables.
    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.


  3. #3
    Join Date
    Apr 2015
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: How can I share a same variable in different cpp files in Qt creator...??

    Thanks for the answering.
    Can you explain it with a little bit examples..

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can I share a same variable in different cpp files in Qt creator...??

    Quote Originally Posted by Samir Shah View Post
    Thanks for the answering.
    Can you explain it with a little bit examples..
    This is not C++ kindergarden. How do you intend to implement anything if you don't even know how the programming langauge you are using?
    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. To Share a variable among classes
    By JenniferF in forum Newbie
    Replies: 2
    Last Post: 12th May 2011, 12:13
  2. Replies: 2
    Last Post: 19th February 2011, 12:26
  3. How to make all-files-global variable?
    By hakermania in forum Newbie
    Replies: 32
    Last Post: 29th December 2010, 19:05
  4. Replies: 2
    Last Post: 9th December 2010, 17:49
  5. Share a variable between forms
    By sepehr in forum Qt Programming
    Replies: 4
    Last Post: 29th January 2009, 08:05

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.