223 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
0
answers
66
views
Qt's MOC can not find headers under include/projname [duplicate]
This question is not a duplicate of undefined reference to `vtable for MainWindow'. As I have mentioned in the following I know how to solve the compile error but my question is how to solve the ...
0
votes
1
answer
275
views
Warning failed to resolve include moc_predefs.h - VS2022 Qt5.15.2
I have a project written in Visual Studio 2022 c++ with Qt5.15.2 (x64).
It comiles and works just fine.
During compilation I get a warning for each widget-derived-class in my project.
Moc'ing ...
0
votes
2
answers
145
views
Visual Studio 2022 generate empty moc files with define
My QtExample.h with Q_OBJECT has an #ifdef _FEATURE. The #ifdef wraps the class. In Project -> C++ -> Preprocessor -> Preprocessor Definitions, this _FEATURE is specified. When moc.exe runs ...
0
votes
1
answer
50
views
Makefile patsubst apply pattern to filename not to full path
I am creating a Makefile to build an application with Qt using moc.
MOC_HEADERS=include/test.hpp include/test/test.hpp
MOC_SRCS=$(patsubst include/%.hpp,build/moc/moc_%.cpp,${MOC_HEADERS})
The first ...
0
votes
0
answers
120
views
error: no match for 'operator!=' (operand types are 'QVector<Object>' {aka 'QList<Object>'} and 'QList<Object>')
I have Qt code that looks like following:
class test_gadget {
Q_GADGET
Q_PROPERTY(QString test MEMBER test)
public:
QString test;
};
class test_gadget2 {
Q_GADGET
Q_PROPERTY(...
2
votes
1
answer
280
views
qt6apptestqt_debug_metatypes.json: illegal value
EDIT
My CMake file looks like this:
cmake_minimum_required(VERSION 3.16)
project(testqt VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 6.4 ...
0
votes
1
answer
99
views
How to tell gcc that my source contains Q_OBJECT?
I am trying to compile an object file, for C++/Qt; but I receive the warning below, stating that there is no "Q_OBJECT" in my code.
Do I miss something? (my CMakeList.txt contains set(...
katang's user avatar
- 2,824
0
votes
1
answer
133
views
How to use CMake for multi-component QT project
I created project in QT designer. In designer I use my own widget
class DockWidget : public QDockWidget
But during building in linux server I got an error
dockwidget.h: No such file or directory
...
0
votes
0
answers
463
views
Qt/C++: 'undefined reference to __imp__ZN5Enemy16staticMetaObjectE' when building project on Windows with MinGW
It is my first post here so please ask for any extra info you need!
I have to make this game in Qt with a given source code to start from: world.h & world.cpp
Given code class example:
Now when I ...
0
votes
1
answer
123
views
VS 2022 generates double moc.obj files
If I try to compile a simple Qt project, I receive 6 linking errors:
mocs_compilation_Release.obj : error LNK2005: "private: static void __cdecl MainWindow::qt_static_metacall(class QObject *,...
0
votes
0
answers
63
views
C++ QT - moc_class.o Problem with connecting signal and slot for QLabel in QGridLayout
I am trying to program a code, which projects a QGridLayout with several QLabels, which contain pictures. When clicking on a QLabel, I want to call a function and "do stuff". Unfortunately I ...
0
votes
1
answer
248
views
How to hide the automatic generated moc_, autouic_ and ui_ files in VisualStudion 2022?
I'm working on a CMake project that uses Qt. To automatically generate MOC and UI files, I've set the CMAKE_AUTOMOC and CMAKE_AUTOUIC options to ON in my CMakeLists file. As a result, Visual Studio ...
0
votes
0
answers
89
views
undefined refderence to vtable with Qt library using Q_OBJECT
After some research I found a solution for this error that has happened to a fiew fellow programmers:
#include <QtCharts/QChartView>
class A {
class MyQObject: public QtCharts::QChartView {
...
0
votes
1
answer
334
views
When using Qt with CMake project in vs2017, LNK2001 unresolved external symbol "public: virtual void * __cdecl MainWindow::qt_metacast(char const *)"
I'm currently attempted to use Qt project in the way that cmake compile project. I worked with Qt creator 4.11.1. I make new exercise in which the way of compilation is selected with cmake. It's most ...
0
votes
1
answer
828
views
CMake AUTOMOC vs. qt5_wrap_cpp
I would wish to use qt5_wrap_cpp (much faster) than CMake's AUTOMOC feature, but I have a problem. In one of the libraries (other compile fine) some of generated moc files with qt5_wrap_cpp are ...