Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • QPieSlices

    Unsolved
    1
    0 Votes
    1 Posts
    148 Views
    No one has replied
  • Installing Qt 5 on Debian (bookworm)

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    SGaistS
    Hi, Do you have any specific issues ? System install works fine from what I know.
  • 0 Votes
    6 Posts
    1k Views
    V
    the problem was wrong changing name. after using lib.exe to convert libfftw3f-3.dll to libfftw3f-3.lib. after this I changed the libfftw3f-3.lib to fftw3f-3.lib to detected by QT. but it's wrong. the name must not changed and I used this in my .pro file. # MinGW #INCLUDEPATH += "c:\fftw\fftw-3.3.5-dll64" #LIBS += -L "C:\fftw\fftw-3.3.5-dll64" -lfftw3-3 # MSVC INCLUDEPATH += "c:\fftw\fftw-3.3.5-dll64" LIBS += -L"C:\fftw\fftw-3.3.5-dll64" -llibfftw3-3 and now my FFTW folder contains these files: [image: 8043453e-3caf-4be2-8c04-cb6b1685dd2f.png]
  • Sending signals between 2 cpp files back and forth without circular dependency?

    Unsolved
    5
    0 Votes
    5 Posts
    382 Views
    S
    @Pl45m4 Will try that, thank you very much for the quick response. :D
  • QGuiApplication::installTranslator fails

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    C
    @Christian-Ehrlicher I have found something weird later on in the build process. It seems to do the following: Generate the qm files from the ts files correctly Incorrectly updating the ts files (for what ever reason) Building the qm files again This is the shortened output of the build process: [Downloading the github repos...] -- The CXX compiler identification is GNU 12.2.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Performing Test HAVE_STDATOMIC -- Performing Test HAVE_STDATOMIC - Success -- Found WrapAtomic: TRUE -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- Found WrapOpenGL: TRUE -- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.5.0", minimum required is "0.5.0") -- Found WrapVulkanHeaders: /usr/include -- Configuring done (0.7s) -- Generating done (0.0s) -- Build files have been written to: /run/build/librum-testing [1/95] Generating librum_de.qm Updating '/run/build/librum-testing/src/presentation/librum_de.qm'... Generated 359 translation(s) (359 finished and 0 unfinished) [2/95] Generating librum_en.qm Updating '/run/build/librum-testing/src/presentation/librum_en.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) Ignored 359 untranslated source text(s) [3/95] Generating librum_ru.qm Updating '/run/build/librum-testing/src/presentation/librum_ru.qm'... Generated 359 translation(s) (359 finished and 0 unfinished) [4/95] Running qmlimportscanner for librum [5/95] cd /run/build/librum-testing/src/presentation && /usr/bin/cmake -DIN_FILE=/run/build/librum-testing/src/presentation/.lupdate/presentation_project.cmake -DOUT_FILE=/run/build/librum-testing/src/presentation/.lupdate/presentation_project.json -P /usr/lib/x86_64-linux-gnu/cmake/Qt6LinguistTools/GenerateLUpdateProject.cmake && /usr/bin/lupdate -project /run/build/librum-testing/src/presentation/.lupdate/presentation_project.json lupdate warning: Some files have been ignored due to missing qml/javascript support /usr/include/QtQml/qqmlprivate.h:343: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:842: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:856: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:874: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:888: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:902: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:917: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:931: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:945: Ignoring definition of undeclared qualified class Updating 'translations/librum_en.ts'... Found 0 source text(s) (0 new and 0 already existing) Kept 359 obsolete entries Updating 'translations/librum_de.ts'... Found 0 source text(s) (0 new and 0 already existing) Kept 359 obsolete entries Updating 'translations/librum_ru.ts'... Found 0 source text(s) (0 new and 0 already existing) Kept 359 obsolete entries [6/95] Automatic MOC and UIC for target domain [7/95] Building CXX object src/domain/CMakeFiles/domain.dir/value_objects/login_model.cpp.o [8/95] Building CXX object src/domain/CMakeFiles/domain.dir/value_objects/register_model.cpp.o [9/95] Building CXX object src/domain/CMakeFiles/domain.dir/entities/tag.cpp.o [10/95] Building CXX object src/domain/CMakeFiles/domain.dir/entities/bookmark.cpp.o [11/95] Building CXX object src/domain/CMakeFiles/domain.dir/domain_autogen/mocs_compilation.cpp.o [12/95] Building CXX object src/domain/CMakeFiles/domain.dir/entities/rectf.cpp.o [13/95] Building CXX object src/domain/CMakeFiles/domain.dir/entities/user.cpp.o [14/95] Building CXX object src/domain/CMakeFiles/domain.dir/entities/highlight.cpp.o [15/95] Building CXX object src/domain/CMakeFiles/domain.dir/entities/book.cpp.o [16/95] Linking CXX shared library libdomain.so [17/95] Building mupdf (This takes a while) ... [A lot of output from building a dependency...] [18/95] Automatic MOC and UIC for target application [Building librum...] [86/95] Building CXX object src/presentation/CMakeFiles/presentation.dir/presentation_autogen/mocs_compilation.cpp.o [87/95] Building CXX object src/presentation/CMakeFiles/presentation.dir/modules/CppElements/page_view.cpp.o [88/95] Building CXX object src/presentation/CMakeFiles/presentation.dir/presentation_autogen/YCDLW3T4OG/qrc_resources.cpp.o [89/95] Linking CXX shared library libpresentation.so [90/95] Automatic MOC and UIC for target librum [91/95] Automatic RCC for ../fonts.qrc [92/95] Building CXX object src/CMakeFiles/librum.dir/librum_autogen/mocs_compilation.cpp.o [93/95] Building CXX object src/CMakeFiles/librum.dir/librum_autogen/YCDLW3T4OG/qrc_fonts.cpp.o [94/95] Building CXX object src/CMakeFiles/librum.dir/main.cpp.o [95/95] Linking CXX executable librum [1/13] Generating librum_en.qm Updating '/run/build/librum-testing/src/presentation/librum_en.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) [2/13] Generating librum_ru.qm Updating '/run/build/librum-testing/src/presentation/librum_ru.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) [3/13] Generating librum_de.qm Updating '/run/build/librum-testing/src/presentation/librum_de.qm'... Generated 0 translation(s) (0 finished and 0 unfinished) [4/13] cd /run/build/librum-testing/src/presentation && /usr/bin/cmake -DIN_FILE=/run/build/librum-testing/src/presentation/.lupdate/presentation_project.cmake -DOUT_FILE=/run/build/librum-testing/src/presentation/.lupdate/presentation_project.json -P /usr/lib/x86_64-linux-gnu/cmake/Qt6LinguistTools/GenerateLUpdateProject.cmake && /usr/bin/lupdate -project /run/build/librum-testing/src/presentation/.lupdate/presentation_project.json lupdate warning: Some files have been ignored due to missing qml/javascript support /usr/include/QtQml/qqmlprivate.h:343: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:842: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:856: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:874: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:888: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:902: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:917: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:931: Ignoring definition of undeclared qualified class /usr/include/QtQml/qqmlprivate.h:945: Ignoring definition of undeclared qualified class Updating 'translations/librum_en.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'translations/librum_de.ts'... Found 0 source text(s) (0 new and 0 already existing) Updating 'translations/librum_ru.ts'... Found 0 source text(s) (0 new and 0 already existing) [5/13] Building mupdf (This takes a while) ... [Building the dependency that we have built before again...] [6/10] Running rcc for resource presentation_translations [7/10] Building CXX object src/presentation/CMakeFiles/presentation.dir/.rcc/qrc_presentation_translations.cpp.o [8/10] Linking CXX shared library libpresentation.so [9/10] Linking CXX executable librum [9/10] Install the project... -- Install configuration: "Release" -- Installing: /app/lib/libdomain.so -- Installing: /app/lib/libapplication.so -- Set runtime path of "/app/lib/libapplication.so" to "" -- Installing: /app/lib/libmupdfcpp.so -- Installing: /app/lib/libmupdf.so -- Installing: /app/lib/libmupdfcpp.so.24.0 -- Installing: /app/lib/libmupdf.so.24.0 -- Installing: /app/lib/libinfrastructure.so -- Set runtime path of "/app/lib/libinfrastructure.so" to "" -- Installing: /app/lib/libadapters.so -- Set runtime path of "/app/lib/libadapters.so" to "" -- Installing: /app/lib/libpresentation.so -- Set runtime path of "/app/lib/libpresentation.so" to "" -- Installing: /app/bin/librum -- Set runtime path of "/app/bin/librum" to "" -- Installing: /app/share/pixmaps/librum.svg -- Installing: /app/share/applications/librum.desktop [Some cleanup...] I have no idea why it starts at [1/13] again, but I suppose that this causes the problem since it overwrites the seemingly correct qm files.
  • QHashIterator with QMultiHash

    Solved
    2
    0 Votes
    2 Posts
    344 Views
    Christian EhrlicherC
    Looks like a documentation error which was not adjusted from Qt5 to Qt6 as QMultiHash no longer derives from QHash. You have to use QMultiHashIterator now or use c++ style iterators / range-based for loop. I wonder why these iterators were not removed in Qt6 though... /edit: https://bugreports.qt.io/browse/QTBUG-119461
  • 0 Votes
    3 Posts
    683 Views
    S
    @Pl45m4 Worked like a charm, thank you very much. :)
  • Is it possible to use a camera application in qt6 on the raspberry pi?

    Unsolved
    3
    0 Votes
    3 Posts
    494 Views
    V
    @SGaist it didnt get any better nor for 6.6 nor 6.7 moreover, both backends ffmpeg and gstreamer doesnt works with csi cameras in RPi4 64
  • Resizable QWidget at the border

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    N
    @Pl45m4 Because when your widget is part of some other layout, the layout and other widgets will limit the movement and expansion Actually this is exactly what I want. I don't want something like QMainWindow that isn't bounded, I want it to be bounded inside its parent (QMainWindow) in my case. Sounding like there might be no QT magic to get such a thing working? I.e. it must be done manually by handling various events.
  • HOW TO...add vaiable to (C++) class definition

    Moved Unsolved
    2
    0 Votes
    2 Posts
    308 Views
    Pl45m4P
    @AnneRanch said in HOW TO...add vaiable to (C++) class definition: How do I "add index " to it and replace single , ui(new Ui::Dialog)? As is so often the case, it is difficult to find out what's the idea behind all this and how we could help. And also as almost always, your topic title is somewhat off your actual problem, which makes it even more difficult to provide an appropriate answer. I'm trying: So you want multiple instances (= "copies") of your Dialog UI in a single class?! The way you thought of is terrible design and probably very hard to maintain. If you plan to use the same UI multiple times: Either create multiple instances of your dialog's content as widgets in a loop and put them in some container like QList or QVector. Then you can access them by index OR Just spawn multiples of your QDialog directly and also put them in some container before. If you are thinking of Dialog having different versions of "UI" and you want to switch between them (by your "index"), better use UiLoader or use a QStackedWidget as main widget for your Dialog and add your "UIs" as page widgets to it. QStackedWidget also provides indices to select a matching page at runtime. (See this topic here) I need a real code What is unreal code anyway?! :) example to ADD / pass an "index" as variable to C++ class. This and your topic title would lead to something like this: Dialog::Dialog(int index, QWidget *parent) : QDialog(parent) , index_(index) , ui(new Ui::Dialog) but I dont think that's all your issue is about...
  • Unexpected behavior with TapHandler in MapPolyline

    Unsolved
    2
    0 Votes
    2 Posts
    223 Views
    D
    @drmhkelley Let me try this again. On the off chance that something confusing in my initial description led to the lack of any response, I will make this a bit more explicit. Following my description of this example, I provide the only potentially meaningful hit I have thought of, in the hopes that it means enough to someone that they might point me in the next useful direction toward solution. Following is a stub of my code, which began as the standard mapviewer example from QtLocation. MapView uses the OSM plugin to display map tiles. It also contains various additional items that can be displayed on this map. Of current interest are routes and tracks as would be displayed by any GPS device. The mapviewer example does that using a MapPolyline. The code below shows the TapHandlers for both the MapView and for the MapPolyline. That for the MapView logs the coordinates of map clicks to the main output widget and then adds a waypoint at the clicked point. That for the MapPolyline logs what it thinks is the clicked coordinate and then adds a waypoint at that coordinate. MapView { id: standIn // bunch more stuff TapHandler { id: mMcTapHandler property variant lastCoordinate onTapped: { lastCoordinate = standIn.map.toCoordinate(mMcTapHandler.point.position) var msg = "MapComponent:mMcTapHandler - onTapped: - " + Helper.formatCoordinate(lastCoordinate) mainOut.log(msg) mMC.addMarkerFromMap(lastCoordinate) } MapPolyline { id: myMapPolylineItem // some more stuff TapHandler { id: polyTapHandler property variant lastCoordinate onTapped: { lastCoordinate = standIn.map.toCoordinate(polyTapHandler.point.position) var msg = "MyPolylineItem:polyTapHandler - onTapped: - " + Helper.formatCoordinate(lastCoordinate) mainOut.log(msg) mMC.addMarkerFromPolyline(lastCoordinate) } } } Below is a screen shot that demonstrates my problem. I have defined a "route" by three waypoints - the red markers numbered 1 to 3, which are connect6ed by the MapPolyline. Also marked are 6 additional waypoints I got by clicking pairs points on near the polyline (one pair on the upright leg and one pair on the horizontal leg) and by clicking on the polyline between each pair of points. These are the blue waypoints numbered 1 to 6. [image: ff0a3546-a6fc-46d4-b126-a6720ee7e5f0.JPG] The following is from the main log output and shows what the MapPolyline has for its three coordinates, along with the coordinates found by clicking both the MapView and the MapPolyline. Polyline coordinates (1) - 38.1800000, -107.6832810 (2) - 38.1950500, -107.6832810 (3) - 38.1950500, -107.6657370 1: MapComponent:mMcTapHandler - onTapped: (38.1873230, -107.6851949) 2: MapComponent:mMcTapHandler - onTapped: (38.1872555, -107.6818475) 3: MyPolylineItem:polyTapHandler - onTapped: (38.1946393, -107.6994685) 4: MapComponent:mMcTapHandler - onTapped: (38.1929222, -107.6743803) 5: MapComponent:mMcTapHandler - onTapped: (38.1966997, -107.6744661) 6: MyPolylineItem:polyTapHandler - onTapped: (38.2023963, -107.6903704) I hope this clearly illustrates what is going on. My only meaningful clue is that the offset between the "actual" coordinates and the "reported" coordinates is map-scale and map-location dependent. The reported coordinates are offset by approximately (but perhaps not exactly) by the offset of the MapPolyline's waypoint #2 from the northwest (upper left) corner of the map. The MapPolyline is a Component that has been added to an Item that has been added to the MapView. Is there perhaps some coordinate translation, which could take place in the TapHandler, that shifts coordinates between the main MapView and Items or Components that are displayed on it. I am not aware that this is the case and wouldn't know how to deal with it if that is what is happening. Many thanks for your time reading this lengthy post.
  • Application randomly crashes on segmentation fault.

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    D
    I have had the same error with the same library "libQt5Qml.so.5". I have tried various alternatives, and in my case, that error occurred when I executed a function in QML, which was supposed to create a custom component previously created in another directory, inside main.qml. In the end, the only thing that solved the problem was migrating to QT6. In my case, I was using Python, so switching from PySide2 to PySide6 solved the problem. Try using QT6 instead of QT5. Good luck
  • Serial communication

    Solved
    39
    0 Votes
    39 Posts
    5k Views
    D
    Serial communication on state machine works great!
  • how to change "tab" title ?

    Moved Unsolved
    3
    0 Votes
    3 Posts
    567 Views
    Pl45m4P
    @AnneRanch said in how to change "tab" title ?: TEST_Dialog_1->ui->tab_4->setToolTip(text); You should not access the ui from other widgets directly.
  • How to stack QT Charts legend items vertical on bottom

    Unsolved
    5
    0 Votes
    5 Posts
    526 Views
    S
    @JonB none . Actually, They aren't useful for me. I use : legend()->hide(); and use label. thank you .
  • Complex table design

    Solved qtableview widget
    2
    0 Votes
    2 Posts
    599 Views
    SGaistS
    Hi, You could check KDE's Kontact application. If I remember correctly they have a journal part that might be of interest.
  • Dock widget not visible

    Unsolved
    2
    0 Votes
    2 Posts
    200 Views
    PerdrixP
    @Perdrix I got round that ugly hack by making the dock widget in question visible as the application was closing (in the closeEvent handler). Still don't understand why that "One Shot" was needed though.
  • QtAxContainer.QAxWidget can't from RDP control my windows computer

    Unsolved
    6
    0 Votes
    6 Posts
    665 Views
    T
    @jsulm said in QtAxContainer.QAxWidget can't from RDP control my windows computer: @Tian-Sen You should add error handling. There are https://doc.qt.io/qt-6/qaxbasewidget.html#exception and https://doc.qt.io/qt-6/qaxbasewidget.html#signal signals. Connect slots to them and see what happens. I guess Connect() hangs and since you're calling it in constructor the UI is not initialised properly. from PySide6.QtWidgets import QApplication, QMainWindow from PySide6.QtAxContainer import QAxWidget import sys class RemoteDesktopWindow(QMainWindow): def init(self, server_ip, username, password): super().init() self.axWidget = QAxWidget("MsRdpClient") self.axWidget.setControl("{54a2cb42-4f7d-4a07-8c5c-bc0e9e4f3a3a}") self.axWidget.dynamicCall("SetServer", server_ip) self.axWidget.dynamicCall("SetUserName", username) self.axWidget.dynamicCall("SetClearTextPassword", password) self.axWidget.dynamicCall("Connect()") print("连接远程桌面") # 将信号连接到槽以进行错误处理 self.axWidget.exception.connect(self.handle_exception) self.axWidget.signal.connect(self.handle_signal) def handle_exception(self, excep_info): # 在这里处理异常 print("发生异常:", excep_info) def handle_signal(self, signal, argc, argv): # 在这里处理信号 print("收到信号:", signal, argc, argv) if name == "main": app = QApplication(sys.argv) window = RemoteDesktopWindow("1", "DESKTOP-0QR3E2C\testserver", "1234.abcde") window.show() sys.exit(app.exec()) i have to set it ,but it don't work ,it just print 连接远程桌面 ,the method handle_exception and handle_signal is not work.
  • Get USB bus reported device description in qt

    Solved
    3
    0 Votes
    3 Posts
    924 Views
    V
    thanks a lot. I finally found how to use this library. this is my code: #include <string> #include <windows.h> #include <setupapi.h> #include <initguid.h> #include <devguid.h> #include <hidsdi.h> uint8_t valid_ports_counter =0; // Check Device Bus Reported Device Description HDEVINFO hDevInfo; SP_DEVINFO_DATA DeviceInfoData = { sizeof(DeviceInfoData) }; // Get device class information handle hDevInfo = SetupDiGetClassDevs(&GUID_DEVCLASS_PORTS, 0, 0, DIGCF_PRESENT); if (hDevInfo != INVALID_HANDLE_VALUE) { const int BUFFER_SIZE = 1024; BYTE ptrBuf[BUFFER_SIZE]; static DEVPROPKEY *DEVPKEY_Device_BusReportedDeviceDesc; DEVPKEY_Device_BusReportedDeviceDesc = new DEVPROPKEY(); DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data1 = 0x540b947e; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data2 = 0x8b40; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data3 = 0x45bc; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data4[0] = 0xa8; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data4[1] = 0xa2; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data4[2] = 0x6a; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data4[3] = 0x0b; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data4[4] = 0x89; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data4[5] = 0x4c; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data4[6] = 0xbd; DEVPKEY_Device_BusReportedDeviceDesc->fmtid.Data4[7] = 0xa2; DEVPKEY_Device_BusReportedDeviceDesc->pid = 4; DEVPROPTYPE propRegDataType; // enumerute device information for (int i = 0; SetupDiEnumDeviceInfo(hDevInfo, i, &DeviceInfoData); i++) { DWORD req_bufsize = 0; if (SetupDiGetDevicePropertyW(hDevInfo, &DeviceInfoData, DEVPKEY_Device_BusReportedDeviceDesc, &propRegDataType, ptrBuf, BUFFER_SIZE, &req_bufsize, 0)) { // BYTE to char QString port_name; for(uint16_t i = 0; i < (req_bufsize-2); i += 2) port_name.push_back(static_cast<QChar>(ptrBuf[i])); if(port_name == "###") { DWORD DataT; char friendly_name[2046] = { 0 }; DWORD buffersize = 2046; // get device description information if (SetupDiGetDeviceRegistryPropertyA(hDevInfo, &DeviceInfoData, SPDRP_FRIENDLYNAME, &DataT, (PBYTE)friendly_name, buffersize, &req_bufsize)) { QString com_port = friendly_name; com_port = com_port.sliced(com_port.indexOf('(') + 1, com_port.indexOf(')') - com_port.indexOf('(') - 1); valid_ports_counter++; COMInfo comi; comi.type = COM_MCB; comi.name = com_port; ports_type.push_back(comi); ui->comboBox_ports->addItem(com_port); QPixmap pusb(":/files/USB.png"); QIcon iusb(pusb); ui->comboBox_ports->setItemIcon(ui->comboBox_ports->count() - 1, iusb); } } } } }
  • Using system ODBC library with Qt

    Solved
    6
    0 Votes
    6 Posts
    662 Views
    G
    @Christian-Ehrlicher That was exactly the problem. Thank you so much!