Re: loading a form in an MDI Form (beginner).
Dear Veronica... I want to launch a form as a child form which chosen with the mainmenu of my mainwindow (depanform is the MDI form). Here the error message and my code. Please teach me... I am a very new beginner. === patrixlinux@patrix:~/arsip/proyek/qt/6> make g++ -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -fPIC -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/include -I/usr/lib/qt3/include -o depanform.o depanform.cpp In file included from depanform.cpp:23: depanform.ui.h: In member function `virtual void depanForm::shownewcustomerformSlot()': depanform.ui.h:13: error: syntax error before `->' token make: *** [depanform.o] Error 1 patrixlinux@patrix:~/arsip/proyek/qt/6> === patrixlinux@patrix:~/arsip/proyek/qt/6> ls 6.pro depanform.ui images moc_depanform.o Makefile depanform.ui.h main.cpp newcustomerform.h depanform.cpp depanform.ui.h~ main.o newcustomerform.ui depanform.h depanform.ui~ moc_depanform.cpp patrixlinux@patrix:~/arsip/proyek/qt/6> cat depanform.ui.h /**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use ** Qt Designer which will update this file, preserving your code. Create an ** init() function in place of a constructor, and a destroy() function in ** place of a destructor. *****************************************************************************/ #include "newcustomerform.h" void depanForm::shownewcustomerformSlot() { newcustomerForm->show(); } patrixlinux@patrix:~/arsip/proyek/qt/6> cat depanform.cpp /**************************************************************************** ** Form implementation generated from reading ui file 'depanform.ui' ** ** Created: Tue Jun 22 17:03:52 2004 ** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.1 edited Nov 24 13:47 $) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "depanform.h" #include <qvariant.h> #include <qlayout.h> #include <qtooltip.h> #include <qwhatsthis.h> #include <qaction.h> #include <qmenubar.h> #include <qpopupmenu.h> #include <qtoolbar.h> #include <qimage.h> #include <qpixmap.h> #include "depanform.ui.h" /* * Constructs a depanForm as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ depanForm::depanForm( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { (void)statusBar(); if ( !name ) setName( "depanForm" ); // actions menuNew_CustomerAction = new QAction( this, "menuNew_CustomerAction" ); // toolbars // menubar MenuBarEditor = new QMenuBar( this, "MenuBarEditor" ); Customer = new QPopupMenu( this ); menuNew_CustomerAction->addTo( Customer ); MenuBarEditor->insertItem( QString(""), Customer, 1 ); languageChange(); resize( QSize(600, 480).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( menuNew_CustomerAction, SIGNAL( activated() ), this, SLOT( shownewcustomerformSlot() ) ); } /* * Destroys the object and frees any allocated resources */ depanForm::~depanForm() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void depanForm::languageChange() { setCaption( tr( "Form Utama" ) ); menuNew_CustomerAction->setText( tr( "New Customer" ) ); menuNew_CustomerAction->setMenuText( tr( "New Customer" ) ); if (MenuBarEditor->findItem(1)) MenuBarEditor->findItem(1)->setText( tr( "Customer" ) ); } patrixlinux@patrix:~/arsip/proyek/qt/6> cat depanform.h /**************************************************************************** ** Form interface generated from reading ui file 'depanform.ui' ** ** Created: Tue Jun 22 17:03:45 2004 ** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.1 edited Nov 24 13:47 $) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #ifndef DEPANFORM_H #define DEPANFORM_H #include <qvariant.h> #include <qmainwindow.h> class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QSpacerItem; class QAction; class QActionGroup; class QToolBar; class QPopupMenu; class depanForm : public QMainWindow { Q_OBJECT public: depanForm( QWidget* parent = 0, const char* name = 0, WFlags fl = WType_TopLevel ); ~depanForm(); QMenuBar *MenuBarEditor; QPopupMenu *Customer; QAction* menuNew_CustomerAction; public slots: virtual void shownewcustomerformSlot(); protected: protected slots: virtual void languageChange(); }; #endif // DEPANFORM_H patrixlinux@patrix:~/arsip/proyek/qt/6> cat main.cpp #include <qapplication.h> #include "depanform.h" int main( int argc, char ** argv ) { QApplication a( argc, argv ); depanForm w; w.show(); a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); return a.exec(); } patrixlinux@patrix:~/arsip/proyek/qt/6> cat newcustomerform.h /**************************************************************************** ** Form interface generated from reading ui file 'newcustomerform.ui' ** ** Created: Tue Jun 22 17:03:46 2004 ** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.1 edited Nov 24 13:47 $) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #ifndef NEWCUSTOMERFORM_H #define NEWCUSTOMERFORM_H #include <qvariant.h> #include <qdialog.h> class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QSpacerItem; class newcustomerForm : public QDialog { Q_OBJECT public: newcustomerForm( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~newcustomerForm(); protected: protected slots: virtual void languageChange(); }; #endif // NEWCUSTOMERFORM_H patrixlinux@patrix:~/arsip/proyek/qt/6> === --- veronique.lefrere@c-s.fr wrote:
please, send peace of code if you want some answer. just some error message is not easy to investigate
__________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail
participants (1)
-
Prabu Subroto