Page 1 of 2 12 LastLast
Results 1 to 20 of 33

Thread: Lets Dialog with Qt

  1. #1
    qtoptus Guest

    Default Lets Dialog with Qt

    Hello,

    Is there a way that I can create a dialog application without using main() function? I want to call the dialog function from another application function instead that uses a different toolkit/framework. In other words I'm launching the dialog from within the same process of the main program.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Lets Dialog with Qt

    Yes. Libraries do not need a main() function. Just export a function that you will call from within the main program. Note however that an instance of QApplication needs to exist to use Qt widgets so either the main application will have to create it or you need to do that yourself in your library function.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    Great! So this implies a different process will be instantiated for the QApplication.

    Thanks.

  4. #4
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    I'm writing a plugin for Lightwave3D which uses Qt for GUI instead of the LW native GUI. However I get this when I start LW:

    msg.jpg

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Lets Dialog with Qt

    Most likely you have taken an incorrect version of Qt libraries (the ones for QtCreator instead of those for your apps) when deploying the plugin.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    I don't use QtCreator. I copied the Qt dlls: QtCore4.dll, QtGui4.dll, and QtOpenGL4.dll from Qt bins to the plugin directory. However when I compile as Debug, and use the debug dll versions I get another error complaining about the MSVCP100d.dll not found...This file does not even look installed in my system.
    My platform is Windows 7, VS 2008, and Qt 4.8.1 SDK.

  7. #7
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Lets Dialog with Qt

    you should take it as a hint that copy/pasting dlls all over the shop isn't the correct thing to do
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  8. #8
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    Nothing Qt code related as I'm not using it. just trying to get the plugin loaded properly first. I could upload the project but first I need a confirmation that someone who willing to test it has access to Lightwave 3D 9.6. Otherwise it's useless. The code I have is only LW SDK plugin initialization, nothing more.

    you should take it as a hint that copy/pasting dlls all over the shop isn't the correct thing to do
    Correct when the DLLs are installed in the proper system directory

    Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
    As I mentioned not much details. The problem is very clear, a third party application loading a dll that depends on Qt dlls is failing to load. Clearly something has to do with Qt DLLs. I will try statically link to the Qt libs instead.

  9. #9
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Lets Dialog with Qt

    That's my sig you are responding to, but thanks for reading
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  10. #10
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    LoL, sorry! I did not see that.

    Anyway I hope it's something I can solve on my end, cause working with LW GUI is a pain...

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Lets Dialog with Qt

    Quote Originally Posted by qtoptus View Post
    I copied the Qt dlls: QtCore4.dll, QtGui4.dll, and QtOpenGL4.dll from Qt bins to the plugin directory.
    What is the exact path to the files you copied?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. #12
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    Copied from C:\Qt\4.8.1\bin

  13. #13
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Lets Dialog with Qt

    I get another error complaining about the MSVCP100d.dll not found...This file does not even look installed in my system.
    This is the Microsoft Visual C 10 runtime debug version. It will be installed on any machine that has a recent enough Windows SDK/Visual Studio of some sort installed (I don't know if that is VS 2008 or 2010) as a SxS assembly and also redist file. If you are deploying your release application then you can use the redist package to ensure the release version of the runtime is present. You are not permitted to redistribute the debug library IIRC.

  14. #14
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    I could fix the problem, using a release build only, and a dialog based Qt application rather than a frame window. The plugin loads fine until I create the dialog instance, it crashes. I cannot debug the plugin since I cannot use a Debug version.

  15. #15
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    More details:

    extern "C" void plugin_starter(...)
    {
    //Qt-main-code copied here

    // Instantiate dialog class, CRASH!

    }

  16. #16
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    Finally this worked! I have the dialog shows within the main program and no problem. After I added a tabbed widget to the dialog, the plugin fails to load again. And I got this message:

    msg2.jpg

    I have the correct DLLs QtCore4.dll, QtGui4.dll QtOpenGL4.dll version 4.8.2 and all copied from Qt\4.8.2\bin\

    Any idea?

  17. #17
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    Any suggestions?

    I'm suspecting it's a problem with Qt build itself since the module is aware of the dependency DLL, QtGui4.dll, but it cannot link to the function, which means a different signature/name mangling...

    Should I build Qt from the source?

    Can I link to static version of Qt libs?

  18. #18
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Lets Dialog with Qt

    do you have qt built with the same compiler as your app?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  19. #19
    qtoptus Guest

    Default Re: Lets Dialog with Qt

    I installed the binary version 4.8.2 for the same compiler VS 2008.

  20. #20
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Lets Dialog with Qt

    how do you build your app, how do you link it with qt?

    you will not be able to statically link since you have not built static qt libraries.

    and you say you use sdk 4.8.1 earlier in the thread, but now you have installed 4.8.2 binaries? They should be compatible anyway, if built with same compiler.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 6
    Last Post: 18th January 2012, 20:21
  2. How to access objects of parent Dialog from Child Dialog .
    By ranjit.kadam in forum Qt Programming
    Replies: 4
    Last Post: 18th April 2011, 06:39
  3. closing child dialog closes parent dialog
    By sparticus_37 in forum Newbie
    Replies: 2
    Last Post: 28th May 2010, 19:46
  4. How to blur parent dialog when child dialog is displayed
    By abhilashajha in forum Qt Programming
    Replies: 4
    Last Post: 10th June 2009, 13:01
  5. Lets build a network
    By sunil.thaha in forum General Discussion
    Replies: 5
    Last Post: 16th April 2007, 07:42

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.