Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Adding UI elements to a form is not propagated to the code
Forum Updated to NodeBB v4.3 + New Features

Adding UI elements to a form is not propagated to the code

Scheduled Pinned Locked Moved Unsolved General and Desktop
26 Posts 6 Posters 4.2k Views 2 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.
  • I Offline
    I Offline
    In Fo
    wrote on last edited by
    #16

    @Christian-Ehrlicher said in Adding UI elements to a form is not propagated to the code:

    QtCreator even warns about such wrong includes.

    It has certainly neglected to warn me. What is the mechanism that it should warn through?

    Christian EhrlicherC 1 Reply Last reply
    0
    • I In Fo

      @Christian-Ehrlicher said in Adding UI elements to a form is not propagated to the code:

      QtCreator even warns about such wrong includes.

      It has certainly neglected to warn me. What is the mechanism that it should warn through?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #17

      @In-Fo The clang code model will underline the include statement

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

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

        After almost two cruelling months of using QtCreator / QtDesigner I feel an urge to contribute to this "holy war".
        I will admit UP FRONT - I do not RTFM BEFORE i code - besides most of the doc are cookie cutters / repetitive and GENERALLY lack good examples - especially for QtDesigner. ( YES i picked Qt for GUI application. )

        So here is my "contribution" -
        implement "connect" in QtDesigner and then find it in YOUR code!
        Implement "SLOT" and associated "SIGNAL" then muddle thru the code...
        Don't "connect" SLOT and SIGNAL belong to the SAME family to accomplish the task ?
        But it is not only "connectivity" which is a big stumbling block in learning to use Qt, it is the lack of comprehensive explanation on how things interact. My favourite .pro "file" etc. ( I have brought this subject on before - so I won't repeat it here.)

        Cheers END OF RANT

        kshegunovK 1 Reply Last reply
        -2
        • A Anonymous_Banned275

          After almost two cruelling months of using QtCreator / QtDesigner I feel an urge to contribute to this "holy war".
          I will admit UP FRONT - I do not RTFM BEFORE i code - besides most of the doc are cookie cutters / repetitive and GENERALLY lack good examples - especially for QtDesigner. ( YES i picked Qt for GUI application. )

          So here is my "contribution" -
          implement "connect" in QtDesigner and then find it in YOUR code!
          Implement "SLOT" and associated "SIGNAL" then muddle thru the code...
          Don't "connect" SLOT and SIGNAL belong to the SAME family to accomplish the task ?
          But it is not only "connectivity" which is a big stumbling block in learning to use Qt, it is the lack of comprehensive explanation on how things interact. My favourite .pro "file" etc. ( I have brought this subject on before - so I won't repeat it here.)

          Cheers END OF RANT

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #19

          Out of curiosity, did you have a fairly good understanding and experience in C++ before picking Qt?

          Read and abide by the Qt Code of Conduct

          A 1 Reply Last reply
          2
          • Christian EhrlicherC Christian Ehrlicher

            @In-Fo The clang code model will underline the include statement

            I Offline
            I Offline
            In Fo
            wrote on last edited by
            #20

            @Christian-Ehrlicher
            Which include statement? Do you seriously expect all developers scan 100% of our projects for something underlined, after running into a problem like above?
            Bottom line is that if an IDE auto-generates (itself) or outsources auto-generation of some internal files to another tool (that is a part of vendor's toolchain) then both have to be mindful of the platforms that they claim to multiplatform on.

            Qt claims to be multiplatform but it is not mindful of the case sensitivity of files that it auto-generates behind the scenes. How do you envision developers in a teem cooperating from Windows and Linux machines, when the same project that they work on has incompatible auto-generated files, like in my case?

            If a form class is camel-cased, tools on either platform must obey camel-casing and auto-generate files consistently. Is this too much to ask for?

            JonBJ 1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #21

              It's your task to use the correct camel casing for all files. If you add a wrong include statement it's your fault. I don't see where the tools can help you here. It's as simple as using a wrong camel cased class name like Qdialog instead QDialog.
              I still don't have a valid case where you hit a problem though...

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              1
              • I Offline
                I Offline
                In Fo
                wrote on last edited by
                #22

                Only if I create those files myself. If Qt Creator auto-generates them based on the class name of the file that I create, it is not my responsibility.
                Auto-generated files have to be named correctly by the tool that auto-generates them. It should not be the responsibility of the tool's user to double-check that it does its job properly.
                When the tool auto-generates files with the correct name sometimes, or only on some OS's but not on others, it is not fulfilling its stated purpose.

                I'll repeat: the file's name changed along the lifetime of the project from the one that matched the underlying class's name to the one that no longer matches it. None of the developers has visibility into the name that the tool uses behind the scenes to auto-generate that file. It is probably not productive to blame me for that. The tool has to work consistently across all platforms that Qt Creator claims to support.

                kshegunovK 1 Reply Last reply
                -1
                • I In Fo

                  Only if I create those files myself. If Qt Creator auto-generates them based on the class name of the file that I create, it is not my responsibility.
                  Auto-generated files have to be named correctly by the tool that auto-generates them. It should not be the responsibility of the tool's user to double-check that it does its job properly.
                  When the tool auto-generates files with the correct name sometimes, or only on some OS's but not on others, it is not fulfilling its stated purpose.

                  I'll repeat: the file's name changed along the lifetime of the project from the one that matched the underlying class's name to the one that no longer matches it. None of the developers has visibility into the name that the tool uses behind the scenes to auto-generate that file. It is probably not productive to blame me for that. The tool has to work consistently across all platforms that Qt Creator claims to support.

                  kshegunovK Offline
                  kshegunovK Offline
                  kshegunov
                  Moderators
                  wrote on last edited by kshegunov
                  #23

                  @In-Fo said in Adding UI elements to a form is not propagated to the code:

                  Only if I create those files myself. If Qt Creator auto-generates them based on the class name of the file that I create, it is not my responsibility.

                  The class name has nothing to do with the generated file, which is also in the docs mind you. The .ui form file's name uic uses exactly as a name to generate the header file. That is:

                  myFormName.ui >> ui_myFormName.h
                  

                  The include:

                  #include "ui_myformname.h"
                  

                  works on windows (but not on linux), just because windows is case-aware, but case-insensitive. It is not the fault of the toolchain for a decision made by the os vendor a long, long time ago, be it that good or bad. If you have had the file generated once and only then changed to camel-case name the OS, the toolchain or anything that uses the OS's API can't distinguish, so uic overwrites the file with the old name ... solution is to simply remove the old file and re-generate it, that's your job though, no automation can do anything 'bout it.

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  3
                  • kshegunovK kshegunov

                    Out of curiosity, did you have a fairly good understanding and experience in C++ before picking Qt?

                    A Offline
                    A Offline
                    Anonymous_Banned275
                    wrote on last edited by
                    #24

                    @kshegunov said in Adding UI elements to a form is not propagated to the code:

                    Out of curiosity, did you have a fairly good understanding and experience in C++ before picking Qt?
                    Wrote my first program in 1973 - in assembly.
                    Wrote couple of C programs in 1987 - before Windows .
                    Was Q&A analyst for Visual Basic software ...
                    NO, I do not have a foggiest idea about programming...

                    kshegunovK 1 Reply Last reply
                    0
                    • I In Fo

                      @Christian-Ehrlicher
                      Which include statement? Do you seriously expect all developers scan 100% of our projects for something underlined, after running into a problem like above?
                      Bottom line is that if an IDE auto-generates (itself) or outsources auto-generation of some internal files to another tool (that is a part of vendor's toolchain) then both have to be mindful of the platforms that they claim to multiplatform on.

                      Qt claims to be multiplatform but it is not mindful of the case sensitivity of files that it auto-generates behind the scenes. How do you envision developers in a teem cooperating from Windows and Linux machines, when the same project that they work on has incompatible auto-generated files, like in my case?

                      If a form class is camel-cased, tools on either platform must obey camel-casing and auto-generate files consistently. Is this too much to ask for?

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by JonB
                      #25

                      @In-Fo said in Adding UI elements to a form is not propagated to the code:

                      Qt claims to be multiplatform but it is not mindful of the case sensitivity of files that it auto-generates behind the scenes.

                      If a form class is camel-cased, tools on either platform must obey camel-casing and auto-generate files consistently. Is this too much to ask for?

                      When the tool auto-generates files with the correct name sometimes, or only on some OS's but not on others, it is not fulfilling its stated purpose.

                      I'll repeat: the file's name changed along the lifetime of the project from the one that matched the underlying class's name to the one that no longer matches it.

                      Are you able to reproduce the "file's name changed along the lifetime of the project"? So far as I am aware, the only time Qt Creator auto-generates a filename is when you add a new class via the wizard, and at that point it makes the case of the filename all lower case, at least under Linux presumably so case is consistent. If you then, for example, change the spelling of the class name without doing it via Creator's Rename they may get out-of-sync.

                      1 Reply Last reply
                      1
                      • A Anonymous_Banned275

                        @kshegunov said in Adding UI elements to a form is not propagated to the code:

                        Out of curiosity, did you have a fairly good understanding and experience in C++ before picking Qt?
                        Wrote my first program in 1973 - in assembly.
                        Wrote couple of C programs in 1987 - before Windows .
                        Was Q&A analyst for Visual Basic software ...
                        NO, I do not have a foggiest idea about programming...

                        kshegunovK Offline
                        kshegunovK Offline
                        kshegunov
                        Moderators
                        wrote on last edited by kshegunov
                        #26

                        @AnneRanch said in Adding UI elements to a form is not propagated to the code:

                        @kshegunov said in Adding UI elements to a form is not propagated to the code:

                        Out of curiosity, did you have a fairly good understanding and experience in C++ before picking Qt?

                        Wrote my first program in 1973 - in assembly.
                        Wrote couple of C programs in 1987 - before Windows .
                        Was Q&A analyst for Visual Basic software ...
                        NO, I do not have a foggiest idea about programming...

                        None of which is actually an answer to my question. But doesn't matter, there's no need for the snide remarks, I did only ask out of curiosity.

                        @JonB said in Adding UI elements to a form is not propagated to the code:

                        Are you able to reproduce the "file's name changed along the lifetime of the project"? So far as I am aware, the only time Qt Creator auto-generates a filename is when you add a new class via the wizard, and at that point it makes the case of the filename all lower case, at least under Linux presumably so case is consistent.

                        This is for sources/headers/form files/resources etc. In any case there's the option to correct the file name before creating the file. Here it's about the ui_<formname>.h which is generated by the uic.

                        Read and abide by the Qt Code of Conduct

                        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