Results 1 to 7 of 7

Thread: How can build my dll using something like QtGui/Qwidget

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How can build my dll using something like QtGui/Qwidget

    I explain what I want.
    I have a superclass with 3 inner classes into it.
    ok, i'd want to write includes to use only one of these 3 inner classes
    I dont know how to do it.
    I'd want to write #include <MYCLASS/MYINNERCLASS1>
    But besides.... I have .h files, so I will not can to write :
    #include "MYCLASS/MYINNERCLASS1.h" becasue it does not exist.

    Any help ?
    Thanks

  2. #2
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How to build dll with a class who has inner clasess? How to use it ?

    I have my dll with a class that has 3 inner classes.
    At level code I can write SUPERCLASS::INNERCLASS.method
    (that is to said, QT Creator can understand my code)
    But, later it does not compile. I have undefined reference errors....

    undefined reference to `W_inpout::Ascii::Ascii()'
    undefined reference to `W_inpout::Ascii:penread(std::string)'
    etc (all the public methods of my class Ascii)

    My dll is builded correctly (I think... because there is no errors. )

    Any help ?
    Thanks

  3. #3
    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: How to build dll with a class who has inner clasess? How to use it ?

    What is the reason you have to define the other classes in the main class?
    It only makes sense if the inner classes are meant only for inner use - in which case you don't need it outside, the way you are using it.
    Put the classes outside, and export them as you did the main class.
    ==========================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.

  4. #4
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to build dll with a class who has inner clasess? How to use it ?

    I want to do this because my work is best organized to myself.
    It is clear that I could write 4 single classes, but in this way I forced myself to create the class instances properly
    (that is to say if I want to create a specific class from a especific theme for me is very suitable see me forced to write Myclass::my_interior_class.
    Maybe you can think that it is not neccesary but I'd want to try.
    Is there a solution?
    Thanks

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

    Default Re: How can build my dll using something like QtGui/Qwidget

    Quote Originally Posted by tonnot View Post
    I explain what I want.
    I have a superclass with 3 inner classes into it.
    ok, i'd want to write includes to use only one of these 3 inner classes
    I dont know how to do it.
    I'd want to write #include <MYCLASS/MYINNERCLASS1>
    But besides.... I have .h files, so I will not can to write :
    #include "MYCLASS/MYINNERCLASS1.h" becasue it does not exist.
    If you want to be able to write "#include <x/y.h>" then create directory "x" and put the file "y.h" in it.
    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
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can build my dll using something like QtGui/Qwidget

    Thanks wy.
    But how to do the same as QT, that is to say, without .h extension? It is only curiosity.

    And... (the two posts are merged) can you give me some help with "How to build dll with a class who has inner clasess" (the second post ..)
    Thanks and good week end.

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

    Default Re: How can build my dll using something like QtGui/Qwidget

    It is exactly the same. Just look at Qt source tree. It has a file named say... "QFile" which just says "#include <qfile.h>".

    I'm not going to answer the other question, I don't understand what your problem is. You are obviously missing some method implementation. This is strictly a C++ related question and I'm growing tired of telling you to learn C++ properly. If you don't understand some C++ concept then just don't use it. Sorry, it may be blunt but it is true.
    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.


Similar Threads

  1. OS X: linker not finding QtGui in framework...
    By rickbsgu in forum Qt Programming
    Replies: 4
    Last Post: 28th September 2010, 18:36
  2. QtBrowserPlugin without QtGui.dll?
    By anupamgee in forum Qt Programming
    Replies: 1
    Last Post: 13th August 2010, 15:52
  3. [QtGui] Problem with a QTextBrowser
    By Auliyaa in forum Qt Programming
    Replies: 2
    Last Post: 19th February 2010, 08:51
  4. Qt 4.3.3 - Server build without QtGui?
    By Mike in forum Installation and Deployment
    Replies: 7
    Last Post: 12th February 2008, 20:49
  5. using QtGui
    By nupul in forum Qt Programming
    Replies: 5
    Last Post: 7th April 2006, 13:36

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.