Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • Getting a QIcon from a QCursor

    Solved
    3
    0 Votes
    3 Posts
    69 Views
    SGaistS
    Hi, From the documentation: This is only valid if the cursor is a pixmap cursor. which is not the case here.
  • Public export of defines from QT6:Platform polutes my build

    Unsolved
    4
    0 Votes
    4 Posts
    418 Views
    A
    Did you ever have any luck getting this to work? Running into the same issue and bashing my keyboard into the wall hasn't made me any headway, surprisingly.
  • 1 Votes
    3 Posts
    69 Views
    I
    @ShwStone Welcome to the forum. This topic doesn't really fit here as it not really a Qt usage question - Qt is more of an incidental implementation detail of a KDE user tool. I don't believe there are many KDE developers lurking here, and even so it is not the natural place for discussion of that nature. Issues should be reported to KDE's bugzilla, but I understand that it is hard to get tickets noticed there. Perhaps KDE's user forum (https://discuss.kde.org/) have a better for that, or the kde-devel mailing list.
  • QWidget 3D Model

    Unsolved 3d model 3dmodule model-view modelview qwidget
    5
    0 Votes
    5 Posts
    84 Views
    J
    @Pl45m4 said in QWidget 3D Model: I think using QtQuick 3D might be the easiest and best way for your case. I'm sure you will find more examples out there. thank you so much, I am here for you :D, I will wait... @Pl45m4 said in QWidget 3D Model: Do you already have the model + textures etc.? I do not have not yet but I can find free like you said @Pl45m4 said in QWidget 3D Model: Hahaha that stick figure out of nowhere made me laugh :D <3
  • qputenv() with Cyrllic string on WIndows results in 0xc0000409 abort.

    Solved
    2
    0 Votes
    2 Posts
    66 Views
    PerdrixP
    Here's how I fixed the problem: #if defined(Q_OS_WIN) // Set the C character locale to UTF-8 (used to be in DeepSkyStacker.cpp and friends) std::setlocale(LC_CTYPE, ".UTF-8"); // Set console code page to UTF-8 so console knows how to interpret string data SetConsoleOutputCP(CP_UTF8); #endif // // Set the trace file location // QByteArray nameArray{ reinterpret_cast<const char*>(file.generic_u8string().c_str()) }; qputenv("Z_TRACEFILE", nameArray);
  • Qt 6.8.3 (MinGW) and QOCI driver

    Solved
    6
    0 Votes
    6 Posts
    183 Views
    A
    @jsulm I set the env and got this: qt.core.library: "C:/Qt/6.8.3/mingw_64/plugins/sqldrivers/qsqloci.dll" cannot load: Cannot load library C:\Qt\6.8.3\mingw_64\plugins\sqldrivers\qsqloci.dll: %1 nie jest prawidlowa aplikacja systemu Win32. qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "C:/Qt/6.8.3/mingw_64/plugins/sqldrivers/qsqloci.dll" : "Cannot load library C:\\Qt\\6.8.3\\mingw_64\\plugins\\sqldrivers\\qsqloci.dll: %1 nie jest prawidlowa aplikacja systemu Win32." qt.sql.qsqldatabase: QSqlDatabase: QOCI driver not loaded Probably because OCI driver is compiled using MinGW instead MSVC, but there should be method to compile OCI driver for programs using MinGW compilator Edit: After adding C:\oracle\oracle12 do PATH env, connection work
  • Qt6. Embedding native widgets in QTabWidget/QStackedWidget breaks their geometry

    Unsolved
    4
    0 Votes
    4 Posts
    152 Views
    N
    Tested with Qt 6.10.0-0-202510021201, the same problem
  • QMAKE: Visibility of variables defined in .pro file with SUBDIRS

    Solved
    8
    1 Votes
    8 Posts
    261 Views
    R
    I have found a solution which involves two top-level SUBDIRS projects, one "app" project (i.e. with "TEMPLATE = app"), and three "TEMPLATE = lib" subprojects. It's actually quite possible to put the app project file in the same folder as the top-level SUBDIRS project if you use the .file syntax on the target dependencies. Here is the directory structure, similar to my other post above, but a little different: TOP_Project_Dir |__3rd_party |__A |__src |__A_lib.hpp |__A_lib.cpp A_lib.pro |__B <== (similar to A) |__C <== (similar to A) Libs.pro .qmake.conf |__app |__lib |__src App.pro Project.pro .qmake.conf |__build |__Project |__Qt-<version> |__Debug |__Release Here is the top-level Project.pro file: TEMPLATE = subdirs SUBDIRS = Libs App lessThan(QT_MAJOR_VERSION,6):CONFIG+=ordered APP_DIR = $$top_srcdir THIRD_DIR = $$clean_path($${APP_DIR}/../3rd_party) Libs.file = $${THIRD_DIR}/Libs.pro App.file = $${APP_DIR}/App.pro App.depends = Libs The Libs.pro file: TEMPLATE = subdirs SUBDIRS = \ A/A_lib.pro \ B/B_lib.pro \ C/C_lib.pro Here it was more convenient to just refer directly to the file paths in the SUBDIRS section. The A_lib.pro file (and almost exactly the same for B and C libraries): CONFIG -= qt TEMPLATE = lib CONFIG += static c++17 release SOURCES += \ src/A_lib.cpp HEADERS += \ src/A_lib.hpp TARGET = A PROJECT_DIR = $$clean_path($${top_srcdir}/../) APP_DIR = $${PROJECT_DIR}/app DESTDIR = $${APP_DIR}/lib Finally, the App.pro file: CONFIG -= qt TEMPLATE = app TARGET = MyApp CONFIG += c++17 console APP_DIR = $${top_srcdir} LIB_DIR = $${APP_DIR}/lib SRC_DIR = $${APP_DIR}/src THIRD_DIR = $$clean_path("$$top_srcdir/../3rd_party") OBJECTS_DIR = $${top_builddir}/.obj MOC_DIR = $${top_builddir}/.moc RCC_DIR = $${top_builddir}/.qrc UI_DIR = $${top_builddir}/.ui DESTDIR = $${top_builddir}/exec SOURCES += $${SRC_DIR}/theApp.cpp LIBS += -L"$${LIB_DIR}" -lA -lB -lC INCLUDEPATH += \ $${THIRD_DIR}/A/src \ $${THIRD_DIR}/B/src \ $${THIRD_DIR}/C/src Here is the source of A_lib.hpp and A_lib.cpp which is about the same for B and C: // A_lib.hpp #ifndef A_HPP #define A_HPP namespace A { void whoAmI(); } #endif // A_lib.cpp #include "A_lib.hpp" #include <iostream> namespace A { void whoAmI() { using namespace std; cout << "I'm in A lib" << endl; } } Finally, theApp.cpp file: #include "A_lib.hpp" #include "B_lib.hpp" #include "C_lib.hpp" int main() { A::whoAmI(); B::whoAmI(); C::whoAmI(); } In the Qt Creator "Default Build Properties" under "Build & Run", I have this template set for the default build directory: ../build/%{Project:Name}/Qt-%{Qt:Version}/%{BuildConfig:Name} This gives me for my little project this build directory in Debug mode: $HOME/code/TOP_Project_Dir/build/Project/Qt-5.15.13/Debug This is nice because "TOP_Project_Dir/3rd_party" and "TOP_Project_Dir/app" are under source-code management ("SCM", I am using Fossil for the real project) but in two different repositories, and everything under "build" gets ignored. The information @KH-219Design and @SGaist gave me was important to making this work. The sticking point, though, was that both of the top-level .pro files with TEMPLATE=subdirs needed to be parallel to each other, i.e. at the same level relative to the TOP_Project_Dir folder. These also need to be under SCM, so if one was on a different level, the build output of one would have gotten in the way of the other. Marking this now as SOLVED!
  • Please help,Drag and drop to a QgraphicsView

    Solved
    5
    0 Votes
    5 Posts
    143 Views
    E
    @SGaist thank you so much ,now it works, all that was missing was the QDragMoveEvent.
  • 0 Votes
    3 Posts
    96 Views
    F
    @SGaist said in QMenu appears under fullscreen MainWindow on Windows (works on Ubuntu): Hi and welcome to devnet, Which version of Qt 5 exactly ? Do you have the same issue if you use Qt 6 ? Hi I’m currently using Qt 5.15.2 on Windows 10. I need to continue my project with Qt 5, and at the moment I don’t have the possibility to switch versions to check whether it works correctly with Qt 6.
  • AccessibleName for QPushButton stopped working in the 6.9.2 with the QTabWidget

    Solved
    32
    0 Votes
    32 Posts
    1k Views
    O
    And I fixed it under 6.9.2. The cause is in "app.setStyleSheet(styleSheet); " position in the main.cpp file :). I'm surprised why it worked so long in previous Qt versions :). It was (style issue): app.setStyleSheet(styleSheet); MainWindow win; win.show(); The problem is predictable :( It needs to be: MainWindow win; app.setStyleSheet(styleSheet); win.show(); It's more logical. Firstly create GUI, then apply style :) I think, the problem has resolved.
  • Incorrect position of fenestration under Wayland.

    Unsolved
    5
    0 Votes
    5 Posts
    431 Views
    F
    Oh, the second solution does not work. The shell integration could not be loaded, so the qpa plugin wayland could not be loaded, so it uses xcb as a fallback. It worked, so i didn't read the debug carefully, sorry.
  • Detect current CMake configuration type. How?

    Solved
    22
    0 Votes
    22 Posts
    981 Views
    B
    Just look on situation when you developing application that is for Android, Unix, iOS, MacOS from one source. And you application has DIFFERENT sets of files for Debug and Release. ONLY ONE way to use this different sets with XCode - to have debug/release settings in CMake, BEFORE XCode. Using expressions in CMake for definitions sets for XCode is impossible. All things that you've got written is about blocking normal developing for iOS. You require me to develop in separate way for iOS. CMAKE_BUILD_TYPE IS USED FOR CREATING DIFFERENT VERSIONS OF PROJECT AUTOMATICALLY BEFORE XCODE. Think of real world application but not of what XCode using or not. This settings for defining project structure not for XCode. The sets of file require NOT ONLY the CPP sources. It require icons, settings, even different Info.plist files and many other things. How you going to setup this things with #ifndef NDEBUG??? If you going to advise me to use something like this: $<$CONFIG:Debug:${CMAKE_CURRENT_SOURCE_DIR}/dbgsrc.cpp> Try to do it by yourself you will have error from XCode that it's not supported sources that have vary in configurations from expressions. In this case only one way is using CMAKE_BUILD_TYPE to set different type of projects within different sets of files at time of scanning and this scanned project passing to XCode.
  • Genericity, extensibility and reuse: QWidgets Vs QML

    Solved qml c++ qml qwidget performance template
    8
    1 Votes
    8 Posts
    2k Views
    G
    I have picked up QML about three weeks ago and I am liking it very much; I have been implementing some small program with PySide6 and QML and it is a pleasure to program in it, but I do find that I can't find examples; currently, I can't get a TableView to work with the ability to edit values....where can I get some assistance?
  • Issue in qvulkanwindow.cpp ?

    Unsolved
    7
    1 Votes
    7 Posts
    649 Views
    J
    Happens to me for version 6.9.2. Swapchain image count is 3. validation errors are sporadically appearing, would suggest that sometimes timing is just right to divide 3 swapchain images to synchronization with 2 semaphores isnt it also exactly this? https://docs.vulkan.org/guide/latest/swapchain_semaphore_reuse.html
  • Whither (many) examples?

    Unsolved
    4
    1 Votes
    4 Posts
    125 Views
    SGaistS
    @FeRDNYC hi, This being a user forum you might not reaching the right people. I would recommend opening a ticket on the bug report system to spark the discussion around the issue of moving the examples.
  • Question about SUBDIRS template in qmake

    Unsolved
    2
    0 Votes
    2 Posts
    56 Views
    SGaistS
    Hi, Subdirs project are full-blown so your original idea won't work. The static libraries is the correct option.
  • Q_INCLUDE_MOC vs Q_DECLARE_OPAQUE_POINTER

    Unsolved
    4
    0 Votes
    4 Posts
    575 Views
    F
    I got into similar situation today, but I had to use Q_MOC_INCLUDE because the class is a Q_OBJECT in my case. The Qt docs suggest that Q_DECLARE_OPAQUE_POINTER is incompatible in this case. Hope this helps!
  • Drag and drop to a QgraphicsView

    Unsolved
    2
    0 Votes
    2 Posts
    56 Views
    JonBJ
    @electric-dev And what happens? Are you going to tell us whether either your dragEnterEvent() or dropEvent() are ever called? Please use the forum's Code tags (``` above & below, or the </> toolbutton) when pasting code especially for Python where indentation matters.
  • vkAcquireNextImageKHR say that Semaphore must not have any pending operations

    Solved
    1
    0 Votes
    1 Posts
    73 Views
    No one has replied