[Solved]Qt Primary Expression error?

  • okay im a good problem solver being able to migrate code from old samples into recent day coding but this one has gotten me this one is a c++ error which i know but i just dont get it

    heres my error line ignore the comments iv been moving code around also i beilive the problem has something to do with :: from my experience of what a primary expression is used
    int main (int argc, char *argv[])
    //QApplication setup
    QApplication app(argc, argv);
    //QLabel Creation or Constructor in C++ Terms

    //QPushButton Creation or Constructor in C++ Terms
    QPushButton *button = new QPushButton("Quit");
    QObject::connect(button, SIGNAL(clicked()), &app;, SLOT(quit()));
    // Creating The Main Window
    QWidget *MainFrame = new QWidget;
    QWidget *OpenGLFrame = new QWidget;
    // Window Title
    MainFrame->setWindowTitle("Fun 3D Engine");
    //Sets Up The Layout and Creates a Name Define to be used anywhere
    QHBoxLayout *layout = new QHBoxLayout;
    QWidget *Tab1 = new QWidget;
    QTabWidget *OpenGLSelector = new QTabWidget;
    QTabWidget *ModelCollector = new QTabWidget;
    QTabWidget::addTab ( QWidget * Tab1, const QString & label );
    // add everything to the layout QHBoxLayout down below
    //Setting Layout
    //Showing Buttons,etc
    //Allows The Application To Be Sent To QT For Turning off The Application
    return app.exec();


    Error log
    error: expected primary-expression before '*' token
    error: expected primary-expression before 'const'

    errors are on line 22

  • Please edit the title of the thread and change QT to Qt

  • Sorry but what you are trying to achieve using this line #22?
    Maybe you wanted to write something like this?
    OpenGLSelector->addTab(Tab1, "some label here");

  • YOU ARE THE MOST AMAZING MAN ON THIS PLANET!! :D Thanks Denis seriously lol what a pile of garbage code sample i was using for reference on that perticular part

  • Please mark your post as [SOLVED].

Log in to reply