Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. What does QT -= gui do?
Forum Updated to NodeBB v4.3 + New Features

What does QT -= gui do?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
7 Posts 4 Posters 942 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    I understand what +-= does in C

    I do not get why adding QT widget class to project came up with this

    QT -= gui

    and I had to add this manually

    QT += widgets

    eyllanescE 1 Reply Last reply
    0
    • A Anonymous_Banned275

      I understand what +-= does in C

      I do not get why adding QT widget class to project came up with this

      QT -= gui

      and I had to add this manually

      QT += widgets

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by eyllanesc
      #2

      @AnneRanch QT += X adds the submodule X, and QT -= X does the opposite. That is not an arithmetic addition or subtraction but an addition or removal of modules.

      Adding (or removing) submodules implies that the resulting makefile (the product of the .pro) will link the binaries of the submodule. For example in your case when using widget you need to have accessible all the widget classes so QT + = widgets does that magic, for example it is also responsible for linking the other dependent submodules, for example widgets depends on core and gui, like this to do QT -= gui QT += widgets is the same as QT += widgets since gui was removed but then added.

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      Swati777999S 1 Reply Last reply
      3
      • eyllanescE eyllanesc

        @AnneRanch QT += X adds the submodule X, and QT -= X does the opposite. That is not an arithmetic addition or subtraction but an addition or removal of modules.

        Adding (or removing) submodules implies that the resulting makefile (the product of the .pro) will link the binaries of the submodule. For example in your case when using widget you need to have accessible all the widget classes so QT + = widgets does that magic, for example it is also responsible for linking the other dependent submodules, for example widgets depends on core and gui, like this to do QT -= gui QT += widgets is the same as QT += widgets since gui was removed but then added.

        Swati777999S Offline
        Swati777999S Offline
        Swati777999
        wrote on last edited by
        #3

        @eyllanesc I am new to Qt and feel that I've to learn a lot. I am learning through various online resources and youtube Tutorials and often get stuck in many positions. Can you please clarify what 'binaries of the modules' mean that you've written in your answer?

        Thanks in advance!

        “ In order to be irreplaceable, one must always be different” – Coco Chanel

        eyllanescE 1 Reply Last reply
        0
        • Swati777999S Swati777999

          @eyllanesc I am new to Qt and feel that I've to learn a lot. I am learning through various online resources and youtube Tutorials and often get stuck in many positions. Can you please clarify what 'binaries of the modules' mean that you've written in your answer?

          Thanks in advance!

          eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by
          #4

          @AnneRanch Do you understand that they are C++ libraries? Do you understand what is .so, .dll or .dylib? Do you understand what the compilation process involves in C++? If you do not know then investigate so that later you can explain

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Anonymous_Banned275
            wrote on last edited by
            #5

            @AnneRanch said in What does QT -= gui do?:

            do not get why adding QT widget class to project came up with this
            QT -= gui

            Let me rephrase, especially the above.
            I did say I understand what C +-= does.
            (So why the sermon?)

            What I was asking - why is -= gui REMOVED ?

            Is in not (qui) very common object AND and theory it should
            read AKA leave it alone

            QT += widgets

            Besides - the wizard forgot to add widgets.

            eyllanescE 1 Reply Last reply
            0
            • A Anonymous_Banned275

              @AnneRanch said in What does QT -= gui do?:

              do not get why adding QT widget class to project came up with this
              QT -= gui

              Let me rephrase, especially the above.
              I did say I understand what C +-= does.
              (So why the sermon?)

              What I was asking - why is -= gui REMOVED ?

              Is in not (qui) very common object AND and theory it should
              read AKA leave it alone

              QT += widgets

              Besides - the wizard forgot to add widgets.

              eyllanescE Offline
              eyllanescE Offline
              eyllanesc
              wrote on last edited by
              #6

              @AnneRanch Probably you select the option "Qt Console Application" (not "Qt Widgets Application") and gui is removed because Qt adds it by default but that type of project does not require them, on the other hand it does not have widgets because it is not included by default by Qt and being a project of console does not need widgets.

              If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

              1 Reply Last reply
              1
              • JoeCFDJ Offline
                JoeCFDJ Offline
                JoeCFD
                wrote on last edited by JoeCFD
                #7

                when a Qt project is created, core and gui are default settings.
                Only when widgets are needed, you add widgets module.
                It is unnecessary to remove
                QT -= gui
                and then add
                QT += widgets
                Both are needed actually.
                QT += gui widgets
                Originally, gui was used for widgets as well. Later, all widgets related classes were grouped into module widgets.

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved