Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Moving object back to parent thread

    Unsolved
    5
    0 Votes
    5 Posts
    916 Views
    R
    Thanks for helping, SGaist! At the end I changed connect(device_thread, &QThread::finished, device_thread, &QObject::deleteLater); to connect(device_thread, &QThread::finished, this, [this, dev_id](){ this->DeleteActiveDevice(dev_id); }); and added slot void SerialDeviceManager::DeleteActiveDevice(const int dev_id) { delete active_devices[dev_id].second; active_devices.remove(dev_id); // At this point serial port connection will be with no thread affinity devices[dev_id]->moveToThread(QThread::currentThread()); }
  • QList.removeAt(int index) removes wrong item

    Unsolved
    4
    0 Votes
    4 Posts
    268 Views
    JonBJ
    @vlada said in QList.removeAt(int index) removes wrong item: I don't understand it... You were indeed going crazy :)
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • QT_DEBUG and #include <QDebug>

    Unsolved
    7
    0 Votes
    7 Posts
    3k Views
    ODБOïO
    @SGaist true! i fixed also my bad
  • 'No rule to make target' after upgrading Qt on mac

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    J.HilkJ
    @kitfox delete the whole Build directory by hand and than rebuild the project Simply calling clean and rebuild is not enough after an xcode/osx update
  • Crash when using QKeySequence as global constant

    Unsolved
    2
    0 Votes
    2 Posts
    213 Views
    Christian EhrlicherC
    @Kerndog73 said in Crash when using QKeySequence as global constant: Why does it crash and how do I get around this? It crashes because QKeySequence (like most other gui classes) need a QGuiApplication instance to work properly. Simply don't create any global static at all.
  • 0 Votes
    4 Posts
    677 Views
    C
    I eventually became overly frustrated and I just re-installed the whole Qt package. It appears to be working fine now. Thanks so much for your assistance.
  • Error with sqlite QSqlError("10", "Unable to fetch row", "disk I/O error")

    Unsolved
    6
    0 Votes
    6 Posts
    951 Views
    SGaistS
    I meant on a different physical disk like e.g. an USB key.
  • QTreeView and QListWidget, how to keep selection after lost focus?

    Unsolved
    16
    0 Votes
    16 Posts
    14k Views
    Mike FinchM
    A combination of @wqking and @Riki-P suggestions worked for me. In my app, I have both a QTreeView and a QTableView. So, I did the following in my QMainWindow-derived class. Thanks! MainWindow::MainWindow( QWidget * pParent, Qt::WFlags flags ) : QMainWindow( pParent, flags ) { ... QStringList styles; // Force views to highlight the selected rows even when the view does not have focus. QString fg = toQssFormat( palette().color( QPalette::Active, QPalette::HighlightedText ).lighter() ); QString bg = toQssFormat( palette().color( QPalette::Active, QPalette::Highlight ).lighter() ); styles << QString( "QTreeView:!active { selection-color: %1; selection-background-color: %2; }" ) .arg( fg ) .arg( bg ); styles << QString( "QTableView:!active { selection-color: %1; selection-background-color: %2; }" ) .arg( fg ) .arg( bg ); setStyleSheet( styles.join( " " ) ); ...
  • Qt 5.12.4 and 5.12.5 do not have mysql plugins

    Unsolved
    2
    0 Votes
    2 Posts
    196 Views
    SGaistS
    Hi, See QTBUG-76081 for the reason why.
  • Strange Behaviour - Control Behaviour is set when moving mouse wheel

    Unsolved
    6
    0 Votes
    6 Posts
    436 Views
    SGaistS
    Then it might be something that is specific to your mousepad driver.
  • QAudioDecoder does not expose metadata (Linux, GStreamer)

    Unsolved
    5
    0 Votes
    5 Posts
    486 Views
    SGaistS
    Hi, I haven't take a look at the code of the class but from the documentation description I would say that its goal is to play efficiently local files without all the bells and whistles provided by QMediaPlayer.
  • This topic is deleted!

    Unsolved
    19
    0 Votes
    19 Posts
    93 Views
  • "CDB process terminated" + IMSL C Library

    Solved
    2
    0 Votes
    2 Posts
    258 Views
    F
    I found a solution. IMSL functions need the Intel MKL libraries... So, just include in the *.pro file: LIBS += -L"C:\Program Files (x86)\RogueWave\imsl\cnl-2019.0.0\winms190x64\mkl\11.3.3\lib\intel64"
  • using D3D11 with QT5,the UI will block in multi videos display1

    Unsolved
    8
    0 Votes
    8 Posts
    662 Views
    SGaistS
    Thanks ! You should upload the demonstration and related files on the report. That way, people can directly get it from there especially in the long run.
  • Creator project file: Widgets

    Solved
    4
    0 Votes
    4 Posts
    338 Views
    PsnarfP
    @jsulm Thank you. I can easily delete the version check that Creator automatically inserts into the project file. There is, indeed, a lot of Qt4 still active.
  • 0 Votes
    2 Posts
    626 Views
    SGaistS
    Hi and welcome to devnet, Isn't that a system notification ?
  • Dialog closeEvent is never called

    Solved
    4
    0 Votes
    4 Posts
    434 Views
    Chris KawaC
    Close event happens when you hit the close button. You can connect to the finished() signal instead. As @mranger90 said show() is called by exec() so that's not needed. Also don't forget to check the return value of exec() and, since exec() is blocking anyway, it's more idiomatic to create the dialog on the stack instead of heap + WA_DeleteOnClose.
  • Infinite lock wait issue when emitting signal and datatype is not registered.

    Unsolved
    11
    0 Votes
    11 Posts
    1k Views
    A
    OK. Thanks. Will do.
  • Can we make post request using QNetworkAccessManager in secondary thread?

    Solved
    2
    0 Votes
    2 Posts
    548 Views
    mrjjM
    hi 1) Yes, you can use the worker approach https://wiki.qt.io/QThreads_general_usage and run the QNetworkAccessManager there as far as i know it should work fine. 2) You can run 6 concurrent requests and handle that in an asynchronous manner. Using lambdas you can make the code very compact and local but its not blocking as that is not supported. There is a way to do it QNetworkAccessManager qnam; QNetworkReply *reply = qnam.get(QNetworkRequest(QUrl(…))); QEventLoop loop; QObject::connect(reply, SIGNAL (finished()), &loop, SLOT (quit())); loop.exec(); But using QEventLoop all over the application is the road to odd side effects and not really recommended. So why must it be blocking ? Cant you just use the normal api and simply handle the requests when they come in ? Do you need more than 6 requests at the same time ? I have not seen any access to that info but check out the code and see if you are lucky :) https://code.woboq.org/qt5/qtbase/src/network/access/qnetworkaccessmanager.cpp.html