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

  • SEARCH
  • Home
  • 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 8705047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:15:27+00:00 2026-06-13T03:15:27+00:00

I am building up a QListWidget, browsing through a directory so that every .png

  • 0

I am building up a QListWidget, browsing through a directory so that every “.png” gets listed with a preview icon.

The core of my populating loop looks like this:

new QListWidgetItem( QIcon(act_fullname), act_filename);

Right after the whole list is ready, the app crashes.
The error is many times repeated and says this:

On Mac OS X, you might be loading two sets of Qt binaries into the
same process. Check that all plugins are compiled against the right Qt
binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of
binaries are being loaded. QObject::moveToThread: Current thread
(0x103339cb0) is not the object’s thread (0x10a848670). Cannot move to
target thread (0x103339cb0)

On Mac OS X, you might be loading two sets of Qt binaries into the
same process. Check that all plugins are compiled against the right Qt
binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of
binaries are being loaded.

Do you have any ideas?

Thanks for your help!

EDIT:

If I skip the icons there is no problem. I have also tried going

QListWidgetItem *item = new QListWidgetItem(act_filename);
ui->listWidget->addItem(item);
item->setIcon(QIcon(act_fullname));

and got no difference.

EDIT 2:

I do not call QObject::moveToThread(QThread*) I don’t even use threads (deliberately at least).

Also, the errors appear to come after the loop. I have cout-ed every iteration and the end of the loop and right after my “end loop cout msg” I see that

objc[56963]: Class QCocoaColorPanelDelegate is implemented in both
/Users/Barnabas/QtSDK/Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Versions/4/QtGui
and
/Users/Barnabas/Programming/Qt/demo_OpenCV-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Release/demo_OpenCV.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui.
One of the two will be used. Which one is undefined.

Here, too, I do not use QCocoaColorPanelDelegate. I don’t even know what it is … 🙁

But here is my more detailed code:

boost::filesystem::path p("/path/to/dir");
if(boost::filesystem::is_directory(p))
{
    for(boost::filesystem::directory_iterator it(p); it!=boost::filesystem::directory_iterator(); ++it)
    {
        if(it->path().extension().string()==".png")
        {
            std::cout<< it->path() <<std::endl;
            QString item_name( it->path.stem().c_str() );
            QString screen_file( it->path.c_str() );
            QListWidgetItem *item = new QListWidgetItem(item_name);
            QIcon *icon = new QIcon(screen_file);
            item->setIcon(*icon); // if I comment this one out, everything is fine.
            ui->imageList->addItem(item);
        }
    }
}

I have also tested it with a single .png and the image was displayed properly in the list but crash followed with the very same messages.

  • 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-13T03:15:28+00:00Added an answer on June 13, 2026 at 3:15 am

    I have finally found the solution: manually removed the Debug and the Release directories.
    For those whose similar problem is not solved by this see: this link.

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

Sidebar

Related Questions

building a site using PHP and MySQL that needs to store a lot of
Building a website that has English & Japanese speaking users, with the Japanese users
Building an iPhone OS application that will allow users to anonymously post information to
Building a commercial product may use various open source libraries that have use of
Building my first WP theme and I quickly realized that I need to remove
Building a rails B2B application that will have various users. I'm pretty clear on
Building a stand alone WPF application that uses a MSSQL backend. I would like
Building my iOS App in Xcode 4.5 results in Dependency Analysis Warnings for every
Building an app with the Facebook JavaScript API that will embedded into a page
Building an app using a calendar on a Google Apps domain that has SSL

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.