Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.9k Posts
  • This topic is deleted!

    Unsolved
    4
    0 Votes
    4 Posts
    62 Views
  • Qt + GraphQL

    Unsolved
    6
    1 Votes
    6 Posts
    4k Views
    N
    I am writing graphql client framework for Qt-Qml You can find it here.
  • understaing part of an example from qcustomplot

    Solved
    12
    0 Votes
    12 Posts
    2k Views
    D
    for completeness for anyone else getting this error I had the realtimeDataSlot() declared under public in the .h file and it should have been in the private slots:
  • 0 Votes
    23 Posts
    6k Views
    Kent-DorfmanK
    @JonB said in converting from float or double to QString results in output being 0: Warning: The QString content may only contain valid numerical characters which includes the plus/minus sign, the character e used in scientific notation, and the decimal point. Including the unit or additional characters leads to a conversion error. In which case RTFM is the rule of the day! but I'm lazy.
  • How do I create a triangle mesh in Qt 3D using C++?

    Unsolved
    1
    0 Votes
    1 Posts
    268 Views
    No one has replied
  • .gitmodules details

    Unsolved
    2
    0 Votes
    2 Posts
    201 Views
    SGaistS
    Hi and welcome to devnet, Not a formal answer as I am not involved in that part but: status is for the module status so whether in belongs to the essential set, add-on, technical preview, etc depends means that the listed modules are mandatory to build recommends means that additional features can be enabled if listed modules are present as for priority, I don't know.
  • [SOLVED] Signals and slots as parameters

    Unsolved signals slots qsharedpointer
    12
    0 Votes
    12 Posts
    2k Views
    S
    It is somehow reasonable to use QSharedPointer here. Most of the time it is not a good idea to use raw pointers (in modern C++). Someone has to manage the memory. Most of the time it will just work in Qt because most of the time Qt objects have a parent which will handle deletion of children when destroyed. If those pointers only live because they are inside a container, the container should use a smart pointer (I'd prefer std::shared_ptr over QSharedPointer, but that's a different topic). There is an easy solution to the problem of connecting when using a shared pointer inside the map. connect() expects a raw pointer. For a smart pointer you get its raw pointer by calling get, i.e. objectsList[obj1].get(). This is the whole trick here. @Linhares said in [SOLVED] Signals and slots as parameters: addConnection("object1", "signal1", "object2", "slot1"); This approach will not work immediately. Once you get your connect() to compile it will tell you at runtime that the signal and slot could not be found. Certainly, you have to use the old connect syntax. The string needs to include the argument types, like "signal1(int)" or "slot1()". Or has that changed at some point?
  • ModbusTcpClient not working

    Unsolved
    13
    0 Votes
    13 Posts
    3k Views
    G
    Turned out an event loop was needed to make QModbus work. I had no idea. Connecting a timer to a method to read registers worked connect(&m_timer, &QTimer::timeout, this, &ModbusController::readInputRegisters);
  • Modbus TCP Client write holding registers

    Solved
    29
    0 Votes
    29 Posts
    5k Views
    D
    @jsulm Now I use Modbus TCP Client without threads and everything works.
  • Reading/Writing Modbus TCP register in thread.

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    D
    @Christian-Ehrlicher @jsulm Thanks for all suggestions and helps. I rewrite my code and now don't use thread to Modbus TCP Client, and everything works .... Only I have thinking why when I plug out ethernet from my PC the state does not change from Connected to Disconnected ? It change only when I turn off server... void ClientTicketMach::onModbusStateChanged(int state) { if (state == QModbusDevice::UnconnectedState){ qDebug() <<"Modbus TCP Client Disconnected"; tim_reconnect.start(10000); tim_reading_inputRegisters.stop(); emit modbusTCPClientConnectedState(true); } else if (state == QModbusDevice::ConnectedState){ qDebug() <<"Modbus TCP Client Connected"; tim_reading_inputRegisters.start(1000); emit modbusTCPClientConnectedState(false); } else if (state == QModbusDevice::ConnectingState){ qDebug() << "Modbus TCP Client Connecting"; emit modbusTCPClientConnectedState(true); } }
  • How to post request on Qt?

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    jsulmJ
    @Roberrt said in How to post request on Qt?: it does use OpenSSL by default It uses SSL for https URLs. http does not require SSL. To be able to access https URLs in your app you will also need to deploy OpenSSL libraries with your app. Qt already provides them.
  • Doxyqml output text is garbled

    Unsolved
    1
    0 Votes
    1 Posts
    151 Views
    No one has replied
  • Qmediaplayer still hates functioning

    Solved
    3
    0 Votes
    3 Posts
    253 Views
    W
    @SGaist it worked, thank you for helping, it probably saved me hours...
  • Does splitting widgets into multiple ui forms reduces compilation time?

    Unsolved
    16
    1 Votes
    16 Posts
    981 Views
    SGaistS
    Hi, You are missing #include "ui_MainWindow.h" in your test.cpp file. Out of curiosity, why are you creating a new file for that method ? You are making your codebase more complex for no benefit.
  • SQLDatabase query creates heap error

    Solved
    12
    0 Votes
    12 Posts
    862 Views
    Christian EhrlicherC
    @astoffregen said in SQLDatabase query creates heap error: Did you know a good guide on how to include external libs/dlls in a visual studio c++ qt project? Don't do it by yourself but use qmake or cmake and let them handle this for you.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    20 Views
    No one has replied
  • issue getting a lineEdit to update

    Unsolved c++ lineedit function
    18
    0 Votes
    18 Posts
    2k Views
    D
    @jsulm the data that is sent is in the form of a char array, example, char message[] = "message here"; I use QString because before I was using std::string and I was getting errors when trying to submit that to the line edit, I think conversion type errors, using a QString removed that error and thus I just stuck with it. edit: oh it is working now, I feel like we didnt change anything though and we were just going through debug statements
  • QTimer::start(0) vs QThread, which one to choose?

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    Kent-DorfmanK
    not able to spontaneously receive "state changed" means you must implement "polling". that's what it is called. Polling is a necessary evil of event driven architectures when the device is, as you say, not sending status changes, but polling is usually hidden from the user by the framework. You need to decide with what resolution/time-interval to poll the device and implement it using the timer, not a thread. threading complicates things and is unnecessary. if you are truly convinced taht you must constantly poll (as fast as the cpu clock allows for) then accept that qt is not the correct framework for your task, as pegging the cpu will create real UI latency problems. Qt is designed for UI applications, not real-time processing.
  • gis server for qt maps

    Unsolved
    1
    0 Votes
    1 Posts
    117 Views
    No one has replied
  • Can't update Grid Layout

    Unsolved
    4
    0 Votes
    4 Posts
    430 Views
    jsulmJ
    @Ramkumar-Mohan said in Can't update Grid Layout: how to remove the deleted data widget Using https://doc.qt.io/qt-6/qgridlayout.html#takeAt for example. Or https://doc.qt.io/qt-6/qlayout.html#removeWidget