Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Qt 5.2 built with Glib support under OS X - event loop doesn't work
Forum Updated to NodeBB v4.3 + New Features

Qt 5.2 built with Glib support under OS X - event loop doesn't work

Scheduled Pinned Locked Moved 3rd Party Software
1 Posts 1 Posters 1.1k Views 2 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.
  • T Offline
    T Offline
    tallica
    wrote on 24 Apr 2014, 15:59 last edited by
    #1

    Hi,

    I have built Qt 5.2.1 with Glib support under OS X 10.9. Here's a test code:

    @
    #include <iostream>
    #include <glib.h>
    #include <QApplication>

    using namespace std;

    static QApplication * qapp;

    static int idle (void)
    {
    cout << "Idle callback called" << endl;
    cout << "Quitting QApplication" << endl;

    qapp->quit ();
    
    return G_SOURCE_REMOVE;
    

    }

    int main (void)
    {
    cout << "Creating QApplication" << endl;

    int dummy_argc = 0;
    qapp = new QApplication (dummy_argc, 0);
    
    cout << "Adding idle callback" << endl;
    
    g_idle_add ((GSourceFunc) idle, 0);
    
    cout << "Starting QApplication" << endl;
    
    qapp->exec (&#41;;
    
    cout << "QApplication finished" << endl;
    cout << "Cleaning up" << endl;
    
    delete qapp;
    qapp = 0;
    
    cout << "All done" << endl;
    
    return 0;
    

    }
    @

    This code works perfectly under Linux, callback is being called. Unfortunately, it doesn't work under OS X... unless you replace QApplication with QCoreApplication, then it works... I want to build a UI interface, so I have to use QApplication. Any idea why it doesn't work as expected?

    Best regards,
    MichaƂ

    EDIT:

    Same problem with Qt 5.3.0.

    1 Reply Last reply
    0

    1/1

    24 Apr 2014, 15:59

    • Login

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