Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]Qt Primary Expression error?
Forum Updated to NodeBB v4.3 + New Features

[Solved]Qt Primary Expression error?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 6.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    theblizzfreak
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sfilippidis
      wrote on last edited by
      #2

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

      https://www.filippidis.name/

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DenisKormalev
        wrote on last edited by
        #3

        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");
        @

        1 Reply Last reply
        0
        • T Offline
          T Offline
          theblizzfreak
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rokemoon
            wrote on last edited by
            #5

            Please mark your post as [SOLVED].
            Thanks.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved