Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Fusion style QTableView leaving shadow highlight only on single cell

    Solved
    14
    0 Votes
    14 Posts
    834 Views
    Christian EhrlicherC
    @cancech You might reset the current index flag during painting by overriding https://doc.qt.io/qt-6/qabstractitemview.html#initViewItemOption
  • same filename cause multiple definition

    Unsolved
    6
    0 Votes
    6 Posts
    339 Views
    Christian EhrlicherC
    @Neether said in same filename cause multiple definition: This feature is unbelievable in 2024 This has nothing to do with a 'feature' or similar. It's just a problem of duplicate symbols in your code - this is simply not allowed (even not in other programming languages).
  • Colour and appearance of QComboBox

    Solved
    5
    0 Votes
    5 Posts
    278 Views
    MortyMarsM
    @Pl45m4 said in Colour and appearance of QComboBox: cboMatrix.at(14).at(i)->setStyleSheet("") Thank you @Pl45m4 'cboMatrix.at(14).at(i)->setStyleSheet("");' causes the application to crash, but 'cboMatrix.at(14).at(i)->setStyleSheet("space ");' works as I expect. Your suggestion solves my problem perfectly :-)
  • Reference a slot to variable in structure

    Unsolved
    5
    0 Votes
    5 Posts
    301 Views
    Pl45m4P
    @TheCrowKaka Don't know if I understand correctly, but you have a C Library and the examples how to use it only use Python code, whereas you want to use it in your Qt C++ app? m_DEV_IO.init = VOIDFUNCTYPE(m_UART_dev_io.UART_init) m_DEV_IO.open = UINTFUNCTYPE(m_UART_dev_io.UART_open) m_DEV_IO.close = VOIDFUNCTYPE(m_UART_dev_io.UART_close) m_DEV_IO.read = RWFUNCTYPE(m_UART_dev_io.UART_read) m_DEV_IO.write = RWFUNCTYPE(m_UART_dev_io.UART_write) m_UART_dev_io.COM_PORT = args.option[1] Since this is most likely the related to the Python wrapper, you don't need that at all... Wild guess: Can't you just simply do something like DEV_IO.init()? What's the reason to use this C Library? I mean, you have your own C++ class and you use QSerialPort in it...
  • Where is a complete description of QDialog?

    Solved
    6
    0 Votes
    6 Posts
    361 Views
    B
    @AnneRanch I agree with you completely. Your post, in my not so humble opinion, is not a rant. It is a valid request. Thanks for your comment.
  • "debug assertion failed" error message

    Unsolved
    14
    0 Votes
    14 Posts
    3k Views
    B
    @ChrisW67 said in "debug assertion failed" error message: What warnings did your compiler issue when it compiled this? I am surprised that mine did not. I realized that the previous error went out because it entered the method that contains this, if I don't run the method with the array the application is fine and can run, actually there is a lot of code in that method but all of it only relates to the UI -> this is the only one I suspect, because when I delete the array the error moves to ui->label->settext(" ");, I will try your method.
  • 0 Votes
    2 Posts
    397 Views
    JonBJ
    @JackMyson You don't actually show the message box being shown (exec()?). Nothing special here. Try not subclassing the QMessageBox and using that directly, so you can rule that out. Try a standalone application without anything of your own. Try passing nullptr as parent to the constructor, any difference? Are you sure you are not using Wayland rather than Xorg, that might make its position or behaviour different.
  • Remove gradient from QPushButton

    Solved
    2
    0 Votes
    2 Posts
    309 Views
    S
    @shreya_agrawal This is how I got rid of the gradient: background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 your_color, stop: 1 your_color);
  • 0 Votes
    5 Posts
    311 Views
    D
    @ChrisW67 Where would you find that I can only find qt version 5.9.7 in the configuration.
  • QChart with more than 1 AreaSeries ?

    Unsolved qt6 qchart qcharts areaseries chart
    1
    0 Votes
    1 Posts
    237 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    42 Views
    No one has replied
  • 0 Votes
    6 Posts
    717 Views
    S
    @Paul-Colby Thanks for your reply again. It would be interesting to try your code on Linux or macOS for comparison (they will also cache in lots of ways, but differently, so might be interesting). I only tried the code on Linux for comparison (I don't have a macOS platform) and found that it didn't cache the service list. The application could find the OTA DATA characteristic after performing steps 1-3. 1.explicitly disconnecting the device - immediately after writing your characteristic, and/or immediately after receiving the disconnect signal (I'd try all combinations of either/both); I tried all combinations on Windows 11, but none of them worked. 2.explicitly try to re-discover services after the initial discovery fails to find the new characteristic (the first discovery would register the WinRT BLE device with Qt, the second would close it before re-discovering). I tried re-discover services and characteristics through two buttons, but none of them worked. The function QLowEnergyController::discoverServices() does nothing since it has been called immediately in the slot triggered by the QLowEnergyController::connected() signal. According to Qt help project, the best workaround is to temporarily turn Bluetooth off. So is it possible to turn Bluetooth off by code? [image: bea2e7d2-6034-4a6c-96f0-41610a7f7e99.png] [image: 1cf1ba81-1e8c-4d95-a59c-dacb57060fd2.png] Anyway, it seems that the WinRT implementation does "clear the previous services cache" when (re)discovering services. However, it does this by iterating the currently known services, and closing them one by one. Please see BluetoothLE example of Windows-universal-samples and the following codes (found at Windows Kits\10\Include\10.0.22621.0\cppwinrt\winrt): template <typename D> WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Devices::Bluetooth::GenericAttributeProfile::GattDeviceServicesResult>) consume_Windows_Devices_Bluetooth_IBluetoothLEDevice3<D>::GetGattServicesAsync(winrt::Windows::Devices::Bluetooth::BluetoothCacheMode const& cacheMode) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Bluetooth::IBluetoothLEDevice3)->GetGattServicesWithCacheModeAsync(static_cast<int32_t>(cacheMode), &operation)); return winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Devices::Bluetooth::GenericAttributeProfile::GattDeviceServicesResult>{ operation, take_ownership_from_abi }; } In QLowEnergyControllerPrivateWinRT: : discoverServices(), I think it should use GetGattServicesWithCacheModeAsync rather than GetGattServicesAsync. In obtainCharList, I think it should use GetCharacteristicsWithCacheModeAsync rather than GetCharacteristicsAsync. I have tried to modified the source codes (see the following pictures) and found it was worked. Now the application could find the OTA DATA characteristic after performing steps 1-3, but the speed of finding services and characteristics slowed down significantly. [image: 134def9c-4600-4ac0-aca1-1aa34b2d2abc.png] [image: f7b650fc-cdd5-4004-99dd-60547c66558c.png] [image: 3c2d326d-d31c-4fce-b4ae-aa83b4a76861.png]
  • QSharedPointer reset()

    Solved
    3
    0 Votes
    3 Posts
    365 Views
    jsulmJ
    @Redman The problem is that after reset you have two different shared pointers pointing to same data. As soon as tmp is deleted (on next loop iteration) it deletes the data it points to. Instead of reset use swap(...).
  • Accessing json data from .qrc file using std::ifstream and nlohmann json

    Solved
    4
    1 Votes
    4 Posts
    655 Views
    S
    @Paul-Colby Thank you so much for such a detailed solution! I think I would go with option 3 in my case.
  • SSL connection error: unknown error number QMYSQL: Unable to connect

    Unsolved mysql ssl ssl error
    6
    0 Votes
    6 Posts
    4k Views
    A
    @koahnig Try using skip_ssl in my.ini file located in MySQL installer path. This worked out for me. [mysqld] skip_ssl
  • SSL connection error: unknown error number QMYSQL: Unable to connect

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    A
    @SGaist I was finally able to resolve the issue by using skip_ssl in my.ini file.
  • Image or animation transition between multiple desktops windows

    Unsolved
    4
    0 Votes
    4 Posts
    244 Views
    jsulmJ
    @darthana There is also https://doc.qt.io/qt-6/animation-overview.html, but not sure you can use it to animate drag and drop.
  • How to create a partially transparent overlay widget?

    Unsolved
    1
    0 Votes
    1 Posts
    236 Views
    No one has replied
  • How to connect with ButtonGroup clicked(AbstractButton) signal?

    Unsolved
    12
    0 Votes
    12 Posts
    930 Views
    Tom assoT
    @Pl45m4 - I didn't know about that function-pointer method; much better to catch errors at compile time!
  • class / object hierarchy tool

    Unsolved
    5
    0 Votes
    5 Posts
    380 Views
    A
    @kshegunov Thanks for reply. Yes, I am looking for something "static". I basically build a task / sub-project and then I like to incorporate it into the main project. Knowing the overall "tree" of objects would help , mainly with implementing "connect" between objects. This "gamma" tool is interesting, however, my application will not require such dynamic management after I get the "skeleton structure " build.