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. Header file not found
Forum Updated to NodeBB v4.3 + New Features

Header file not found

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 718 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.
  • O Offline
    O Offline
    ofmrew
    wrote on last edited by
    #1

    In the latest version of QtCreator, I used add new to create a class, both header and sources files were created. I promoted a Widget in Design to the new class, renamed and checked autoFill Background. Then when I started to add
    ui->canvas->setBackgroundRole(QPalette::Base);
    I see the message canvas.h not found.

    An aside, one note also about the editor: I found using ui. and having the editor change it to ui-> very helpful, but that has been removed.

    How do I get a header file, that was created by Qt, found?

    O M 2 Replies Last reply
    0
    • cristian-adamC Offline
      cristian-adamC Offline
      cristian-adam
      wrote on last edited by
      #2

      I think it's a regression in Qt Creator 8. Please open a bug report at https://bugreports.qt.io/

      Thank you.

      1 Reply Last reply
      0
      • O ofmrew

        In the latest version of QtCreator, I used add new to create a class, both header and sources files were created. I promoted a Widget in Design to the new class, renamed and checked autoFill Background. Then when I started to add
        ui->canvas->setBackgroundRole(QPalette::Base);
        I see the message canvas.h not found.

        An aside, one note also about the editor: I found using ui. and having the editor change it to ui-> very helpful, but that has been removed.

        How do I get a header file, that was created by Qt, found?

        O Offline
        O Offline
        ofmrew
        wrote on last edited by
        #3

        @ofmrew I forgot to ass additional information:
        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

        SOURCES +=
        main.cpp
        mainwindow.cpp
        mycanas.cpp

        HEADERS +=
        mainwindow.h
        mycanas.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

        {noformat}
        Qt 6.3.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 10.3.1 20210422 (Red Hat 10.3.1-1)) on "xcb"
        OS: Linux Mint 20.1 [linux version 5.4.0-58-generic]

        Kit compiler Desktop qt 6.3.1 GCC 64bit

        1 Reply Last reply
        0
        • O ofmrew

          In the latest version of QtCreator, I used add new to create a class, both header and sources files were created. I promoted a Widget in Design to the new class, renamed and checked autoFill Background. Then when I started to add
          ui->canvas->setBackgroundRole(QPalette::Base);
          I see the message canvas.h not found.

          An aside, one note also about the editor: I found using ui. and having the editor change it to ui-> very helpful, but that has been removed.

          How do I get a header file, that was created by Qt, found?

          M Offline
          M Offline
          mpergand
          wrote on last edited by
          #4

          @ofmrew said in Header file not found:

          I see the message canvas.h not found.

          HEADERS +=
          mainwindow.h
          mycanas.h ---> ?

          O 1 Reply Last reply
          0
          • M mpergand

            @ofmrew said in Header file not found:

            I see the message canvas.h not found.

            HEADERS +=
            mainwindow.h
            mycanas.h ---> ?

            O Offline
            O Offline
            ofmrew
            wrote on last edited by
            #5

            @mpergand I see the problem, it should be canvas and not canas! The old eyes have see too many mango seasons. Thanks.

            1 Reply Last reply
            0

            • Login

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