Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Custom model of nested lists to QML

    Unsolved qabstractitemmo qabstractlistmo qml model-view
    2
    0 Votes
    2 Posts
    672 Views
    E
    Still not sure what's the best design here.
  • How to link a bool variable to a push button in c++ qt?

    Solved
    13
    0 Votes
    13 Posts
    2k Views
    Pablo J. RoginaP
    @nanor said in How to link a bool variable to a push button in c++ qt?: my code worked well great, so please don't forget to mark your post as solved!
  • How to use QTcpSocket with Threads

    Unsolved
    3
    0 Votes
    3 Posts
    868 Views
    Gojir4G
    @GCE_ Hi, you don't need threads for that, instead of waitForReadyRead()you can use readyRead() signal and read from socket at this time. This will avoid blocking your event loop and freeze your GUI. see Fortune Client Example
  • file log output script execution windows not created on Windows

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    JonBJ
    @mourad_bilog So you can see it is finding it from the very first element in your PATH when you execute from " the Windows command bash". I don't know when/where that gets prepended to your PATH? It appears to be the case that your PATH does not have that when you execute it from Creator. @SGaist told you: Check the PATH environment variable in the Run part of the Project panel. It likely does not contain the path to sqlplus. ? Maybe it gets prepended only when you go into bash shell, e.g. some Windows .bashrc file. So either you have do the same/run it via bash as I showed earlier, or you have to put the necessary into that variable in Creator. Also depends whether your application is for your own use only or whether you intend to distribute it to others.
  • Writing to standard input of a C# based QProcess

    Unsolved
    6
    0 Votes
    6 Posts
    631 Views
    JonBJ
    @mhmdkanj said in Writing to standard input of a C# based QProcess: Trying the temp | C# displays Enter a string - You entered 'Test' and then pauses. Assuming it does not pause for 10 seconds before displaying the message, then I don't know what is different from the situation compared to writing to/reading from it via QProcess in your Qt program....
  • QAudioInput does not notify

    Solved
    4
    0 Votes
    4 Posts
    200 Views
    S
    @Christian-Ehrlicher said in QAudioInput does not notify: Very nice and descriptive example on how to not use lambdas... I would guess QAudioInput needs a running event loop in it's thread which isn't the case here. I remodelled it void KVideoChatDialog::callAccepted(uint16_t port) { auto device = this->settings->getVideoDevice(); if (!device.has_value()) { QMessageBox::warning(nullptr, "No Device", "No Device was selected"); return; } connect(this, &KVideoChatDialog::startVideo, this, [this]() { this->videothread = std::make_unique<boost::thread>(&KVideoChatDialog::startVideoTransferSocket, this); //this->audiothread = std::make_unique<boost::thread>(&KVideoChatDialog::startAudioTransferSocket, this); }); emit this->startVideo(); this->startAudioTransferSocket(); } void KVideoChatDialog::startVideoTransferSocket() { this->cap.open(0); while (this->cap.isOpened()) { cv::Mat frame; cap >> frame; if (frame.empty()) continue; auto img = QImage(frame.data, frame.cols, frame.rows, frame.step, QImage::Format::Format_RGB888); emit this->changeOwnPic(img); QByteArray array; QBuffer buffer(&array); buffer.open(QIODevice::WriteOnly); img.save(&buffer, "BMP"); buffer.waitForBytesWritten(1000); array = qCompress(array, 5); uint64_t index = 0; int64_t len = 0; do { len = this->video_socket->writeDtlsDatagram(array.mid(index, 4096)); index += 4096; std::this_thread::sleep_for(std::chrono::microseconds(10)); } while (len >= 4096); this->video_socket->writeDtlsDatagram("<END>"); } } void KVideoChatDialog::startAudioTransferSocket() { this->audioInBuffer = new QBuffer(&this->QAudioInArray); this->audioInBuffer->open(QIODevice::WriteOnly); QAudioFormat format; format.setChannelCount(1); format.setSampleRate(8000); format.setSampleSize(8); format.setCodec("audio/pcm"); format.setByteOrder(QAudioFormat::Endian::LittleEndian); format.setSampleType(QAudioFormat::UnSignedInt); this->audioIn = new QAudioInput(this->settings->getAudioInput(), format); this->audioOut = new QAudioOutput(this->settings->getAudioOutput(), format); this->audioOut->setBufferSize(2048); this->audioIn->setNotifyInterval(1000); connect(this->audioIn, &QAudioInput::notify, this, &KVideoChatDialog::audioInNotify); connect(this->audioIn, &QAudioInput::stateChanged, this, [](QAudio::State state) {QMessageBox::warning(nullptr, "State changed", QString::number(state)); }); this->audioIn->start(this->audioInBuffer); auto state = this->audioIn->state(); //this->AudioINLoop.exec(); int i = 0; } Now it works.
  • How to to overwrite lines in text file in Qt

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    U
    Thank you for the inputs.
  • Problem compiling Qt statically for Ubuntu

    Unsolved
    1
    0 Votes
    1 Posts
    171 Views
    No one has replied
  • How write zoom application?

    Unsolved
    1
    0 Votes
    1 Posts
    179 Views
    No one has replied
  • How to connect to an SQL server using Windows authentication using qt?

    Unsolved
    2
    0 Votes
    2 Posts
    303 Views
    JonBJ
    @Mounish Is the driver string you show for Microsoft SQL Server? (If so, I hadn't heard of Uid= or Pwd=, but there you are.) Whatever it is for, what does that database driver documentation say is the syntax for using Win Auth?
  • PEP warnings not displaying for .pyw files

    Unsolved
    3
    0 Votes
    3 Posts
    281 Views
    M
    @SGaist Hi, I am using Qt Creator 4.13.1
  • sincos()

    Unsolved
    2
    0 Votes
    2 Posts
    259 Views
    sierdzioS
    I'd say the chances are very low. Qt is deprecating it's own algorithms in favor of all the goodness found in STL nowadays.
  • Relationships between qmake, make, nmake, jom, and the compiler

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    A
    "-j [jobs], --jobs[=jobs] Specifies the number of jobs (commands) to run simultaneously. If there is more than one -j option, the last one is effective. If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously. "
  • Wont show another window

    Solved
    16
    0 Votes
    16 Posts
    1k Views
    E
    @Pablo-J-Rogina ``` QSqlQuery query(QSqlDatabase::database("QTUSERS")); to QSqlQuery query(QSqlDatabase::database("MyConnect")); and ``` query.prepare(QString("SELECT * FROM Users_QT WHERE username = :username AND password")); to ``` query.prepare(QString("SELECT * FROM Users_QT WHERE username = :username AND password = : password"));
  • License switch question (from commercial to opensource)

    Unsolved
    2
    0 Votes
    2 Posts
    227 Views
    SGaistS
    Hi, That's something you should talk about with the Qt Company directly.
  • Easiest way to get substring from QString in Qt

    Unsolved c++ qstring qstringlist substring regex
    2
    0 Votes
    2 Posts
    1k Views
    SGaistS
    Hi, One possible way is to use QRegularExpression::match or since it looks like xml, you can use QXmlStreamReader.
  • How to make move icon disappeared when moving column outside of QHeaderView ?

    Unsolved
    2
    2 Votes
    2 Posts
    179 Views
    SGaistS
    Hi, By instinct, I would say look at the mouseMoveEvent method. Taking a look at the code of QHeaderView, I don't think it's something you'll be able to do by just subclassing.
  • 0 Votes
    10 Posts
    2k Views
    N
    @Pl45m4 Thank you so much. I set it to "This" and my code worked well.
  • Creating a sort of file explorer layout in Qt

    Solved
    7
    0 Votes
    7 Posts
    3k Views
    johnratiusJ
    @JonB Thanks! In the future I will add some sort of editing feature, but for now it will just be viewing.
  • 0 Votes
    8 Posts
    754 Views
    M
    @SGaist I did not say that there is a bug, to be honest I was quiet sure that it is me who is doing something wrong. And yes - I tried Bluetooth Serial Terminal (from Win10 store) and it also takes a few seconds to connect to device as well. I assume it might be the device (it is a custom thing I'd say) that lags on open. Alright, at least I understand now that either I need to move all the stuff to some kind of worker handling QSP on separate thread or accept that there will be a lag on open. Thanks, guys!