Results 1 to 6 of 6

Thread: QCoreApplication... In a library.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QCoreApplication... In a library.

    Ok in other words: is it possible to get a QCoreApplication object from the "already running" application, which already have a message loop? Is there some way for example to do:
    Qt Code:
    1. QCoreApplication *runningApp = QCoreApplication::fromThread(QThread::currentThread());
    To copy to clipboard, switch view to plain text mode 
    ?

  2. #2
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QCoreApplication... In a library.

    i've read a bit about the processEvent method of a QApplication... But i hardly can find how can this help me.
    If want to use processEvent, it means it will be called from a function of my DLL, after the Windev application calls it... Which means, i still have no way to poll the device events when the Windev application has control (When the program from my DLL is not running at all, not called, or returned already).
    Also, i'd like to be able to use slots and signal functionality, that's kinda why i choose Qt over the so horrible Win32 API.

    Still looking for an answer.
    Thanks guys,
    Me.

  3. #3
    Join Date
    Jan 2010
    Location
    Ankara - TURKEY
    Posts
    30
    Thanks
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QCoreApplication... In a library.

    Hi hickscorp;

    I have same problem as you have. I have a main MFC application and QT dll which has internal QApplication. When I load qt dll as you expect I have to initialize QApplication and exec it. When I exec qapplication in my dll function, execition flow stops there and never return to my called place to follow other operation in my main MFC application. I can't find any way to solve this wierd problem. You can see my problem from attached image.

    is there anyone who knows how to create Qt Dll library with QApplication but when it loaded it can initialize QApplication and exec it instead of expilicitly exported dll function calling from main application. For example MFC dlls can do this operation and when dll loaded it can create own eventloop implicitly so we have not to call another function to initialize any eventloop.

    Please help me. I have to solve this problem as fast as I can.

    Regards.
    Attached Images Attached Images

Similar Threads

  1. QLocalServer without QCoreApplication ?
    By Raistlin in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2008, 22:44
  2. QCoreApplication
    By Morea in forum Qt Programming
    Replies: 5
    Last Post: 4th June 2007, 19:58
  3. Use of QCoreApplication
    By moowy in forum Qt Programming
    Replies: 8
    Last Post: 18th May 2007, 08:33
  4. QCoreApplication!!!!
    By fellobo in forum Qt Programming
    Replies: 6
    Last Post: 17th January 2007, 00:56
  5. QCoreApplication problem
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2006, 20:18

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.