[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");
    
    //REFERENCE FOR SIGNAL AND SLOT CREATION
    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
    layout->addWidget(button);
    layout->addWidget(OpenGLFrame);
    
    layout->addWidget(OpenGLSelector);
    layout->addWidget(ModelCollector);
    //Setting Layout
     MainFrame->setLayout(layout);
    
    //Showing Buttons,etc
    
    MainFrame->show();
    //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].
    Thanks.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.