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. Do I need to include Q headers inner Q headers and to make these pre-compiled
Forum Updated to NodeBB v4.3 + New Features

Do I need to include Q headers inner Q headers and to make these pre-compiled

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 313 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.
  • J Offline
    J Offline
    JacobNovitsky
    wrote on last edited by
    #1

    My fresh project builds for 2-4 seconds which is not good, put pragma once to headers an made one with Qt headers PRECOMPILED

    Ubuntu, Jammy Fish, 6.2.4, Huawei D15

    Need to speed up to zero or 1 second
    Some KDAB guys say you need to make PCH all Qt headers in compiling chain

    Please advise

    #pragma once
    #ifndef Static_lib_H
    #define Static_lib_H
    
    
    #if defined __cplusplus
    /* Add C++ includes here */
    #include <QDialog>
    #include <QStandardItemModel>
    #include <QMainWindow>
    #include <QWidget>
    #include <string.h>
    #include <iostream>
    #include <QApplication>
    #endif
    
    using namespace std;
    
    
    class Static_lib
    {
    public:
        Static_lib();
    };
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++17
    #
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    PRECOMPILED_HEADER  = Static_lib.h
    
    SOURCES += \
        Static_lib.cpp
        main.cpp
        mainwindow.cpp
    
    HEADERS += \
        mainwindow.h
    
    FORMS += \
        mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    C 1 Reply Last reply
    0
    • J JacobNovitsky

      My fresh project builds for 2-4 seconds which is not good, put pragma once to headers an made one with Qt headers PRECOMPILED

      Ubuntu, Jammy Fish, 6.2.4, Huawei D15

      Need to speed up to zero or 1 second
      Some KDAB guys say you need to make PCH all Qt headers in compiling chain

      Please advise

      #pragma once
      #ifndef Static_lib_H
      #define Static_lib_H
      
      
      #if defined __cplusplus
      /* Add C++ includes here */
      #include <QDialog>
      #include <QStandardItemModel>
      #include <QMainWindow>
      #include <QWidget>
      #include <string.h>
      #include <iostream>
      #include <QApplication>
      #endif
      
      using namespace std;
      
      
      class Static_lib
      {
      public:
          Static_lib();
      };
      
      QT       += core gui
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      CONFIG += c++17
      #
      # You can make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      PRECOMPILED_HEADER  = Static_lib.h
      
      SOURCES += \
          Static_lib.cpp
          main.cpp
          mainwindow.cpp
      
      HEADERS += \
          mainwindow.h
      
      FORMS += \
          mainwindow.ui
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @JacobNovitsky said in Do I need to include Q headers inner Q headers and to make these pre-compiled:

      Need to speed up to zero or 1 second

      Why?

      J 1 Reply Last reply
      1
      • C ChrisW67

        @JacobNovitsky said in Do I need to include Q headers inner Q headers and to make these pre-compiled:

        Need to speed up to zero or 1 second

        Why?

        J Offline
        J Offline
        JacobNovitsky
        wrote on last edited by
        #3

        @ChrisW67 why one should wait 4 seconds if one can easy set it to 0 or 1 second?

        Pl45m4P 1 Reply Last reply
        0
        • J JacobNovitsky

          @ChrisW67 why one should wait 4 seconds if one can easy set it to 0 or 1 second?

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @JacobNovitsky

          There is always better, faster, wider etc...
          Depending on the environment and use case, 4secs is not that long.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          Christian EhrlicherC 1 Reply Last reply
          0
          • C ChrisW67 referenced this topic on
          • Pl45m4P Pl45m4

            @JacobNovitsky

            There is always better, faster, wider etc...
            Depending on the environment and use case, 4secs is not that long.

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

            Dupe of https://forum.qt.io/topic/150964/how-to-set-needed-permission-so-i-can-edit-qt-headers-from-qt-creator

            Please stop spamming the forum with the same question...

            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
            2
            • Christian EhrlicherC Christian Ehrlicher locked this topic on

            • Login

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