Results 1 to 10 of 10

Thread: Error in Qt creator?

  1. #1
    Join Date
    Jan 2009
    Posts
    51
    Thanks
    28
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Error in Qt creator?

    I have an project opened in Qt creator and I'd like to add new window to it.
    I choose File->New->Qt Designer Form Class->Widget and I even don't change anything, but when I try to compile I've got such an error:
    /home/mac/C++/scan/window2.cpp:6: error: invalid use of incomplete type 'struct Ui::Window2'
    To solve this problem it's needed to manualy open ui_window2.h file, and replace this fragment:
    Qt Code:
    1. namespace Ui {
    2. class Form: public Ui_Form {};
    3. } // namespace Ui
    To copy to clipboard, switch view to plain text mode 
    by this:
    Qt Code:
    1. namespace Ui {
    2. class Window2: public Ui_Form {};
    3. } // namespace Ui
    To copy to clipboard, switch view to plain text mode 
    After that generally everything works fine, but everytime I change anything on my form in designer, Creator generates this wrong fragment and I cannot to compile the code.
    Is it an error (I'm using candidate release), or I'm doing something wrong?

  2. #2
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error in Qt creator?

    I don't have any problems...

    Did you edit the object name in the Form Editor? Find the top-most widget and change it's object name to Window2.

  3. The following 2 users say thank you to codeslicer for this useful post:

    Macok (14th February 2009), theshadowx (1st February 2013)

  4. #3
    Join Date
    Feb 2009
    Location
    Italy
    Posts
    15
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error in Qt creator?

    Hi,

    I have an project opened in Qt creator and I'd like to add new window to it.
    I choose File->New->Qt Designer Form Class->Widget and I even don't change anything, but when I try to compile I've got such an error:
    It's normal, into Class Information dialog you have to change the Class Name field with another name you like, use Example1 etc.

    Have a nice Day,
    Giuseppe Bonfa'
    Happiness depends on being self-sufficient, and a master of mental attitude, self-sufficiency is achieved by living a life of Virtue - Cynics

  5. The following user says thank you to GiuseppeBonfa for this useful post:

    Macok (14th February 2009)

  6. #4
    Join Date
    Jan 2009
    Posts
    51
    Thanks
    28
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Error in Qt creator?

    Thanks a lot!

  7. #5
    Join Date
    Sep 2010
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Error in Qt creator?

    I have the same problem with it.
    In my source code, I wrote it as:
    namespace Ui {
    class Dialog;
    }
    /*in dialog.h*/
    and used is in dialog.cpp as
    Dialog:ialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui:ialog),
    m_camera(new CameraDevice(this))
    {
    //ui = new Ui:ialog;
    //m_camera = new CameraDevice(this);
    ui->setupUi(this);

    connect(m_camera, SIGNAL(imageReady(QImage)), this, SLOT(onImageArrival(QImage)));
    connect(ui->startButton, SIGNAL(clicked()), m_camera, SLOT(start()));
    connect(ui->stopButton, SIGNAL(clicked()), m_camera, SLOT(stop()));
    }

  8. #6
    Join Date
    Sep 2010
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Error in Qt creator?

    them it remained me
    /root/QtProject/camera-build-desktop/../camera/dialog.cpp:8: error: invalid use of incomplete type ‘struct Ui:ialog’
    /root/QtProject/camera-build-desktop/../camera/dialog.h:9: error: forward declaration of ‘struct Ui:ialog’
    anyone help?

  9. #7
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: Error in Qt creator?

    Add
    Qt Code:
    1. #include "ui_dialog.h"
    To copy to clipboard, switch view to plain text mode 
    in your dialog.cpp

  10. #8
    Join Date
    Oct 2013
    Posts
    1
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: Error in Qt creator?

    I am trying to create a calculator in qt . It is showing the following error :- "invalid use of incomplete type struct ui::calculator"

    i have attached my files .. plz try to run them and reply as soon as possible.
    Attached Files Attached Files

  11. #9
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error in Qt creator?

    Had you created the project using Qt creator ?
    Or you wrote your own .ui file ?

  12. #10
    Join Date
    Nov 2013
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    MacOS X

    Default Re: Error in Qt creator?

    Its a good thread!

Similar Threads

  1. Qt Creator 0.9.1 - progrma build error
    By fb2007 in forum Installation and Deployment
    Replies: 5
    Last Post: 18th October 2009, 16:02
  2. Qt Creator: The process could not be started!
    By AlphaWolf in forum Qt Programming
    Replies: 5
    Last Post: 24th September 2009, 03:31
  3. Qt Creator
    By const in forum Qt Tools
    Replies: 26
    Last Post: 16th February 2009, 22:10
  4. Qt Creator and QGridLayout
    By babu198649 in forum Qt Tools
    Replies: 1
    Last Post: 16th January 2009, 17:56
  5. Replies: 2
    Last Post: 11th July 2006, 14:19

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.