Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Checking if qtableview is empty



  • hello,
    i'm using QTableView as container and using it in another object(another thread). At the beginning i need to check if QTableView, QAbstractItemModel or QStandardItemModel is empty, how can I achieve this?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You can check the row count of the model. Be aware that you can't modify directly QWidgets in any other thread than the main thread. You can however use e.g. signals and slots for that


Log in to reply