Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6553585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:35:58+00:00 2026-05-25T12:35:58+00:00

I’m looking for a good tutorial on how to use modeltest to test models

  • 0

I’m looking for a good tutorial on how to use modeltest to test models based on QAbstractItemModel. I don’t know how to interpret debug messages that are displayed.

Also I’m having trouble configuring modeltest project to work with my app in QtCreator. Including the .pri/.pro doesn’t work. I get an error saying “No rule to mage target ..”. After fixing paths in modeltest/modeltest.pro file it starts to compile. But i get this wierd assertion

ASSERT: “QTest::testLogger” in file c:\ndk_buildrepos\qt-desktop\src\testlib\qtestlog.cpp, line 232

Any ideas why this happens ?


My modeltest folder is located inside my project. I added following line at the end of my *.pro file

include(modeltest/modeltest.pri)

The modeltest.pri file contains the following

load(qttest_p4)
SOURCES         += modeltest/modeltest.cpp modeltest/dynamictreemodel.cpp 
HEADERS         += modeltest/modeltest.h modeltest/dynamictreemodel.h

I modified my code to use modeltest this way

model = new TasksModel(this);
new ModelTest(model, this);
ui->treeView->setModel(model);

TasksModel is my implementation of QAbstractItemModel model.
ui->treeView is the widget that displays data.

No other modifications where made while integrating modeltest with my app.

Qt version is 4.7.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:35:59+00:00Added an answer on May 25, 2026 at 12:35 pm

    This will sound a little overgeeky – but it is, in fact, what the ModelChecker dev intended for you to do 😉 When you hit one of the asserts, go to the point in the code where it is hit and read the comments which are written along with it. The entire thing is extremely heavily commented, and describes what is breaking and likely reasons why. This is by far easiest to do if you run your app through a GUI debugger, such as that included in for example KDevelop, Qt Creator or Visual Studio.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.