Nothing to do with Qt. This is basic C/C++ knowledge. You must declare any variable before you can use it. You must initialise pointer variables before using them in anger.
Pointer variables, like your "frame" variable, must point at an instance of the object or attempting to use the object will be a Bad ThingTM. This is equally true of a pointer to a QPushButton, QFrame, CoolAndGroovyNonQtClass, or any other. You allocate an object on the heap using operator new, which returns a pointer to the object.
Bookmarks