Quote Originally Posted by probine View Post
To create a window we can do:

QWidget window;

Can we also do:
This:
QWidget window = new QWindow;
is wrong. With new keyword you have to use a pointer type:
Qt Code:
  1. QWidget *window = new QWidget;
To copy to clipboard, switch view to plain text mode 

How can we create a window without the NEW keyword?
Normally, like any other objects.
What type of class is it?
hmm it depends what type of object you make:
Qt Code:
  1. int a; // this is int
  2. QWidget w; // this is QWidget
  3. QListView lv; //this is QListView
To copy to clipboard, switch view to plain text mode 

Generally, widgets should be created on a heap (so with new keyword) but in main() function it is good to create main widget on stack so it will be deleted when going out of scope which is when your application exit.