Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Signals/Slots timing issue in an handshake communication protocol

    Unsolved
    6
    0 Votes
    6 Posts
    350 Views
    jsulmJ
    @Andrew23 said in Signals/Slots timing issue in an handshake communication protocol: is this a possible cause of my behaviour above? Yes, as long as you loop is running you're blocking the Qt event loop.
  • How do you create an Object of QStyleHints

    Unsolved
    12
    0 Votes
    12 Posts
    766 Views
    Chris KawaC
    I'm glad I could help. You can mark the topic as solved from the "topic tools" menu on the right side of your post. See Hitchhiker's Visual Guide to the Qt Forum for help.
  • Linking to a MSVC DLL -- Undefined references?

    Unsolved
    3
    0 Votes
    3 Posts
    305 Views
    SGaistS
    Hi, @JKSH said in Linking to a MSVC DLL -- Undefined references?: You must build your app with the same version of MSVC instead. Just to add to that, MSVC versions used to be incompatible with each other until VS2017 which was backward compatible with 2015.
  • QImage::Format_Invalid from MedaiPlayer QVideoFrames

    Solved filters qml mediaplayer qimage
    6
    0 Votes
    6 Posts
    1k Views
    SGaistS
    Which examples are you referring to ?
  • 0 Votes
    7 Posts
    970 Views
    SGaistS
    Did you rebuild your application from scratch and re-run the correct version of macdeployqt ?
  • Text document with special inline characters

    Unsolved
    1
    0 Votes
    1 Posts
    150 Views
    No one has replied
  • Qt 6.0 adaptation: no member named 'midRef' in 'QString'. How to solve?

    Unsolved
    4
    0 Votes
    4 Posts
    4k Views
    Christian EhrlicherC
    @bogong said in Qt 6.0 adaptation: no member named 'midRef' in 'QString'. How to solve?: what is "ctor" Constructor.
  • Using socketcan on QT

    Unsolved
    12
    0 Votes
    12 Posts
    929 Views
    jsulmJ
    @Garza Yes, use qmake from your Qt, then "make" and "make install"
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    31 Views
    No one has replied
  • How to make Password Echo On Edit not clear out the Previous Content

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    nageshN
    @TomQue as answered in the thread https://forum.qt.io/topic/125634/accessing-d-pointer-d_func-from-qlineedit-class/9 My simplest solution for the modified behavior (not to clear the text content) of "PasswordEchoOnEdit" will be as follows. 1)set the lineEdit "passwdEdit" echomode as "normal" 2)connect the QApplication focusChanged signal to lambda function 3)In lambda function check if last focus widget was "passwdEdit" then set echommode as "Password" else if Current focus is "passwdEdit" then set echommode as "Normal" tested code sample is as follows connect(qApp, &QApplication::focusChanged, [this](QWidget *oldFocus, QWidget *newFocus ) { if(oldFocus == this->ui->passwdEdit) this->ui->passwdEdit->setEchoMode(QLineEdit::Password); else if(newFocus ==this->ui->passwdEdit) this->ui->passwdEdit->setEchoMode(QLineEdit::Normal); } );
  • Accessing d pointer d_func from QLineEdit class

    Unsolved
    9
    0 Votes
    9 Posts
    999 Views
    nageshN
    @TomQue said in Accessing d pointer d_func from QLineEdit class: The original code that of QLineEdit re-implements the function InputmethodEvent and forces it to clear. I am trying re-implement it using my own version of the function so it doesnt clear My simplest solution for the modified behavior (not to clear the text content) of "PasswordEchoOnEdit" will be as follows. 1)set the lineEdit "passwdEdit" echomode as "normal" 2)connect the QApplication focusChanged signal to lambda function 3)In lambda function check if last focus widget was "passwdEdit" then set echommode as "Password" else if Current focus is "passwdEdit" then set echommode as "Normal" tested code sample is as follows connect(qApp, &QApplication::focusChanged, [this](QWidget *oldFocus, QWidget *newFocus ) { if(oldFocus == this->ui->passwdEdit) this->ui->passwdEdit->setEchoMode(QLineEdit::Password); else if(newFocus ==this->ui->passwdEdit) this->ui->passwdEdit->setEchoMode(QLineEdit::Normal); } );
  • Using the same device created with QCanBusDevice in two dilaog

    Unsolved
    3
    0 Votes
    3 Posts
    236 Views
    A
    hi @jsulm you mean like that Com::Com(QWidget *parent,ConnectDialog *device1) : QDialog(parent), ui(new Ui::Com) when I do it as mentioned an error occur com.cpp:21:6: error: out-of-line definition of 'Com' does not match any declaration in 'Com' give me an example if you have and thank you
  • Exiting gracefully when memory exhausted

    Unsolved
    12
    0 Votes
    12 Posts
    899 Views
    J.HilkJ
    @AndyBrice That would involve a lot of rewriting! you do not have to necessarily rewrite your whole code, a small test program could, as first step be enough, no ? Sounds nasty...! I've never done it myself, and only seen it done once, in the source code of Command & Conquer
  • Qt QGraphicsScene AddWidget QSvgWidget

    Unsolved
    5
    0 Votes
    5 Posts
    622 Views
    A
    Why don't you use QGraphicsSvgItem instead? Using a proxy widget will add all kinds of nasty surprises, one of them being that the content of the embedded widget does not scale nicely by default.
  • filePathName

    Unsolved
    2
    0 Votes
    2 Posts
    140 Views
    mrjjM
    Hi What code do you have now? Anyway, something like this https://amin-ahmadi.com/2016/01/04/qt-drag-drop-files-images/
  • Arm architecture opencv qt not working properly

    Unsolved
    10
    0 Votes
    10 Posts
    877 Views
    SGaistS
    What did you implement to make it work ?
  • 0 Votes
    3 Posts
    209 Views
    Christian EhrlicherC
    Dupe of https://forum.qt.io/topic/125644/qt-6-0-adaptation-warning-string-is-deprecated-use-qmetatype-type-instead-how-to-solve ... wonder why it's so hard to read the error message. It contains the answer...
  • 0 Votes
    2 Posts
    376 Views
    SGaistS
    Hi, The answer is in the warning: QMetaType::Type enumeration.
  • 0 Votes
    15 Posts
    19k Views
    B
    QProcess has quite extensive support for synchronous use. #include <QCoreApplication> #include <QDebug> #include <QProcess> int main(int argc, char **argv) { QCoreApplication app(argc, argv); QProcess process; process.start("ls", {"-l"}); if (process.waitForFinished()) { qDebug() << "returned:" << process.readAllStandardOutput(); } else { qDebug() << process.errorString(); } process.start("ls", {"-l"}); while (process.waitForReadyRead()) { while (process.canReadLine()) qDebug() << process.readLine().trimmed(); } }
  • QAbstractItemView::setSelectionModel failing

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    K
    Alright I had some stuff commented out that took me forever to debug, but I got it! So the piece I was missing is that a View has both a Model and a SelectionModel. Obviously this is listed in the documentation, but I missed it. Here's the chunk of documentation regarding that: Handling selections of items The mechanism for handling selections of items within views is provided by the QItemSelectionModel class. All of the standard views construct their own selection models by default, and interact with them in the normal way. The selection model being used by a view can be obtained through the selectionModel() function, and a replacement selection model can be specified with setSelectionModel(). The ability to control the selection model used by a view is useful when we want to provide multiple consistent views onto the same model data. Anyway, so it turns out all I needed was a subclass of QStringListModel to handle my data that I had already made, and I got lost in the sauce trying to turn that into a QItemSelectionModel, thinking it was a direct replacement for a Model. I guess I feel like it could be more clear that a View has both a Model and a SelectionModel attached as soon as you give it a Model, but it's there in the docs so I guess it's on me. :) Thanks for the help!