Results 1 to 3 of 3

Thread: Problem while creating a main window

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2013
    Location
    Hyderabad
    Posts
    52
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem while creating a main window

    I'm new to qt. well,I want to design a main window here I'm facing a problem with the following errors


    /home/stesalit/Desktop/tasks/mainmenu/main.cpp:7: error: ‘MainWindow’ was not declared in this scope
    /home/stesalit/Desktop/tasks/mainmenu/main.cpp:7: error: expected ‘;’ before ‘w’
    /home/stesalit/Desktop/tasks/mainmenu/main.cpp:8: error: ‘w’ was not declared in this scope


    Here are the screen shots of my files in attachments, can anyone please help me out in rectifying those errors ??
    Attached Images Attached Images

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem while creating a main window

    Because in main.cpp You don't include header file with MainWindow definition. I think that this is ui_mainwindow.h file.
    This is not Qt problem but basis of C++.

  3. The following user says thank you to Lesiok for this useful post:

    Harini (7th November 2013)

  4. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem while creating a main window

    The problem is that the class in mainwindow.h is called "Mainmenu", not "MainWindow"

    Given that it is called "MainWindow" in mainwindow.cpp, my suggestion would be to fix mainwindow.h

    Cheers,
    _

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

    Harini (7th November 2013)

Similar Threads

  1. Replies: 2
    Last Post: 29th June 2011, 15:24
  2. Main Window size problem
    By frenk_castle in forum Newbie
    Replies: 2
    Last Post: 20th December 2009, 11:49
  3. Creating a Main Window Application
    By gt.beta2 in forum Qt Tools
    Replies: 13
    Last Post: 24th February 2009, 20:45
  4. Problem with main window
    By M.A.M in forum Qt Programming
    Replies: 2
    Last Post: 2nd June 2008, 14:55
  5. Problem displaying my main window
    By Salazaar in forum Newbie
    Replies: 104
    Last Post: 16th January 2008, 15:01

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.