Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.2k Topics 455.1k Posts
  • QProcess signal out of order ?

    Unsolved
    6
    0 Votes
    6 Posts
    103 Views
    D
    Actually, I expected that one more signal would occur if the readyReadStandardOutput was processing while the process finished. The odd thing was there was a second readyReadStandardOutput signal happening. Although I have checked with the guy doing the actual work, and the second one always returns an empty string when readAllStandardOutput is called.
  • PCAN-LAN integration in QTSerialBus

    Unsolved
    3
    0 Votes
    3 Posts
    131 Views
    aha_1980A
    @fcol95 While the use case sounds interesting I currently don't have access to such devices and therefore cannot work on an integration. Regards
  • How to create custom delegate for QComboBox

    Solved
    8
    0 Votes
    8 Posts
    154 Views
    O
    @Pl45m4 Your solution is well suited for my purpose! Thank you!
  • How to iterate over a QHash using for_each

    Solved
    8
    0 Votes
    8 Posts
    91 Views
    SGaistS
    @Bondrusiek if you want to have access to the key and value, you need to use keyValueBegin and keyValueEnd. QHash doesn't match the stl API but it was too late to change when it was discovered.
  • Qt service with gui

    Unsolved
    23
    0 Votes
    23 Posts
    2k Views
    S
    @franco.amato Will you be able to make QT service with GUI or launch QT app with GUI from Qt service?
  • Unable to launch QT desktop app from Qt Service using QProcess

    Unsolved
    10
    0 Votes
    10 Posts
    171 Views
    S
    I have logged process state changed event and few more. Here is the updated code and logs. void ShutdownEventFilter::launchApp() { Logging::getInstance()->writeLog("ShutdownEventFilter::launchApp"); QString workingDir = "D:/Work/Qt_builds/inspirationalclips_Qt_6_8_0_MSVC2022_64bit-Debug/debug/"; QString program = "D:/Work/Qt_builds/inspirationalclips_Qt_6_8_0_MSVC2022_64bit-Debug/debug/inspirationalclips.exe"; QStringList arguments; // Add arguments if needed, e.g., arguments << "-flag" << "value"; QProcess *process = new QProcess(); //standard output: QObject::connect(process, &QProcess::readyReadStandardOutput, [=]() { Logging::getInstance()->writeLog("QProcess::readyReadStandardOutput: " + process->readAllStandardOutput()); }); QObject::connect(process, &QProcess::readAllStandardOutput, [=]() { QString strText = QString("QProcess::readAllStandardOutput: output = %1") .arg(QString::fromUtf8(process->readAllStandardOutput())); Logging::getInstance()->writeLog(strText); }); //standard errors: QObject::connect(process, &QProcess::errorOccurred, [&](QProcess::ProcessError error) { Logging::getInstance()->writeLog("QProcess::errorOccurred: " + process->errorString()); }); QObject::connect(process, &QProcess::readyReadStandardError, [=]() { QProcess::ProcessError procErr = process->error(); QString strErr = QMetaEnum::fromType<QProcess::ProcessError>().valueToKey(procErr); QString strText = QString("QProcess::readyReadStandardError: error = %1").arg(strErr); Logging::getInstance()->writeLog(strText); }); QObject::connect(process, &QProcess::readAllStandardError, [=]() { Logging::getInstance()->writeLog("QProcess::readAllStandardError: " + process->readAllStandardError()); }); QObject::connect(process, &QProcess::stateChanged, [&](QProcess::ProcessState state) { QString strState = QMetaEnum::fromType<QProcess::ProcessState>().valueToKey(state); QString strText = QString("QProcess::stateChanged: state = %1").arg(strState); Logging::getInstance()->writeLog(strText); }); QObject::connect(process, &QProcess::started, [=]() { Logging::getInstance()->writeLog("QProcess::started: -----------process started---"); }); QObject::connect(process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), [&](int exitCode, QProcess::ExitStatus exitStatus) { QString strExitStatus = QMetaEnum::fromType<QProcess::ExitStatus>().valueToKey(exitStatus); QString strText = QString("QProcess::finished: exitCode = %1 exitStatus = %2") .arg(exitCode) .arg(strExitStatus); Logging::getInstance()->writeLog(strText); }); process->setWorkingDirectory(workingDir); process->start(program, arguments); if (!process->waitForStarted()) { qDebug() << "Error starting application:" << process->errorString(); Logging::getInstance()->writeLog("Error starting application: " + process->errorString()); } //print current state QProcess::ProcessState state = process->state(); QString strState = QMetaEnum::fromType<QProcess::ProcessState>().valueToKey(state); QString strText = QString("ShutdownEventFilter::state = %1").arg(strState); Logging::getInstance()->writeLog(strText); //print error if any: QProcess::ProcessError procErr = process->error(); QString strErr = QMetaEnum::fromType<QProcess::ProcessError>().valueToKey(procErr); strText = QString("ShutdownEventFilter::error = %1").arg(strErr); Logging::getInstance()->writeLog(strText); // The process will continue to run independently // if you need to interact with it, use other QProcess methods Logging::getInstance()->writeLog("ShutdownEventFilter::launchApp----------running------"); } Here is the updated log file: 2025-05-15 15:05:49: ShutdownEventFilter::launchApp 2025-05-15 15:05:49: QProcess::stateChanged: state = Starting 2025-05-15 15:05:49: QProcess::stateChanged: state = Running 2025-05-15 15:05:49: QProcess::started: -----------process started--- 2025-05-15 15:05:49: ShutdownEventFilter::state = Running 2025-05-15 15:05:49: ShutdownEventFilter::error = UnknownError 2025-05-15 15:05:49: ShutdownEventFilter::launchApp----------running------ 2025-05-15 15:05:51: QProcess::stateChanged: state = NotRunning 2025-05-15 15:05:51: QProcess::finished: exitCode = 255 exitStatus = NormalExit This logs shows process started and then goto ''Running' state and then Unknown error occurred and process terminated.
  • MacOS file open dialogue shows "Date-Added" which is always empty.

    Unsolved
    4
    0 Votes
    4 Posts
    92 Views
    PerdrixP
    This was a USB 3.0 external drive formatted as exFAT.
  • How can I add tags to a post?

    Solved
    3
    0 Votes
    3 Posts
    36 Views
    S
    Log in to your Qt Forum account. Go to your post: You can find it by clicking your profile picture (top-right) → Profile → Posts. Once on your post's page, look for the “⋮” (three dots) icon or gear icon below your post. Click it and select Edit. In the Edit screen, look for the "Tags" field near the bottom (under the post text area). Start typing the tags you want (e.g., qtquick, qml, qdebug, etc.) and select them from the suggestions or create new ones. Click "Submit" to save your changes.
  • Error displaying QOpenGLWidget on newer version

    Unsolved
    5
    0 Votes
    5 Posts
    126 Views
    T
    @SGaist said in Error displaying QOpenGLWidget on newer version: You should check the bug report system to see if there something about your issue already and if not please open a new ticket providing a minimal compilable reproducer. Created
  • Translate additional class (.h & .cpp) files on execution

    Moved Unsolved
    2
    0 Votes
    2 Posts
    32 Views
    SGaistS
    Hi and welcome to devnet, Did you check whether the qm files were regenerated as well ?
  • Dock panels glitching out

    Unsolved
    3
    1 Votes
    3 Posts
    81 Views
    Axel SpoerlA
    This one has bugged me really really badly! I closed the bugreport as invalid. In a nutshell: What the reproducer misses (and I have overlooked it as well), is setting a central widget to the main window, as documented here. A main window should have that, if it should contain anything properly laid out. It doesn't complain, when dock widgets are added without a central widget. The advantage of the central widget is, that it separates dock areas from each other. Without one, they completely overlap. It's possible to undock and re-dock the dock widgets. However, they won't end up at their original dock area. They usually formed a cluster in the right dock area, which almost looks like their initial setting. But with the top and bottom dock areas being empty, there is no size constraint and therefore no collapsing.
  • QT 6.9 QTableView QStyledItemDelegate Button CSS not working

    Unsolved
    2
    0 Votes
    2 Posts
    42 Views
    Christian EhrlicherC
    Please provide a minimal, compilable example of your problem - I would guess it's not more than 30 lines.
  • Qt Classic Bluetooth Windows. I can not connect to a specific device.

    Unsolved
    1
    0 Votes
    1 Posts
    46 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • 0 Votes
    2 Posts
    46 Views
    SGaistS
    Hi, From a quick look at the code, I would say that you'd need to build a custom windows platform plug-in to add that parameter. That said, did you check the new QRhi classes ? They might provide something that fits your need.
  • Problem setting the scene rectangle

    Solved
    2
    0 Votes
    2 Posts
    49 Views
    J
    nvm. It looks like the trace format was wrong
  • Serial Port Issue

    Unsolved
    2
    0 Votes
    2 Posts
    50 Views
    jsulmJ
    @Shashwat You will have to provide more information (even better relevant code). You did not even mention whether you're using https://doc.qt.io/qt-6/qtserialport-index.html
  • Qt 6.9.0 GraphicScene scrollbars give wrong value ( nan or inf )

    Unsolved
    6
    0 Votes
    6 Posts
    126 Views
    Z
    IT'S SOLVED
  • Qt CAN bus

    Unsolved
    5
    0 Votes
    5 Posts
    94 Views
    G
    Sorry, forum only lets me post every 10 minutes and had to go. Putting the cmake code at the bottom of the file stopped the errors. Knowing cmake would help? knowing everything would help, I'm getting there.
  • Breeze style disobeys some style options

    Solved
    3
    0 Votes
    3 Posts
    355 Views
    RokeJulianLockhartR
    Breeze also does some custom stuff like halfway using the QPalette (sometimes it will use its signature light blue even in places where the "highlight" color role is set differently). @Ewan-Green, that's deliberate: Breeze uses KColorScheme to supersede the QPalette. It's because in KDE4, the palette wasn't sufficient. There is an effort to port it to the palette, but I've yet to ascertain whether it's even tracked (beyond, perhaps Union). Irrespective, did you ever report this, or did it remediate itself? If the former, have you the URI?