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. Testing with Google Tests Error: QMainWindow: no such file or directory
Forum Updated to NodeBB v4.3 + New Features

Testing with Google Tests Error: QMainWindow: no such file or directory

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 3 Posters 546 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.
  • J Offline
    J Offline
    JosefSelajo
    wrote on last edited by
    #1

    Hello,
    I'm trying to test my database-functions with google test.
    My database-functions run without any errors.
    but if I try to test my functions with google test and include my header file, where the functions are on, it always says:
    QMainWindow: no such file or directory
    So far my .pro looks like this

    QT += core gui
    QT += widgets
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    QT += sql
    CONFIG += c++11
    
    
    include(gtest_dependency.pri)
    
    MYSQL_LIBS=-lmysqld
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    
    TEMPLATE = app
    CONFIG += console c++11
    CONFIG -= app_bundle
    CONFIG += thread
    CONFIG -= qt
    
    HEADERS += \
            tst_test.h
    
    SOURCES += \
            main.cpp
    
    
    

    If I try testing my functions with Qt tests (and add the QT += lines), no errors occure with QMainWindow. But I need to use google tests.

    Does somebody know what I have to do?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You have "CONFIG -= qt" in your .pro file.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4
      • J Offline
        J Offline
        JosefSelajo
        wrote on last edited by
        #3

        thank you!
        It's working!

        Pablo J. RoginaP 1 Reply Last reply
        1
        • J JosefSelajo

          thank you!
          It's working!

          Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          @JosefSelajo said in Testing with Google Tests Error: QMainWindow: no such file or directory:

          It's working!

          Great, so please don't forget to mark your post as solved!

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          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