Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
82.6k Topics 452.0k Posts
  • Reporting inappropriate content on the forums

    Pinned Locked
    29
    3 Votes
    29 Posts
    28k Views
    A

    Thank you for the report. I have banned the user, which got rid of the spam posting. Not a loss, as this user did not post any other content on the site. Just deleting this one posting was not possible.

    Thanks for reporting this.

  • Qt Vulkan examples crash in WSL2

    Unsolved
    4
    0 Votes
    4 Posts
    54 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

  • Moc file

    Unsolved
    12
    0 Votes
    12 Posts
    459 Views
    J

    any update?

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

    Solved
    3
    0 Votes
    3 Posts
    281 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
    11 Posts
    173 Views
    B

    Hi @SGaist , just an update that I can build all sub-modules with 'parallelism 1'.

    I'll up the concurrent processes next but I assume that this is machine dependent...

    Are my further testing results required or should this be marked as solved as anyone now reading this thread can attempt the same steps and experiment with how many concurrent processes suit their machine?

  • QSqlDatabase: QMYSQL driver not loaded

    Unsolved
    18
    0 Votes
    18 Posts
    376 Views
    jsulmJ

    @ThiagoSys What about this suggestion from @SGaist : "one possible solution is to just copy the two files from 6.8.2 into your current sources"?

    And applying patches isn't isn't complicated.

  • 0 Votes
    5 Posts
    71 Views
    hskoglundH

    Also watch out for multiple installations of Qt on the target PC, I think I spot at least 2:
    one at ~/software/suis/new/DistributionKit
    one at /opt/Qt

    Try to remove one of them.
    Edit: if the Qt version in /opt/Qt is the default Ubuntu 22.04 Qt version 6.2.4 that could explain the error, since the version in ../DistributionKit is Qt 6.8.0.

  • 0 Votes
    2 Posts
    63 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
    43 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.

  • 0 Votes
    67 Posts
    1k Views
    V

    Thank you!

  • 0 Votes
    1 Posts
    22 Views
    No one has replied
  • 0 Votes
    3 Posts
    85 Views
    L

    @Pl45m4 older versions do support GCC 4, for example
    https://wiki.qt.io/Qt_5.10_Tools_and_Versions
    and
    https://wiki.qt.io/Qt_5.7_Tools_and_Versions

    I have 2 problems with the documentation.

    It does not mention the buildroot toolchain It is not clear which is the last version that is ok to use GCC 4 (4.8)
  • 0 Votes
    3 Posts
    77 Views
    Christian EhrlicherC

    ... or check inside the delegate functions if the row is still the one e.g. by checking the data to display.

  • Qt WebEngine still unsupported on Windows for ARM on 6.8+

    Unsolved
    7
    0 Votes
    7 Posts
    385 Views
    B

    @fundamentalcupcake thanks for that. did you manage to get a crosscompile going by applying that patch? this is on my list of things.

  • Dock window scroll bar activate without clicking

    Unsolved
    6
    0 Votes
    6 Posts
    112 Views
    K

    @SarahBeth , What you did then? It was kept as limitation only or has some work around?

  • Undefined Reference Linker Error

    Solved
    6
    0 Votes
    6 Posts
    114 Views
    C

    Any descriptive name that is not explicitly reserved should be fair. So defaultColors or _defaultColors would be OK; _DefaultColors or __defaultColors would not.

    File-scoped variables can be declared static and become invisible outside the translation unit. Standard advice is to question the need for such variables and use an anonymous namespace instead of static:

    namespace { QList<QColor> defaultColors { Qt::blue, Qt::red, Qt::yellow, Qt::green, Qt::magenta, Qt::black, Qt::darkGray }; }; // rest of file can see defaultColors

    If your file-local color list is being populated in the constructor of a class then that strongly suggests it should be part of the class or initialised outside the class (as above).

    __rtrnClr in GetSeriesColor seems to have no need to exist.
    Are you sure the function needs a non-const reference return value and not just a QColor?

  • Cannot close application

    Unsolved
    4
    0 Votes
    4 Posts
    118 Views
    GaoboG

    the qt's document say that:

    If the event loop is not running, this function does nothing.

  • 0 Votes
    7 Posts
    2k Views
    A

    I'm having this same issue. I get the same $$magic$$ error as well. I tried passing a .stl hint to assimp importer, but that didn't work either.
    I have a lot of stl files included using qresources, so it would be a pain to migrate away, but it is feasible. I was using Qt3D before, but am trying to get away from it since it's being deprecated. Hoping someone here has some hints.

    const auto qrc = QResource{filePath.string().c_str()}; auto qfile = QFile{qrc.fileName()}; qfile.open(QIODeviceBase::OpenModeFlag::ReadOnly); auto data = std::vector<char>{}; data.resize(qfile.size()); qfile.read(data.data(), data.size()); const auto ret = importer.ReadFileFromMemory( reinterpret_cast<const void*>(data.data()), static_cast<std::size_t>(data.size()), aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_FlipUVs); qWarning() << importer.GetErrorString(); return ret;
  • Using poppler-qt6 for qt project on macOS

    Unsolved
    7
    0 Votes
    7 Posts
    192 Views
    SGaistS

    Then it's a good first step so you will get these extra find modules for cmake which contains one for poppler.

    Otherwise, use CMake's find_library and find_path functions.

  • 0 Votes
    9 Posts
    174 Views
    JoeCFDJ

    @Leyu the Linux framebuffer platform doesn't natively support window decorations such as title bars. I guess it is not hard to create your own titlebar.