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 9170541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:02:17+00:00 2026-06-17T16:02:17+00:00

I have a command line openCV program that I wrote in Xcode that opens

  • 0

I have a command line openCV program that I wrote in Xcode that opens two XML files, analyses and then compares them. However, I’m now trying to put that program into a GUI using QtCreator to make it easier to understand the output.

The problem is, Qt doesn’t seem to like cv::FileStorage. The program compiles fine, but when I actually try to execute the OpenCV part, it crashes, giving this error:

OpenCV Error: Null pointer (NULL or empty buffer) in
cvOpenFileStorage, file
/tmp/OpenCV-2.4.3/modules/core/src/persistence.cpp, line 2702 Qt has
caught an exception thrown from an event handler. Throwing exceptions
from an event handler is not supported in Qt. You must reimplement
QApplication::notify() and catch all exceptions there.

The program has unexpectedly finished.

Does anyone know why Qt doesn’t seem to like running this program? Or if there’s a way that I can cleanly integrate the OpenCV program into the Qt one?

N.B. This is what the Qt GUI looks like:

enter image description here

The user selects the two XML files with the relevant buttons. The paths to these files are then stored and displayed in the boxes next to the buttons. I then convert the QStrings to std::strings using the following:

std::string file1path = file1Name.toUtf8().constData();
std::string file2path = file2Name.toUtf8().constData();

file1path and file2path are then passed to the cv::FileStorage commands as follows:

//Create File Storage
FileStorage storage1;
storage1.open(file1path, FileStorage::READ);

FileStorage storage2;
storage2.open(file2path, FileStorage::READ);
  • 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-06-17T16:02:18+00:00Added an answer on June 17, 2026 at 4:02 pm

    It’s not Qt specifically.
    OpenCV is throwing an error in your use of fileStorage, either file doens’t exist, isn’t readable, or you are trying to read the wrong types.

    Qt gives you that error because the exception has reached it’s general error handler for an unchecked exception rather than openCv, which would print a more useful error.

    You can add a global excpetion handler to a Qt app by adding a method to QApplication

    bool QApplication::notify ( QObject * receiver, QEvent * event )
        {
          try{
            return QApplication::notify( received, event );
          }
          catch ( const std::exception &e )
          {
            QApplication::postEvent( this, new MyEvent( e.what() );
          }
          catch ( ... )
          {
    
          }
    

    See also http://qt-project.org/doc/qt-4.8/exceptionsafety.html

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

Sidebar

Related Questions

I have a command line program that prints out a report such as: I
I have command-line program that do a lot of work and produce a lot
I have a command line program in Python that takes a while to finish.
I have a command-line java program that takes a password and it's verification from
I have a command line program to validate an XML against an XSD file.
i have a command line executable program that accepts a configuration file as it's
Currently I have a command line OSX executable that I am compiling in xcode.
I have a command line program developed in c. Lets say, i have a
I have a command line tool written in c# (that i have the source
I have a command line script that uses the Django ORM and MySQL backend.

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.