Dear my friends...
I want to lauch a form as child form (kontenForm) in
an MDI form (named depanForm) which chosen from the
mainmenu.
I made the Slot to launch the child form but I still
get this error message:
"
depanForm::helpContents(): Not implemented yet
".
Please tell me, where is the mistake.
Thank you very much in advance.
===
//depanform.h
#ifndef DEPANFORM_H
#define DEPANFORM_H
#include
#include
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QAction;
class QActionGroup;
class QToolBar;
class QPopupMenu;
class QWorkspace;
class depanForm : public QMainWindow
{
Q_OBJECT
public:
depanForm( QWidget* parent = 0, const char* name =
0, WFlags fl = WType_TopLevel );
~depanForm();
QMenuBar *menubar;
QPopupMenu *helpMenu;
QToolBar *toolBar;
QAction* helpContentsAction;
QAction* helpIndexAction;
QAction* helpAboutAction;
public slots:
virtual void helpAbout();
depanForm * helpContents();
depanForm * helpIndex();
protected:
protected slots:
virtual void languageChange();
private slots:
private:
QWorkspace * workspace;
};
#endif // DEPANFORM_H
=========
//depanform.cpp
#include "depanform.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "kontenform.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 )
{
workspace = new QWorkspace();
setCentralWidget(workspace);
(void)statusBar();
if ( !name )
setName( "depanForm" );
// actions
helpContentsAction = new QAction( this,
"helpContentsAction" );
helpIndexAction = new QAction( this,
"helpIndexAction" );
helpAboutAction = new QAction( this,
"helpAboutAction" );
// toolbars
toolBar = new QToolBar( "", this, DockTop );
helpContentsAction->addTo( toolBar );
helpIndexAction->addTo( toolBar );
helpAboutAction->addTo( toolBar );
// menubar
menubar = new QMenuBar( this, "menubar" );
helpMenu = new QPopupMenu( this );
helpContentsAction->addTo( helpMenu );
helpIndexAction->addTo( helpMenu );
helpMenu->insertSeparator();
helpAboutAction->addTo( helpMenu );
menubar->insertItem( "", helpMenu, 0 );
languageChange();
resize( QSize(600,
480).expandedTo(minimumSizeHint()) );
// signals and slots connections
connect( helpIndexAction, SIGNAL( activated() ),
this, SLOT( helpIndex() ) );
connect( helpContentsAction, SIGNAL( activated()
), this, SLOT( helpContents() ) );
connect( helpAboutAction, SIGNAL( activated() ),
this, SLOT( helpAbout() ) );
}
/*
* 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( "Kundenverwaltung - Programmierer
: Patrix Linux" ) );
helpContentsAction->setText( tr( "Contents" ) );
helpContentsAction->setMenuText( tr(
"&Contents..." ) );
helpContentsAction->setAccel( QString::null );
helpIndexAction->setText( tr( "Index" ) );
helpIndexAction->setMenuText( tr( "&Index..." ) );
helpIndexAction->setAccel( QString::null );
helpAboutAction->setText( tr( "About" ) );
helpAboutAction->setMenuText( tr( "&About" ) );
helpAboutAction->setAccel( QString::null );
toolBar->setLabel( tr( "Tools" ) );
menubar->findItem( 0 )->setText( tr( "&Help" ) );
}
kontenForm * depanform::helpIndex()
{
kontenForm * kf = new kontenForm(workspace, 0,
WDestructiveClose);
kf->show();
}
void depanForm::helpContents()
{
kontenForm * kf = new kontenForm(workspace);
kf->show();
}
void depanForm::helpAbout()
{
}
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail