[Solved]Why my defined QAction has no response?
-
Ya sure
The following is the main.cpp file@
#include <qapplication.h>
#include "mainform.h"int main( int argc, char ** argv )
{
QApplication a( argc, argv );
mainForm w;
w.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}
@
The following code is somewhere in the mainform.cpp file@
void mainForm::setupLanguageActions()
{Q3ToolBar *tb = new Q3ToolBar( this ); tb->setLabel( "Language Actions" ); Q3PopupMenu *menu = new Q3PopupMenu( this ); menuBar()->insertItem( tr( "&Language" ), menu ); Q3Action *a; a = new Q3Action( tr( "Tamil" ), tr( "&Tamil" ), Qt::CTRL + Qt::Key_Z, this, "langtamil" ); connect( a, SIGNAL( activated() ), this, SLOT( ChangeLangTamil() ) ); a->addTo( tb ); a->addTo( menu ); a = new Q3Action( tr( "Hindi" ), tr( "&Hindi" ), Qt::CTRL + Qt::Key_Y, this, "langhindi" ); connect( a, SIGNAL( activated() ), this, SLOT( ChangeLangHindi() ) ); a->addTo( tb ); a->addTo( menu );
}
@
And also for more actions.. -
[quote author="gayu" date="1353403125"]Might what the question i'm asking is silly, but please tell me
Whether Qt4 support QAction[/quote]Ofcourse Qt4 support QAction ,you can have a look in "Porting to Qt 4":http://qt-project.org/doc/qt-4.8/porting4.html#qaction and "QAction":http://qt-project.org/doc/qt-4.8/qaction.html class.
But why are you still working in Qt 3 ?