Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with running qtquick example: (Please call KDDockWidgets::initPlatform()). #462

Closed
capNmo opened this issue Jan 17, 2024 · 3 comments

Comments

@capNmo
Copy link

capNmo commented Jan 17, 2024

Im trying to include KDDockWidgets in a new sample project. im using qtquick.

  • windows 10
  • qt5

This is my project structure:
root
├── CMakeLists.txt(1)
└── deps
-----└── bin
-----└── include
-----└── lib
└── SimpleProject
------└── CMakeLists.txt(2)
------└── main.cpp
------└── qml.qrc
------└── main.qml and other qml files in full example


deps folder contains KDDockWidgets build results (installation dir of it)


CMakeLists.txt (1): (contains project and deps)

cmake_minimum_required(VERSION 3.15)
project(SimpleProject VERSION 0.2 LANGUAGES CXX)
set(deps "${CMAKE_CURRENT_SOURCE_DIR}/deps")
list(APPEND CMAKE_PREFIX_PATH ${deps})
list(APPEND CMAKE_MODULE_PATH ${deps}/lib/cmake)
add_subdirectory(SimpleProject)

CMakeLists.txt (2): (contains project)

find_package(Qt5 COMPONENTS Core Quick Charts REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTORCC TRUE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(EXECUTABLE_NAME SimpleProject)

find_package(KDDockWidgets REQUIRED)

add_executable(${EXECUTABLE_NAME})
target_sources(${EXECUTABLE_NAME} PRIVATE
        main.cpp
        qml.qrc)
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
        KDAB::kddockwidgets)

main.cpp and main.qml are copied from Git example


When trying to build this error appears:

__cdecl KDDockWidgets::QtCommon::Platform_qt::GlobalEventFilter::GlobalEventFilter(class KDDockWidgets::QtCommon::Platform_qt *) Expected a qGuiApp!
Please call KDDockWidgets::initPlatform() after QGuiApplication
QObject::connect(QGuiApplication, Unknown): invalid nullptr parameter
QCommandLineParser: call process() or parse() before isSet
QCommandLineParser: call process() or parse() before isSet
QCommandLineParser: call process() or parse() before isSet
QCommandLineParser: call process() or parse() before isSet
QCommandLineParser: call process() or parse() before isSet
QCommandLineParser: call process() or parse() before isSet
@iamsergio
Copy link
Contributor

Does the git example itself work, if you build it directly from within examples/ ?

@capNmo
Copy link
Author

capNmo commented Jan 18, 2024

yes build was successful while building from github sources:

image

but now i need to run it from another simple project that use find_package(KDDockWidgets REQUIRED)

@iamsergio
Copy link
Contributor

Are you sure you kept the KDDockWidgets::initFrontend call ?

I don't know how this could happen.
If you upload a sample project that reproduces the problem I'll be happy to fix it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants