Results 1 to 13 of 13

Thread: What do I do wrong

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default

    wysote,

    I use vs2008 as compiler and Q_OBJECT is in the SMainWindow class definition.

    Thanks,

    I think it is about MOC ing , whatever it is. I need to do more readings.
    Thanks guys.

    Problem is solved. If you work with visual studio any class that is derived from a QT class has to be moced. then output of the moc operation should be added to cpp file of the derived class (not in header)
    how moc a header
    1) Add qt bin directory to your path
    2)Open cmd and cd to the location of the header
    3)moc header.h > header.cpp
    4)work on your new header.cpp
    Last edited by wysota; 20th October 2010 at 19:23.

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

    Default Re: What do I do wrong

    Quote Originally Posted by Arif Bilgin View Post
    If you work with visual studio any class that is derived from a QT class has to be moced.
    No, that's not true.

    how moc a header
    1) Add qt bin directory to your path
    2)Open cmd and cd to the location of the header
    3)moc header.h > header.cpp
    4)work on your new header.cpp
    Or run "qmake -project" and then "qmake -tp vc" when you start developing a project. Then Visual Studio will be mocing files for you by itself.
    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
    Join Date
    Oct 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What do I do wrong

    wysote,
    you are absolutely right !
    These are the steps to automate all mocing and .ui to .h conversion
    1-)Make sure QT Add in for Visual Studio is installed
    2-)Create a a qt project with qmake
    qmake -project
    qmake myproject.pro


    3-)Open Visual Studio | Click on QT menu | Open Qt Project File

    and you are all set , all mocings and uic ings are taken care automatically by QT add in.

    Beautiful!

Similar Threads

  1. i don't know what i do wrong..
    By Hardstyle in forum Newbie
    Replies: 2
    Last Post: 27th June 2010, 17:33
  2. what is wrong with my qt ?
    By lwb422 in forum Qt Programming
    Replies: 5
    Last Post: 12th April 2010, 14:07
  3. What's wrong??
    By dreamer in forum Qt Programming
    Replies: 2
    Last Post: 25th June 2008, 08:07
  4. What is wrong with this simple example ?
    By igor in forum Qt Programming
    Replies: 10
    Last Post: 16th January 2007, 11:26
  5. Help please - what am I doing wrong?
    By Jimmy2775 in forum Qt Programming
    Replies: 6
    Last Post: 6th March 2006, 22:06

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.