Results 1 to 14 of 14

Thread: no appropriate default constructor available

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: no appropriate default constructor available

    What about the part you cut out? Is there a constructor for the class?
    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.


  2. #2
    Join Date
    Jul 2010
    Posts
    10
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: no appropriate default constructor available

    no there is no constructor.
    should not qt be portable. as i have seen one must change his code to get it compiled in win (in my case). i have solved another problem, witch i didn't have in linux.
    Last edited by yazan; 19th June 2011 at 20:26. Reason: updated contents

  3. #3
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: no appropriate default constructor available

    How is the member variable ui declared ? You have some kind of forward declaration? Can you post the content of graphform.h ?

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: no appropriate default constructor available

    Are you using the same version of Qt/Creator on both systems?

    Are you attempting to use automatically generated files created on Linux under Windows?

    Have you done a complete 'make clean' of your project and regenerated everything from scratch?

    Are you sure this code compiled under Linux? 'cause it doesn't look like it should; there's no constructor corresponding to the object you're trying to construct in the initialization routine.

    To answer the question you've repeated several times now: yes, Qt code is, for the most part, portable without change between Linux and Windows. The only exceptions are sections of code that are clearly platform-dependent such as calls to Windows or Linux OS routines or similar resources. I've ported several large programs between the two systems and have never once had to rewrite code.
    Last edited by SixDegrees; 19th June 2011 at 20:47.

  5. #5
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: no appropriate default constructor available

    But I think there is a default, auto-generated no-argument constructor like for any other C++ class without other constructors, so new Ui::graphForm should be ok.
    I agree with SixDegrees, you should rebuild everything from scratch.

Similar Threads

  1. Help with QSettings default constructor
    By Polnareff in forum Qt Programming
    Replies: 1
    Last Post: 1st October 2010, 18:27
  2. QtScript: default constructor question
    By QPlace in forum Qt Programming
    Replies: 1
    Last Post: 22nd October 2009, 19:36
  3. Replies: 6
    Last Post: 8th July 2009, 20:28
  4. Q3Frame : no appropraite default constructor available
    By Project25 in forum Qt Programming
    Replies: 1
    Last Post: 27th March 2007, 23:23
  5. What default constructor?
    By bitChanger in forum General Programming
    Replies: 5
    Last Post: 15th February 2006, 19:50

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.