We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
set(QWINDOWKIT_ENABLE_QT_WINDOW_CONTEXT ON CACHE BOOL "") set(QWINDOWKIT_ENABLE_WINDOWS_SYSTEM_BORDERS OFF CACHE BOOL "")
CMakelists.txt
set(QWINDOWKIT_BUILD_STATIC ON CACHE BOOL "") set(QWINDOWKIT_BUILD_WIDGETS OFF CACHE BOOL "") set(QWINDOWKIT_BUILD_QUICK ON CACHE BOOL "") set(QWINDOWKIT_ENABLE_QT_WINDOW_CONTEXT ON CACHE BOOL "") set(QWINDOWKIT_ENABLE_WINDOWS_SYSTEM_BORDERS OFF CACHE BOOL "") # Add subdirectories add_subdirectory(qwindowkit) # Set project source files set(PROJECT_SOURCES main.cpp qml/main.qml qml/QWKButton.qml qml/qml.qrc resources/qwk.qrc ) # Add executable based on Qt version if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) qt_add_executable(${PROJECT_NAME} MANUAL_FINALIZATION ${PROJECT_SOURCES} ) else() add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ) endif() # Configure target qm_configure_target(${PROJECT_NAME} QT_LINKS Core Gui Qml Quick LINKS QWKQuick )
main.qml
WindowAgent { id: windowAgent } MouseArea { anchors.fill: parent acceptedButtons: Qt.LeftButton onDoubleClicked: { if (window.visibility === Window.Maximized) { window.showNormal() } else { window.showMaximized() } } }
这个双击事件只在 icon 上产生效果,其他位置不生效
The text was updated successfully, but these errors were encountered:
现在是注释掉
// Component.onCompleted: windowAgent.setTitleBar(titleBar)
然后自己实现来解决这个问题
Sorry, something went wrong.
你给的main.qml代码片段太短,就几行,我们怎么分析?
一定要仔细看README。被设置为标题栏的item,所有交互事件都会被接管,也就是不再会响应任何鼠标事件了。如果你想让标题栏内的控件继续响应鼠标事件,要手动setHitTestVisible。
No branches or pull requests
set(QWINDOWKIT_ENABLE_QT_WINDOW_CONTEXT ON CACHE BOOL "")
set(QWINDOWKIT_ENABLE_WINDOWS_SYSTEM_BORDERS OFF CACHE BOOL "")
CMakelists.txt
main.qml
这个双击事件只在 icon 上产生效果,其他位置不生效
The text was updated successfully, but these errors were encountered: