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 ?
Forum Updated to NodeBB v4.3 + New Features

How to output debug from ModelTest helper class ?

Scheduled Pinned Locked Moved Solved General and Desktop
qlogging
3 Posts 2 Posters 363 Views 1 Watching
  • 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 26 Jan 2020, 21:04 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Jan 2020, 21:12 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 26 Jan 2020, 21:19
      0
      • S SGaist
        26 Jan 2020, 21:12

        Hi,

        Please check the QLoggingCategory documentation.

        D Offline
        D Offline
        Dariusz
        wrote on 26 Jan 2020, 21:19 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

        3/3

        26 Jan 2020, 21:19

        • Login

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