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. Qt for beginners tutorial problem
Forum Updated to NodeBB v4.3 + New Features

Qt for beginners tutorial problem

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 831 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.
  • M Offline
    M Offline
    mr_kazoodle
    wrote on last edited by
    #1

    Hi,

    I'm currently trying out the tutorial, but I can't seem to compile this piece of code and I have no idea why. The error I'm getting is: "expected ',' before 'button2'", can someone help me out?

    @ #include <QApplication>
    #include <QPushButton>

    int main(int argc, char **argv)
    {
        QApplication app (argc, argv);
     
        QPushButton button1 ("test");
        new QPushButton button2 ("other", &button1);
     
        button1.show();
     
        return app.exec&#40;&#41;;
    }
    

    @

    I'm running the latest Ubuntu with Qt5
    Tutorial: "http://qt-project.org/wiki/Qt_for_beginners_pretty_button":http://qt-project.org/wiki/Qt_for_beginners_pretty_button

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

      Hi mr_kazoodle
      Try removing "new" on line 9.
      I test it on Windows and Qt5.0.1
      Regards

      www.ftatv.com.ar El foro argentino de la TV libre

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mr_kazoodle
        wrote on last edited by
        #3

        [quote author="SergioDanielG" date="1369345825"]Hi mr_kazoodle
        Try removing "new" on line 9.
        I test it on Windows and Qt5.0.1
        Regards[/quote]

        worked! 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