Need help... confused a bit with Qt Creator



  • Hi all .. I m new to Qt 4.7 programming using Qt Creator .. Have some questions :

    1. Whats the basic difference between Qt Quick Application / UI and Qt Widget based app (Qt Gui application) in terms of programming style and convensions ? The main difference I see it Quick App uses QML for GUI design while Qt Widget based app uses UI forms to design GUI using Drag and drop .. after this is a bit confusing for me.

    2. Can some 1 explain me this code :
      @class MainWindow : public QMainWindow
      {
      Q_OBJECT

    public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    private:
    Ui::MainWindow *ui;
    };@

    especially Q_OBJECT and @explicit MainWindow (QWidget *parent = 0);@

    1. And this code :
      @
      MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
      {
      ui->setupUi(this);
      }

    MainWindow::~MainWindow()
    {
    delete ui;
    }
    @

    1. If I want to program the same using Qt Quick what will the difference in code style ?

    -Regards ,
    Umang G (Power_user_EX)


  • Moderators

    Qt creator is an IDE (Integrated Development Environment) which helps you developing your applications.

    The sections, you are showing, are C++ source code presumably generated by the Qt creator based it templates.

    Q_OBJECT is required for the "Meta Object Compiler ":http://developer.qt.nokia.com/doc/qt-4.8/moc.html

    The "explicit statement is explained here":http://www.glenmccl.com/tip_023.htm for example.

    All see there is basic C++ code. It is recommended to have sufficient knowledge of C++ for using it with Qt. You might want to look for a C++ tutorial first, if you are lacking this knowledge. "One option for a tutorial.":http://www.cplusplus.com/doc/tutorial/ Please consult google search for others.


Log in to reply
 

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