Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [SOLVED] QtGlobal about the file

    General and Desktop
    3
    5
    4840
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • _
      _compiler last edited by

      • ..\qt-everywhere-opensource-src-4.8.3\include\QtCore\QtGlobal --> There are no extensions.
      • ..\qt-everywhere-opensource-src-4.8.3\include\QtCore\QGlobalStatic --> There are no extensions.
      • ..\qt-everywhere-opensource-src-4.8.3\include\QtCore\QGlobalStaticDeleter --> There are no extensions.
      • ..\qt-everywhere-opensource-src-4.8.3\include\QtCore\qglobal.h
      • ..\qt-everywhere-opensource-src-4.8.3\include\Qt\qglobal.h
      • ..\qt-everywhere-opensource-src-4.8.3\src\corelib\global\qglobal.h
      • ..\qt-everywhere-opensource-src-4.8.3\src\corelib\global\qglobal.cpp
      • ..\qt-everywhere-opensource-src-4.8.3\doc\src\snippets\code\src_corelib_global_qglobal.cpp

      What is the difference between these files?

      Files with no extension, what is?

      qglobal.h file is used on its own right? --> ..\src\corelib\global\qglobal.h

      created a gui project, why are automatically Uint8 see, for example?


      qglobal want to create a file into its own. Can you give us just a c + + example.
      to create such a structure.
      I want to know how it works in the background only.


      For the following code which header file must be the most powerful and the most effective?

      <QtGlobal>

      <qglobal.h>

      <QGlobalStatic>

      <QGlobalStaticDeleter>

      @
      #include <iostream>
      using namespace std;

      // <QtGlobal> <qglobal.h> <QGlobalStatic> <QGlobalStaticDeleter> <----- ?

      int main()
      {
      int myValue = 10;
      int minValue = 2;
      int maxValue = 6;

      int boundedValue = qBound(minValue, myValue, maxValue);
      
      cout << boundedValue << endl;
      
      system("PAUSE"&#41;;
      return 0;
      

      }
      @

      qglobal.cpp in which the prototypes was written. ->> for qglobal.h .

      1 Reply Last reply Reply Quote 0
      • T
        tucnak last edited by

        Hi, ~_compiler!

        Welcome to Qt Developer Network!

        We are really friendly here :-)

        I am sorry, but I can't help you today with an issue you have posted. I've posted this reply to make small announcement.

        I've started "Qt Contribution":http://qt-project.org/groups/qt-contributors group here. It's for the people who wants to hack, contribute, understand Qt code.

        I've send request for Forum. If devnet admins accept it, it will be a good practise to post questions like this there.

        So, DevNet admins, if you see this post - please do smth with my request.

        Sorry for offtop.

        1 Reply Last reply Reply Quote 0
        • _
          _compiler last edited by

          I understand :-)

          1 Reply Last reply Reply Quote 0
          • M
            MuldeR last edited by

            Include files don't need to have a specific extension.

            They can have any extension you like or no extension at all. In the C standard library, include files used to have a ".h" extension, like in <stdio.h>, but in the C++ standard library most (all?) header files have no extension, like <vector> or <iostream>. And, in C++, we even have new equivalents for the old C headers like <cstdio> instead of <stdio.h>. The "Boost" library, for example, uses the ".hpp" extension for its header files.

            In Qt we have include files like <QtGlobal> (CamelCase and no file extension) in the "include" directory, which do nothing but include the corresponding .h file, like <qglobal.h> (all lower case and .h extension), also located in the "include" directory. And if you look at these file, they do nothing but include the real header file from the "src" directory, like "../../src/corelib/global/qglobal.h". It means <QtGlobal> is a shortcut/alias for the real header file.

            After all, you could just include the real header file from the "src" directory in your code, but the location and/or name of that file might change in the future. So it is better (and more clean) to just include those include files that are provided in the "include" directory. Your application should not need to know or care about the "internals" of Qt. Whether you include <QtGlobal> or <qglobal.h> is probably up to your own personal taste, but in official Qt docs and examples I always see <QtGlobal> and friends, so that's what I use in my code too.

            My OpenSource software at: http://muldersoft.com/

            Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

            Go visit the coop: http://youtu.be/Jay...

            1 Reply Last reply Reply Quote 0
            • _
              _compiler last edited by

              thanks MuldeR, beautiful beyond description.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post