Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
82.7k Topics 452.1k Posts
  • How to load a DICOM data with DCMTK

    Unsolved
    3
    0 Votes
    3 Posts
    85 Views
    SGaistS

    Hi,

    First thing, I would simplify the code to handle one known case, for example an RGB image and just show it on a QLabel.

    That said, from memory, DICOM images are pretty tricky and a library such as VTK is often used to handle them with Qt as front end.

  • 0 Votes
    9 Posts
    5k Views
    F

    This is an old topic, but you can use canReadLine() to check if a complete line has arrived. If not, just don`t read the buffer and wait for the next readyRead(). When a complete line arrive, use readLine(), so the tcp socket will let the contents after the \n to the next read and so on.

  • Qt 6 qml module and qml import path

    Unsolved
    4
    2 Votes
    4 Posts
    2k Views
    EndrII 0E

    @pjorourke
    What about qmlls (qml language server) - this language server continues to sent me warnings about not founded modules, but these modules are exists and qt creator found them.

  • The application was unable to start correctly 0xc0000279

    Unsolved
    2
    0 Votes
    2 Posts
    64 Views
    hskoglundH

    Just a wild guess, but if you have antivirus, try disabling it (unless it's Microsoft Defender).

  • 0 Votes
    2 Posts
    63 Views
    C

    @Sauntor said in How to make a library with the installed layout looks like Qt's internal modules (a.k. QtCore, QtQml, ect.)?:

    All in a word, how to make the library users use Demo like the way they use QtCore, for example:

    You cannot control how the users use the headers provided but you can give then the option of "clean" header names like <QWidget> the same way that Qt does it. The deployed headers files are:

    - include - QtWidgets (directory) - QtWidgets (file) - QWidget (file) - qwidget.h (file)

    The file "QWidget" simply contains:

    #include "qwidget.h"

    The file QtWidgets similarly includes all the headers for the entire module.

    The qmake or cmake setup ensures that the include/QtWidget folder is added to the include path when the widget module is invoked (e.g. QT += widgets). The include folder is also present. So, the user can specify:

    // found via the top level include path #include <QtWidgets/QWidget> #include <QtWidgets/qwidget.h> // found via the QtWidgets include path #include <QtWidgets> #include <QWidget> #include <qwidget.h>

    To do this for your library you need to deploy at least the "clean" files.

    I do not want to write any camel cased header wrappers manually, it should be auto generated, and how?

    You only need to do this once and check it in to your source control. It's probably faster than trying to automate. As for how you could automate this; there's no magic bullet here.

  • Controlling cursor size in qt applications

    Unsolved
    1
    0 Votes
    1 Posts
    85 Views
    No one has replied
  • QVulkanWindow freezes until swapchain recreation on macOS

    Unsolved
    1
    0 Votes
    1 Posts
    31 Views
    No one has replied
  • 0 Votes
    5 Posts
    92 Views
    l3u_L

    Well okay, then I'll go for variant 2 – seems more logical to me to declare such a shared const variable right away instead of having to re-reference it inside the implementation.

    Thanks for the clarification :-)

  • QVulkanWindow freezes until window resize on macOS only

    Unsolved
    4
    1 Votes
    4 Posts
    203 Views
    braernochB

    As for an MRE, this problem reproduces with the stock "hellovulkantriangle" example from Qt.

    Issue is present in all tested Qt versions: 6.5.3, 6.8.0, 6.8.1, 6.9.0
    Using Vulkan: 1.3.296 with bundled MotenVK
    On macOS: Sequoia 15.1

  • Build a QT project in VSCode on macOS.

    Unsolved
    1
    0 Votes
    1 Posts
    45 Views
    No one has replied
  • Moc file

    Unsolved
    13
    0 Votes
    13 Posts
    526 Views
    J

    if you just cp ABC to CBA it has no effect
    If you jump to moc file, then click to missing pushbutton function to go header
    then delete all functions which cause error
    its gone

  • Help Changing Format of TextEdit Without Replacing Contents

    Unsolved
    2
    0 Votes
    2 Posts
    71 Views
    C

    @CodermanBill wrote, "but nothing changed".

    You take some plain text, wrap it in HTML that does not attempt to style or otherwise format it, reinsert it into the editor, and expect something to change (I assume visually). What exactly are you expecting?

  • advice on debugging bus error

    Unsolved
    3
    0 Votes
    3 Posts
    104 Views
    A

    Thanks @Pl45m4 Ouch! I KNEW I shouldn't have upgraded yesterday, I didn't even want the Apple Intelligence crap.

    Yes, I see lots of similar posts now.

    I was trying to get all my widgets packed as tight as I can and I was adjusting the padding/margins/geometries of all the widgets but I just can't figure out how to get rid of the space above/below the 2 toolbars in this custom TabWidget I created.

    For me the crash is random, sometimes within seconds, other times up to a few minutes.

    img.png

  • 0 Votes
    8 Posts
    171 Views
    C

    @Yihua-Liu Your application is trying to load a plugin from your deployment folder. This plugin is expecting a matching Qt version which, it seems you are saying is also in the deployment folder.

    When you ran ldd against the plugin the Qt libraries found for linking were the set in /opt/Qt.

    It is entirely possible that these are not the same Qt version. This would stop your plugin loading.

    To use the Qt libraries bundled with your application over any Qt library present elsewhere you should look at the wrapper script in Create Application Package.

  • QSqlDatabase: QMYSQL driver not loaded

    Unsolved
    20
    0 Votes
    20 Posts
    559 Views
    SGaistS

    If you go to the patch linked in the bug report, you'll see the exact path of the two files that have been modified in qtbase.

  • 0 Votes
    10 Posts
    315 Views
    H

    Thank you very much for your guys.

    Best regards.

  • Qt Vulkan examples crash in WSL2

    Unsolved
    4
    0 Votes
    4 Posts
    115 Views
    M

    WSL details (wsl --version)

    WSL version: 2.3.26.0
    Kernel version: 5.15.167.4-1
    WSLg version: 1.0.65
    MSRDC version: 1.2.5620
    Direct3D version: 1.611.1-81528511
    DXCore version: 10.0.26100.1-240331-1435.ge-release
    Windows version: 10.0.22631.4751

  • Preparing app for Microsoft Store (Qt 6 + CMake)

    Solved
    3
    0 Votes
    3 Posts
    319 Views
    P

    For anyone coming across this, I have successfully navigated the transition from Qt 5 + qmake (UWP app delivered via Microsoft Store) to Qt 6 + CMake (Win32 app delivered via Microsoft Store).

    Here is my general cookbook for transitioning from qmake to CMake: https://github.com/paulmasri/qt6_cmake_cookbook

    You need to note that Qt 6 no longer supports UWP, so you have to do things a little differently. Use the MSVC2019-64bit kit and see this important post.

    The whole build process can be done within Qt/CMake but requires some additional steps. These can be configured in CMake and the post-build install step can also be configured in CMake to run as a post-build step. The following assumes Qt 6.5 and will not work in earlier versions.

    # EDIT THIS! You'll need to set your own `APP_TARGET` (e.g. "MyAppTarget") # Create a directory `install` within the build directory. # Install everything there and use it to create the uploadable package. set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install") message(STATUS "CMAKE_INSTALL_PREFIX set (for the duration of this script) to ${CMAKE_INSTALL_PREFIX}") # Do the equivalent of windeployqt, with QML extras. qt_generate_deploy_qml_app_script( TARGET ${APP_TARGET} OUTPUT_SCRIPT deploy_script ) install(SCRIPT ${deploy_script}) # Ensure the VC redistributables are included. include(InstallRequiredSystemLibraries) # Install your AppxManifest. install( FILES "${CMAKE_CURRENT_BINARY_DIR}/AppxManifest.xml" DESTINATION "${CMAKE_INSTALL_PREFIX}" ) # Install Microsoft Store assets from source "assets" to store "Assets" install( DIRECTORY assets/ DESTINATION "${CMAKE_INSTALL_PREFIX}/Assets" FILES_MATCHING PATTERN "*" ) # Package, bundle and prepare for upload via Microsoft Partner Center. # The following assumes a single 64-bit package, within a bundle, with debug info. # Packages will be built in `packages` directory within build directory. # Final bundle and `.appxupload` will be built in the build directory root. # NOTES: # 1. If you have a single package and don't need to add it to a bundle, # skip the bundle step and pass just the package to the `create_appxupload_command`. # 2. Assumes you are building ReleaseWithDebugInformation, which will generate a .pdb # used in the following. If you don't need this, skip `compress_pdb_command` and # `rename_appxsym_command` and omit the appxsym file from `create_appxupload_command`. set(APPX_BUILD_VERSION_HYPHENATED "${PROJECT_VERSION_MAJOR}_${PROJECT_VERSION_MINOR}_${PROJECT_VERSION_PATCH}_0") set(APPX_PACKAGES_PREFIX "packages") set(APPX_PACKAGE_X64_FILE "${APP_TARGET}-${APPX_BUILD_VERSION_HYPHENATED}-x64.appx") set(APPX_BUNDLE_FILE "${APP_TARGET}-${APPX_BUILD_VERSION_HYPHENATED}.appxbundle") set(APPX_PDB_FILE "${APP_TARGET}.pdb") set(APPX_SYM_FILE "${APP_TARGET}-${APPX_BUILD_VERSION_HYPHENATED}.appxsym") set(APPX_UPLOAD_FILE "${APP_TARGET}-${APPX_BUILD_VERSION_HYPHENATED}.appxupload") message(STATUS "-- Generating install code and adding it to install") set(install_code) string(CONCAT install_code "${install_code}" "message(\"Removing previous packages and bundle (if present)\")\n" "file(REMOVE_RECURSE \"${CMAKE_BINARY_DIR}/${APPX_PACKAGES_PREFIX}\")\n" "file(REMOVE \"${CMAKE_BINARY_DIR}/${APPX_BUNDLE_FILE}\")\n" "file(REMOVE \"${CMAKE_BINARY_DIR}/${APPX_SYM_FILE}\")\n" "file(REMOVE \"${CMAKE_BINARY_DIR}/${APPX_UPLOAD_FILE}\")\n" ) # Package and bundle set(package_x64_command "MakeAppx.exe pack /d \"${CMAKE_INSTALL_PREFIX}\" /p \"${CMAKE_BINARY_DIR}/${APPX_PACKAGES_PREFIX}/${APPX_PACKAGE_X64_FILE}\"") set(package_x64_execute_process "execute_process(COMMAND ${package_x64_command})") set(bundle_command "MakeAppx.exe bundle /d \"${CMAKE_BINARY_DIR}/${APPX_PACKAGES_PREFIX}\" /p \"${CMAKE_BINARY_DIR}/${APPX_BUNDLE_FILE}\"") set(bundle_execute_process "execute_process(COMMAND ${bundle_command})") string(CONCAT install_code "${install_code}" "message(\"Packaging 64-bit app\")\n" "${package_x64_execute_process}\n" "message(\"Bundling all packages\")\n" "${bundle_execute_process}\n" ) # Convert .pdb to .appxsym. Add bundle and .appxsym to .appxupload. # You will drag'n'drop the .appxupload into the Microsoft Partner Center app package page. set(compress_pdb_command "powershell.exe -Command \"Compress-Archive -Path '${CMAKE_BINARY_DIR}/${APPX_PDB_FILE}' -DestinationPath '${CMAKE_BINARY_DIR}/${APPX_SYM_FILE}.zip' -Force\"") set(compress_pdb_execute_process "execute_process(COMMAND ${compress_pdb_command})") set(rename_appxsym_command "powershell.exe -Command \"Rename-Item -Path '${CMAKE_BINARY_DIR}/${APPX_SYM_FILE}.zip' -NewName '${APPX_SYM_FILE}'\"") set(rename_appxsym_execute_process "execute_process(COMMAND ${rename_appxsym_command})") set(create_appxupload_command "powershell.exe -Command \"Compress-Archive -Path '${CMAKE_BINARY_DIR}/${APPX_BUNDLE_FILE}', '${CMAKE_BINARY_DIR}/${APPX_SYM_FILE}' -DestinationPath '${CMAKE_BINARY_DIR}/${APPX_UPLOAD_FILE}.zip' -Force\"") set(create_appxupload_execute_process "execute_process(COMMAND ${create_appxupload_command})") set(rename_appxupload_command "powershell.exe -Command \"Rename-Item -Path '${CMAKE_BINARY_DIR}/${APPX_UPLOAD_FILE}.zip' -NewName '${APPX_UPLOAD_FILE}'\"") set(rename_appxupload_execute_process "execute_process(COMMAND ${rename_appxupload_command})") string(CONCAT install_code "${install_code}" "message(\"Converting .pdb to .appxsym\")\n" "${compress_pdb_execute_process}\n" "${rename_appxsym_execute_process}\n" "message(\"Creating .appxupload\")\n" "${create_appxupload_execute_process}\n" "${rename_appxupload_execute_process}\n" "message(\"Done.\")\n" ) # Install these scripts. install(CODE "${install_code}")
  • 0 Votes
    2 Posts
    88 Views
    C

    They are converted that way because they contain no background. After PDF v1.4 the resulting pixel on a page is the composition of all overlaying graphic objects, each of which may carry an alpha component. If there is no explicit opaque object (e.g. a white rectangle) overlaying the entire page, under all the other objects, then there is no background where there are no overlying objects. It could be that the "working" images are PDF v1.3 or have an explicit background layer.

    You could:

    adjust the PDFs at source, or paint the resulting image over a filled canvas image to obtain an image guaranteed to have a background
  • Qt and STM32 Sending and Receive Problem

    Unsolved
    2
    0 Votes
    2 Posts
    57 Views
    SGaistS

    Hi and welcome to devnet,

    Which version of Qt ?
    On which OS ?
    You should also connect the errorOccurred signal to ensure there's not something happening that you missed.