Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to output debug from ModelTest helper class ?

How to output debug from ModelTest helper class ?

Scheduled Pinned Locked Moved Solved General and Desktop
qlogging
3 Posts 2 Posters 351 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey

    I'm trying to debug my model but I'm hitting a wall with its output. When I look in to source it has stuff like :

       qCDebug(lcModelTest) << "rowsInserted"
                             << "start=" << start << "end=" << end << "parent=" << parent
                             << "parent data=" << model->data(parent).toString()
                             << "current count of parent=" << model->rowCount(parent);
    
    

    But none of it gets printed for me, how do I enable it?
    model > https://wiki.qt.io/Model_Test

    TIA

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Please check the QLoggingCategory documentation.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Please check the QLoggingCategory documentation.

        D Offline
        D Offline
        Dariusz
        wrote on last edited by Dariusz
        #3

        @SGaist Yes I did but the modelTest creates its own category > Q_LOGGING_CATEGORY(lcModelTest, "qt.modeltest") and I have no idea how to enable it or what. I have installed my own qInstallMessageHandler() and made sure that default() always prints whatever gets sent to it. But it looks like nothing get sends to it at all.


        Ok looks like I need to run this :

        QLoggingCategory::setFilterRules("qt.modeltest.debug=true\n");//qt.modeltest
        
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved