Results 1 to 2 of 2

Thread: Pointer to MainWindow

  1. #1
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Pointer to MainWindow

    Hey,

    in "MainWindow.h" I have built a
    class MainWindow : public QMainWindow, protected Ui_MainWindow
    as commonly done.

    in "main.cxx" I set up the mainWindow:
    MainWindow *mainWindow = new MainWindow;

    in "test.cxx" I want to create a pointer of type MainWindow.
    So i include "MainWindow.h"

    But when I write
    MainWindow * test;

    I get the following compiler error:
    error C2143: syntax error : missing ';' before '*'
    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    error C2061: syntax error : identifier 'MainWindow'´

    What's going wrong?
    I just want to create a pointer of the previously defined class MainWindow...

    Cheers / Thomas

  2. #2
    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: Pointer to MainWindow

    You must have missed the semi-colon at the end of some class
    Qt Code:
    1. class SomeClass
    2. {
    3. }; // Missed that ';' ???
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. this pointer
    By freekill in forum Newbie
    Replies: 10
    Last Post: 30th January 2010, 01:17
  2. Pointer to Pointer
    By ^NyAw^ in forum General Programming
    Replies: 5
    Last Post: 25th April 2009, 08:00
  3. MainWindow
    By amagdy.ibrahim in forum Newbie
    Replies: 6
    Last Post: 14th June 2008, 14:12
  4. Mainwindow qprocesss
    By zorro68 in forum Qt Programming
    Replies: 4
    Last Post: 29th November 2007, 13:14
  5. pointer
    By mickey in forum General Programming
    Replies: 4
    Last Post: 1st September 2006, 00:42

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.