Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • qmake generate config file

    Solved
    3
    0 Votes
    3 Posts
    522 Views
    S
    @SGaist Thank you, that's what I needed.
  • where should action execution happen?

    Unsolved
    6
    0 Votes
    6 Posts
    501 Views
    jsulmJ
    @user4592357 Usually a class which emits signals should not know anything about classes which connects to its signals. I suggest you provide an interface in your model to get the actions, then your main window can get these actions and connect to them - your model does not have to care about classes connecting to it.
  • QComboBox - how to change text size ( pixels )

    Unsolved
    1
    0 Votes
    1 Posts
    489 Views
    No one has replied
  • High DPI and native presentation of images

    Solved
    2
    0 Votes
    2 Posts
    489 Views
    S
    I found a solution myself. When drawing the image I can get the current screen and its device pixel ratio. This is the current scaling factor Windows is using. With this factor I can scale the image to the current size. regards Oliver
  • This topic is deleted!

    Unsolved
    7
    0 Votes
    7 Posts
    62 Views
  • problem in sending a json file to url

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    KroMignonK
    @JoeCFD said in problem in sending a json file to url: void ClassName::postFinished() { std::cout << " error " << qPrintable( m_reply->errorString() ) << std::endl; } the output in slot postFinished() Unknown error This was only an example to explain how-to get in touch when request is done! I just rewrite your code to made it work. A more logical process would be: connect(reply, &QNetworkReply::finished, this, [reply]() { if (reply->error() == QNetworkReply::NoError) { QByteArray data = reply->readAll(); QDebug() << "Success:" << data; } else qDebug() << "Failure: " << qPrintable( reply->errorString() ); });
  • [solved] QDomNode get formated text

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    B
    If you just need something like outerHTML in javascript, you can use QDomNode::save like: QString output; QTextStream stream(&output); node.save(stream, 0);
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    17 Views
    No one has replied
  • How to get output system command in Qt C++?

    Unsolved
    6
    0 Votes
    6 Posts
    5k Views
    B
    @tadamo You need to get the exit code AFTER the process finished. Asynchronous (non-blocking) way: QProcess *myProcess = new QProcess(this); connect(myProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, [=](int exitCode, QProcess::ExitStatus exitStatus){ //use exitCode here directly }); myProcess->start(program, arguments); Synchronous (blocking) way: myProcess->start(program, arguments); myProcess->waitForFinished(); int res = myProcess->exitCode(); Note: you may also need to handle FailedToStart error when "start" or timeout when "waitForFinished"
  • Details library

    Unsolved
    2
    0 Votes
    2 Posts
    205 Views
    Chris KawaC
    An example set of properties (some are Windows specific) to set in the .pro file can look like this: QMAKE_TARGET_DESCRIPTION = This is a description of my product QMAKE_TARGET_PRODUCT = SomeProduct QMAKE_TARGET_COMPANY = SomeCompany QMAKE_TARGET_COPYRIGHT = Me! VERSION = 1.2.3.4 For all possible options see qmake variables reference.
  • how to go back to default active handler while using datavisualization

    Unsolved
    4
    0 Votes
    4 Posts
    209 Views
    SGaistS
    Sorry but it is not really any clearer.
  • System Level Testing with Qt

    Unsolved test automation qjsengine qt test
    14
    0 Votes
    14 Posts
    3k Views
    SGaistS
    That's just a wild guess but you might be able to use Selenium as usual if your application is built for WASM. Otherwise, AFAIK, the reference tool is Squish.
  • TextEdit and eventFilter: characters not appearing on ui element

    Solved
    3
    0 Votes
    3 Posts
    376 Views
    T
    @SGaist Hi. Ok, I changed eventFilter() a little bit: bool MainWindow::eventFilter(QObject *obj, QEvent *event) { if (obj == ui->textEdit) { if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); qDebug() << "Ate key press " << keyEvent->text(); } } return QMainWindow::eventFilter(obj, event); } and now it works. Thanks!
  • Qt - C++ - QListView - Custom Shape

    Unsolved
    2
    0 Votes
    2 Posts
    216 Views
    SGaistS
    Hi, One thing worth trying is the Qt Graphics View Framework. You might be able to apply the transforms you want on the item but I can't guarantee it.
  • Please consider dropping the rule that prevents installation from a network share

    Unsolved
    2
    0 Votes
    2 Posts
    221 Views
    SGaistS
    Hi, This is a user forum, there's nothing we can do about that here. If you want to talk design decisions, you should bring this to the interest mailing list.
  • QSettings file MIA

    Solved
    4
    0 Votes
    4 Posts
    385 Views
    DriftwoodD
    @jsulm said in QSettings file MIA: @Driftwood Did you read https://doc.qt.io/qt-5/qsettings.html ? On Windows default location for settings is Windows Registry. Just read the doc and see that QSettings defaults to QSettings::NativeFormat, which uses the Windows registry, demonstrated in my first code block. And then settings->sync() "imports changes made by other processes (in addition to writing the changes from this QSettings)." Note to self: Read first :D @jsulm - Thank you.
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    12 Views
  • How to set 2 different settings in QStandardItem?

    Unsolved
    5
    0 Votes
    5 Posts
    829 Views
    T
    @JonB I would like to do that with delegate. I also add EDIT in my last post for you. Now I think you understand my last problem :)
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • How to write directly in to a QByteArray held by a QVariant

    Solved
    15
    0 Votes
    15 Posts
    2k Views
    S
    @kshegunov @Christian-Ehrlicher Thank you both for all the information. I guess I will just do something like: v.setValue( QByteArray(new_data, 1000) ); and not worry too much about avoiding memory allocations.