***************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <Qt>
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QAction>
#include <QKeySequence>
#include <QString>
#include<QShortcut>
#include <QMessageBox>
#include <QApplication>
#include "MyMainWindow.h"
{
Q_CHECK_PTR( edit );
edit = menuBar()->addMenu(tr("&Feby _ Menu"));
undoId = edit->addAction("Action_undo ]", this , SLOT(undo()),Qt::CTRL+Qt::Key_Z);
disableUndo = edit->addAction("Disable_Undo",this,SLOT(disableundo()));
EnableUndo = edit->addAction("Enable_Undo",this,SLOT(enableUndo()) );
undoId->setEnabled(true);
}
void Chemedit::disableundo()
{
"To inform you that we are DISABLING the Chemedit::undo()" );
undoId->setEnabled(false);
}
void Chemedit::enableUndo()
{
"To inform you that we are ENABLING the Chemedit::undo()" );
undoId->setEnabled(true);
}
void Chemedit::undo()
{
QMessageBox::information( this ,
" In Chemedit",
"Chemedit::undo()" );
}
int main(int argc, char *argv[])
{
Chemedit mainWin;
mainWin.show();
return app.exec();
}
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <Qt>
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QAction>
#include <QKeySequence>
#include <QString>
#include<QShortcut>
#include <QMessageBox>
#include <QApplication>
#include "MyMainWindow.h"
Chemedit::Chemedit(QWidget *parent):QMainWindow( parent )
{
menubar=QMainWindow::menuBar ();
edit = new QMenu();
Q_CHECK_PTR( edit );
edit = menuBar()->addMenu(tr("&Feby _ Menu"));
undoId = edit->addAction("Action_undo ]", this , SLOT(undo()),Qt::CTRL+Qt::Key_Z);
disableUndo = edit->addAction("Disable_Undo",this,SLOT(disableundo()));
EnableUndo = edit->addAction("Enable_Undo",this,SLOT(enableUndo()) );
undoId->setEnabled(true);
}
void Chemedit::disableundo()
{
QMessageBox::information( this ," In Chemedit",
"To inform you that we are DISABLING the Chemedit::undo()" );
undoId->setEnabled(false);
}
void Chemedit::enableUndo()
{
QMessageBox::information( this ," In Chemedit",
"To inform you that we are ENABLING the Chemedit::undo()" );
undoId->setEnabled(true);
}
void Chemedit::undo()
{
QMessageBox::information( this ," In Chemedit", "Chemedit::undo()" );
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Chemedit mainWin;
mainWin.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks