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

Mouse click failed in QWidget. #111

Open
USTC-Wang opened this issue Sep 20, 2023 · 13 comments
Open

Mouse click failed in QWidget. #111

USTC-Wang opened this issue Sep 20, 2023 · 13 comments
Assignees
Labels
Rudi Rudi answer is needed

Comments

@USTC-Wang
Copy link

I am using qt's createWindowContainer to put ultravnc's window in qwidget, but after that, the mouse click doesn't work, only after clicking on "switch monitor" or "full screen" in the toolbar. I don't seem to see a similar problem on the web. The environment: windows 10(1909), ultravnc Release 1.4.3.1.

@Neustradamus Neustradamus added the Rudi Rudi answer is needed label Sep 22, 2023
@RudiDeVos
Copy link
Member

You embed the VNCViewer in a qt window and have problems with the mouse.

I know some company embed it ( don't know if they use MFC,Radstudio, or Qt?
They start the viewer as follow
vncviewer.exe a.b.c.d -noborder -directx -notoolbar -nostatus
Please experiment with the commandlines.

I'm not a Qt expert sorry.

@Neustradamus Neustradamus removed the Rudi Rudi answer is needed label Sep 26, 2023
@Neustradamus
Copy link

@jose94752: Can you look it?

@jose94752
Copy link
Contributor

jose94752 commented Sep 5, 2024

We need to configure cmake for Qt and work too on a UltraVNC Qt From Scratch environment.
First to test your code C/C++ Qt in the createWindowContainer if it works on the From Scratch environment is a need of cmake configuration for Qt you need.

Actually can't compile the original source code with Visual Studio 2022 and cmake from Visual Studio 2022 Developer Command Prompt v17.11.2
<<
Severity Code Description Project File Line Deletion status Details
Error CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find LibLZMA (missing: LIBLZMA_LIBRARY LIBLZMA_INCLUDE_DIR
LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET) C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake 230

And From Qt Creator I have errors like "mingw32-make[1]: *** No rule to make target '/vncviewer/AboutBoxQt.ui', needed by 'ui_AboutBoxQt.h'. Stop."

You can see where I am on my github the fork environment UltraVNC branche QtCommunityTests
From these repository you can read:
-> cmake/readme.txt section "# Windows with cmake, generate Qt project files (Qt Community Tests Specific)"
-> VCPKG_README.txt
-> .gitingnore section "# Qt Specific gitignore"
-> cmake/vncviewer/CMakeLists.txt and cmake/vncviewer/CMakeLists.devTry
-> CMakeLists.devTry (on the root of UltraVNC which is an example from Qt documentation)
-> UltraVNC-QtCommunityTests.pro (you can use but uncomment the lines. I have comment for try to debug the "needed by Error")

@jose94752
Copy link
Contributor

jose94752 commented Sep 6, 2024

2024-09-06 19-11-00-CMakeCacheDotTxt
I have try to delete vcpkg and obj folders and reconstruct them. But after the error ZLIB came back.
c:\source\UltraVNC>cmake cmake/CMakeLists.txt
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.30/Modules/FindZLIB.cmake:202 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
librdr/CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!

@Neustradamus
Copy link

@bernhardu: Can you look the @jose94752 error?

@bernhardu
Copy link
Contributor

bernhardu commented Sep 7, 2024

Just for the record - I assume the official way to build is what Rudi is using, and this currently are the VS solution files, as stated at the bottom of the main README.md.

UltraVNC/README.md

Lines 105 to 106 in 4ba27a2

- ⚙️ vncviewer_VS2017.sln to build UltraVNC Viewer
- ⚙️ winvnc_VS2017.sln to build UltraVNC Server

The cmake files are there to be able to use some other compilers, or to build on non-windows systems.
Maybe this might change at some point in future, if generating the VC solutions from the cmake files takes less effort for Rudi than maintaining them manually.

When the cmake readme got written, I was not aware that vcpkg is also delivered by Visual Studio - therefore the readme contains the manual clone of it - on the next iteration I should try to document the Visual Studio supplied vcpkg and it should configure without needing these two variables ...

The cmake readme shows currently this three lines, so please try in your example cmake -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static cmake/CMakeLists.txt

UltraVNC/cmake/readme.txt

Lines 99 to 102 in 4ba27a2

cmake ^
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake ^
-DVCPKG_TARGET_TRIPLET=x64-windows-static ^
..\UltraVNC\cmake

@jose94752
Copy link
Contributor

@bernhardu: Thanks I have understood some install errors I have doing. I push the text updated files on my github the fork environment UltraVNC branche QtCommunityTests and the will work on the new error later.
2024-09-07 20-08-00-Visual Studio-Error cmake zstdConfigDotCmake.txt

@jose94752
Copy link
Contributor

jose94752 commented Sep 9, 2024

Configuration CMAKE where I should compile ? In the c:\source\obj folder ? I should configure Visual Studio 2022 for compile in that folder ? May be I will break the folder with the files or on the .vs folder on the C:\UltraVNC.vs ?
2024-09-09 19-55-00-Configuration CMAKE where I should compile

And command line for Qt Creator compile on the folder C:\source\UltraVNC\build
2024-09-09 20-09-00-Configuration CMAKE where I should compile 2

@bernhardu
Copy link
Contributor

Configuration CMAKE where I should compile ? In the c:\source\obj folder ? I should configure Visual Studio 2022 for compile in that folder ? May be I will break the folder with the files or on the .vs folder on the C:\UltraVNC.vs ? !
...

And command line for Qt Creator compile on the folder C:\source\UltraVNC\build !
...

I am not sure if I understand you right.
You can call cmake from a freely selected "object" directory, with e.g. the last argument the directory where the CMakeLists.txt lives, as absolute or relative path.
This object directory can also be the source directory, a subdirectory of the source directory, or outside of the source directory. The last two allow to have multiple object directories getting built from the same source directory.
I guess QtCreator simply chooses this directory name based on version, compiler and build configuration.

@jose94752
Copy link
Contributor

No it's configuration problem with Visual Studio 2022, I want to use for test existing code. Once the build work with VS 2022 I will configure Qt Creator. Actually I try to fix Zlib error and co with a CMakeSettings.json file.
[QtCommunityTests 829c3e6] Update of cmake/CMakeSettings.json not sure for "type" = "STATIC". Compare from C:\source\obj\CMakeCache.txt with the Visual Studio 2022 C:\source\UltraVNC\cmake\CMakeCache.txt and update the json file. Unfinished.

@jose94752
Copy link
Contributor

jose94752 commented Oct 21, 2024

New start from the beginning with clone everything's but Visual Studio Community 2022 error still active for me on my computer.
Severity Code Description Project File Line Suppression State Details Error CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message): Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake 233 May be linked to Issue #230
I will work on Qt Creator Community now for a while, despite I can't fix these on VSC 2022

