Skip to main content

Thread: Qt - How to close a window?


hey!

have problem can't figure out..any great

i'm beginner @ qt , i'm trying figure out i'm getting error

gui should function such on specific button press new window pops , old 1 shuts...
got new window pop , stuff , works fine..but can't figure out how close old one... pointers??

code:
#include <qtgui>  #include "guistart.h" //#include "addcluster.h"  // if include <qtgui> there no need include every class used: <qstring>, <qfiledialog>,...   guistart::guistart(qmainwindow *parent) {     setupui(this); // sets gui      // signals/slots mechanism in action     connect( nextbutton, signal( clicked() ), this, slot( addclusterwindow() ) );   }     void guistart::addclusterwindow() {     addcluster *window = new addcluster();     window->show();     this.close(); }
all windows qmainwindow .

above code gives me error
code:
guistart.cpp: in member function ‘void guistart::addclusterwindow()’: guistart.cpp:20:7: error: request member ‘close’ in ‘this’, of non-class type ‘guistart* const’
i know there's problem this.close()

great guys!! thanks!

i don't know lot qt, maybe
this->close(); ?


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Qt - How to close a window?


Ubuntu

Comments