Results 1 to 12 of 12

Thread: First Program - expected class-name before '{' token

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Join Date
    Jan 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: First Program - expected class-name before '{' token

    Agreed! I thought I could wing it but it is obvious that I need more references....Any suggestions on a good C++ book?


    Added after 48 minutes:


    Okay, after beating myself for being so dense, I finally saw the light and got this to work. While I am researching the best means of learning C++ I just have one more question. When this code runs, my second form "signon" paints first and only after that form is closed will my MainWindow paint. This form is modal to the MainWindow. How would I get the MainWindow to load first and the signon form to load on top?

    MainWindow.cpp:
    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3. #include "signon.h"
    4.  
    5.  
    6. MainWindow::MainWindow(QWidget *parent): QMainWindow(parent),ui(new Ui::MainWindow)
    7. {
    8. ui->setupUi(this);
    9. ui->tableWidget->hide();
    10. openSignon();
    11. }
    12.  
    13. MainWindow::~MainWindow()
    14. {
    15. delete ui;
    16. }
    17.  
    18.  
    19. void MainWindow::openSignon(){
    20. Signon signon(this);
    21. signon.exec();
    22. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by tnowacoski; 31st January 2011 at 17:53.

Similar Threads

  1. QThread expected class name before { token
    By naturalpsychic in forum Qt Programming
    Replies: 0
    Last Post: 24th January 2011, 03:42
  2. Expected class-name before '{' token
    By imagiro1 in forum Newbie
    Replies: 16
    Last Post: 16th June 2009, 11:37
  3. error: expected class-name before '{' token
    By Aresti in forum Qt Programming
    Replies: 1
    Last Post: 12th November 2008, 20:00
  4. Replies: 3
    Last Post: 10th November 2008, 16:14
  5. Replies: 2
    Last Post: 30th January 2008, 20: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.