@Neustradamus Neustradamus added the Rudi Rudi answer is needed label Oct 21, 2024
@RudiDeVos
Copy link
Member

Visual studio use vcpkg and all missing libs should be in it.
I just compiled the project from 2019 with Visual Studio 2022 (25 succeeded, 0 failed, 0 skipped), no code or any config change

@jose94752
Copy link
Contributor

jose94752 commented Oct 25, 2024

The file .pro Qt Creator file of the project need changes to work.
Line 2
QT = core gui #Fix Error 'QMainWindow' file not found and "Project ERROR: Unknown module(s) in QT: Core" don't use "Core" use "core" respect case
To
QT = core gui widgets #Fix Error 'QMainWindow' file not found and "Project ERROR: Unknown module(s) in QT: Core" don't use "Core" use "core" respect case

And the path like
\zipunzip_src\zip20\windll\windll.c \ \ZipUnZip32\ZipUnzip32.cpp \ <- Last line of source for example
to
zipunzip_src/zip20/windl/windll.c \ ZipUnZip32/ZipUnzip32.cpp

@USTC-Wang Is your's .pro 'QT=' line have widgets on it ?

Edit: Actually after an update the main of my fork local on my computer, I have the similar error :-1: error: dependent '..\..\..\..\..\..\Qt\6.7.3\msvc2022_64\include\QtWidgets\QMainWindow' does not exist. I search since a few days how to solve. I will make a new comment when I solved it.

Edit2: Check that on your system (I have just reinstall all of Qt with version 6.7.3 inside).
C:\source\UltraVNC>set QTDIR
QTDIR=C:\Qt\6.7.2\msvc2019_64
Update these one if you find that to the 'C:\Qt\6.7.3<version of kit you use>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rudi Rudi answer is needed
Development

No branches or pull requests

5 participants