Results 1 to 5 of 5

Thread: QApplication as not "main object" ( window in dll )

  1. #1
    Join Date
    Apr 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QApplication as not "main object" ( window in dll )

    Hello.
    I write exe without gui.
    I want to write gui in dll as plugin.
    Exe -> "standard main" loop.
    If dll exist it load it -> show window etc.
    QApplication::exec can't be run on thread, so how i can do?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QApplication as not "main object" ( window in dll )

    Your application (main()) will have to have QApplication object.
    Implement your GUI in a DLL, not problem with that.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Apr 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QApplication as not "main object" ( window in dll )

    Not good. Application isn't Qt application and can't be.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QApplication as not "main object" ( window in dll )

    Well, then maybe you can put your non Qt application in a QThread launched by your Qt GUI when you do use the GUI, and run it normal when you don't use the GUI.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Apr 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QApplication as not "main object" ( window in dll )

    It is not as easy as i wanted ( my application is part of big application... many work ).
    But now i think to start qtapplication as a process from my application.

Similar Threads

  1. Replies: 6
    Last Post: 13th February 2014, 12:46
  2. Toolbars "out" of main window
    By jpujolf in forum Qt Programming
    Replies: 1
    Last Post: 3rd December 2009, 23:29
  3. Replies: 1
    Last Post: 8th January 2009, 13:36
  4. QSystemTrayIcon as "main window" design issue
    By nooky59 in forum Qt Programming
    Replies: 5
    Last Post: 17th July 2008, 13:15
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.