/** * int main() * * Descricao: * Funcao principal do programa que contem um loop (do-while) contendo a chamada * das funcoes que calculam as variaveis utilizadas pelo algoritmo Gauss-Legendre * a cada iteracao. * * Parametros de entrada: * - * * Parametros de retorno: * - * */ int main(){ /* Variaveis utilizadas para calcular o tempo de execucao do programa */ time_t begin, end; double time_spent; time(&begin); /* Inicialicazao das variaveis globais utilizadas no algoritmo */ initAttributes(); /* Loop principal que calcula o valor do "pi" */ do{ //printf("Iteracao: %ld\n", n_count); calculate_a(); calculate_b(); calculate_t(); calculate_p(); calculate_pi(); filePrint(); n_count++; } while(mpf_cmp(pi[n_count-2], pi[n_count-1])!=0); /* Condicao de parada: o "pi" recem calculado deve ser igual ao seu antecessor, garantindo assim a sua convergencia com 10 milhoes de casas decimais */ time(&end); time_spent = difftime(end, begin); printf("Tempo de execucao: %lf segundos\nIteracoes: %ld\n", time_spent, n_count); return 0; }
void TextEdit::setupFileActions() { QToolBar *tb = new QToolBar( this ); QPopupMenu *menu = new QPopupMenu( this ); menuBar()->insertItem( tr( "&File" ), menu ); QAction *a; a = new QAction( tr( "New" ), QPixmap( "textdrawing/filenew.png" ), tr( "&New..." ), CTRL + Key_N, this, "fileNew" ); connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); a->addTo( tb ); a->addTo( menu ); a = new QAction( tr( "Open" ), QPixmap( "textdrawing/fileopen.png" ), tr( "&Open..." ), CTRL + Key_O, this, "fileOpen" ); connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); a->addTo( tb ); a->addTo( menu ); menu->insertSeparator(); a = new QAction( tr( "Save" ), QPixmap( "textdrawing/filesave.png" ), tr( "&Save..." ), CTRL + Key_S, this, "fileSave" ); connect( a, SIGNAL( activated() ), this, SLOT( fileSave() ) ); a->addTo( tb ); a->addTo( menu ); a = new QAction( tr( "Save As" ), QPixmap(), tr( "Save &As..." ), 0, this, "fileSaveAs" ); connect( a, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) ); a->addTo( menu ); menu->insertSeparator(); a = new QAction( tr( "Print" ), QPixmap( "textdrawing/print.png" ), tr( "&Print..." ), CTRL + Key_P, this, "filePrint" ); connect( a, SIGNAL( activated() ), this, SLOT( filePrint() ) ); a->addTo( tb ); a->addTo( menu ); a = new QAction( tr( "Close" ), QPixmap(), tr( "&Close" ), 0, this, "fileClose" ); connect( a, SIGNAL( activated() ), this, SLOT( fileClose() ) ); a->addTo( menu ); }
bool TextEdit::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: fileNew(); break; case 1: fileOpen(); break; case 2: fileSave(); break; case 3: fileSaveAs(); break; case 4: filePrint(); break; case 5: fileClose(); break; case 6: fileExit(); break; case 7: editUndo(); break; case 8: editRedo(); break; case 9: editCut(); break; case 10: editCopy(); break; case 11: editPaste(); break; case 12: textBold(); break; case 13: textUnderline(); break; case 14: textItalic(); break; case 15: textFamily((const QString&)static_QUType_QString.get(_o+1)); break; case 16: textSize((const QString&)static_QUType_QString.get(_o+1)); break; case 17: textColor(); break; case 18: textAlign((QAction*)static_QUType_ptr.get(_o+1)); break; case 19: fontChanged((const QFont&)*((const QFont*)static_QUType_ptr.get(_o+1))); break; case 20: colorChanged((const QColor&)*((const QColor*)static_QUType_ptr.get(_o+1))); break; case 21: alignmentChanged((int)static_QUType_int.get(_o+1)); break; case 22: editorChanged((QWidget*)static_QUType_ptr.get(_o+1)); break; default: return QMainWindow::qt_invoke( _id, _o ); } return TRUE; }
void kerp::setupActions() { KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); KStdAction::open(this, SLOT(fileOpen()), actionCollection()); KStdAction::save(this, SLOT(fileSave()), actionCollection()); KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); KStdAction::print(this, SLOT(filePrint()), actionCollection()); KStdAction::quit(kapp, SLOT(quit()), actionCollection()); m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); // this doesn't do anything useful. it's just here to illustrate // how to insert a custom menu and menu item KAction *city_action = new KAction(i18n("&City/province"), 0, this, SLOT(city_action()), actionCollection(), "city_action"); KAction *invoice_action=new KAction(i18n("&Invoice"),0, this,SLOT(invoice_action()), actionCollection(),"invoice_action"); KAction * partner_action = new KAction(i18n("&Partner"),0, this,SLOT( partner_action()), actionCollection(),"partner_action"); createGUI(); }
int main( ) { char answer; char result; Menu( ); // ***********Answer to playing************* while( answer = playAgain( ) ) { switch( answer ) // The user decides to play the game { case 'y': printf( "Alright! Lets Play!\n\n" ); Instructions( ); // Will jump to the Instuctions Function result = playGame( ); // Will jump to rhe playGame Function // ****************RESULT OF GAME************************* if( result == 'w' ) // After the function playGame returns 'w', the user then won the game. { printf( "\n\nHurray! You Win!\n\n\n" ); } if( result == 'l' ) // Vise versa with the function playGame if it returns 'l'. { printf( "Awwww. I'm sorry but you Lose!\n\n\n" ); } break; case 'n': printf( "Too Bad! Maybe next time!\n" ); //The user decides to not play the game thus the program terminates return 0; case 'v': filePrint( ); break; default: printf( "That was not one of the choices. Please try again.\n\n" ); break; } Menu( ); } }
void CreateBlogMsg::setupFileActions() { QMenu *menu = new QMenu(tr("&File"), this); menuBar()->addMenu(menu); QAction *a; a = new QAction(QIcon(":/images/textedit/filenew.png"), tr("&New"), this); a->setShortcut(QKeySequence::New); connect(a, SIGNAL(triggered()), this, SLOT(fileNew())); menu->addAction(a); a = new QAction(QIcon(":/images/textedit/fileopen.png"), tr("&Open..."), this); a->setShortcut(QKeySequence::Open); connect(a, SIGNAL(triggered()), this, SLOT(fileOpen())); menu->addAction(a); menu->addSeparator(); actionSave = a = new QAction(QIcon(":/images/textedit/filesave.png"), tr("&Save"), this); a->setShortcut(QKeySequence::Save); connect(a, SIGNAL(triggered()), this, SLOT(fileSave())); a->setEnabled(false); menu->addAction(a); a = new QAction(tr("Save &As..."), this); connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAs())); menu->addAction(a); menu->addSeparator(); a = new QAction(QIcon(":/images/textedit/fileprint.png"), tr("&Print..."), this); a->setShortcut(QKeySequence::Print); connect(a, SIGNAL(triggered()), this, SLOT(filePrint())); menu->addAction(a); a = new QAction(QIcon(":/images/textedit/fileprint.png"), tr("Print Preview..."), this); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPreview())); menu->addAction(a); a = new QAction(QIcon(":/images/textedit/exportpdf.png"), tr("&Export PDF..."), this); a->setShortcut(Qt::CTRL + Qt::Key_D); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf())); menu->addAction(a); menu->addSeparator(); a = new QAction(tr("&Quit"), this); a->setShortcut(Qt::CTRL + Qt::Key_Q); connect(a, SIGNAL(triggered()), this, SLOT(cancelMsg())); menu->addAction(a); }
void Help::setupFileActions() { QPopupMenu* menu = new QPopupMenu( this ); menuBar()->insertItem( tr( "&File" ), menu ); QAction *a; a = new QAction( tr( "Print" ), createIconSet( "print.xpm" ), tr( "&Print" ), CTRL + Key_P, this ); a->addTo( menu ); a->addTo( toolbar ); connect( a, SIGNAL( activated() ), this, SLOT( filePrint() ) ); a = new QAction( tr( "Close" ), tr( "&Close" ), 0, this ); a->addTo( menu ); connect( a, SIGNAL( activated() ), this, SLOT( close() ) ); }
void MainWindow::createConnections() { connect(fileNewAction, SIGNAL(triggered()), this, SLOT(fileNew())); connect(fileOpenAction, SIGNAL(triggered()), this, SLOT(fileOpen())); connect(fileSaveAction, SIGNAL(triggered()), this, SLOT(fileSave())); connect(fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs())); connect(fileExportAction, SIGNAL(triggered()), this, SLOT(fileExport())); connect(filePrintAction, SIGNAL(triggered()), this, SLOT(filePrint())); connect(fileQuitAction, SIGNAL(triggered()), this, SLOT(close())); connect(editSelectedItemAction, SIGNAL(triggered()), this, SLOT(editSelectedItem())); connect(editAddTextAction, SIGNAL(triggered()), this, SLOT(editAddItem())); connect(editAddBoxAction, SIGNAL(triggered()), this, SLOT(editAddItem())); connect(editAddSmileyAction, SIGNAL(triggered()), this, SLOT(editAddItem())); connect(editCopyAction, SIGNAL(triggered()), this, SLOT(editCopy())); connect(editCutAction, SIGNAL(triggered()), this, SLOT(editCut())); connect(editPasteAction, SIGNAL(triggered()), this, SLOT(editPaste())); connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(updateUi())); foreach (QAction *action, QList<QAction*>() << editAlignmentAction << editAlignLeftAction << editAlignRightAction << editAlignTopAction << editAlignBottomAction) connect(action, SIGNAL(triggered()), this, SLOT(editAlign())); connect(editClearTransformsAction, SIGNAL(triggered()), this, SLOT(editClearTransforms())); connect(scene, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); connect(viewShowGridAction, SIGNAL(toggled(bool)), this, SLOT(viewShowGrid(bool))); connect(viewZoomInAction, SIGNAL(triggered()), view, SLOT(zoomIn())); connect(viewZoomOutAction, SIGNAL(triggered()), view, SLOT(zoomOut())); }
void ABMainWindow::setupMenuBar() { QPopupMenu *file = new QPopupMenu( this ); menuBar()->insertItem( "&File", file ); file->insertItem( "New", this, SLOT( fileNew() ), CTRL + Key_N ); file->insertItem( QPixmap( "fileopen.xpm" ), "Open", this, SLOT( fileOpen() ), CTRL + Key_O ); file->insertSeparator(); file->insertItem( QPixmap( "filesave.xpm" ), "Save", this, SLOT( fileSave() ), CTRL + Key_S ); file->insertItem( "Save As...", this, SLOT( fileSaveAs() ) ); file->insertSeparator(); file->insertItem( QPixmap( "fileprint.xpm" ), "Print...", this, SLOT( filePrint() ), CTRL + Key_P ); file->insertSeparator(); file->insertItem( "Close", this, SLOT( closeWindow() ), CTRL + Key_W ); file->insertItem( "Quit", qApp, SLOT( quit() ), CTRL + Key_Q ); }
void Korrent::setupActions() { KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); KStdAction::open(this, SLOT(fileOpen()), actionCollection()); KStdAction::save(this, SLOT(fileSave()), actionCollection()); KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); KStdAction::print(this, SLOT(filePrint()), actionCollection()); KStdAction::quit(kapp, SLOT(quit()), actionCollection()); KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); // this doesn't do anything useful. it's just here to illustrate // how to insert a custom menu and menu item KAction *custom = new KAction(i18n("Cus&tom Menuitem"), 0, this, SLOT(optionsPreferences()), actionCollection(), "custom_action"); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { setupUi(this); setWindowTitle(tr("GD CAD")); newFile(); qApp->installEventFilter(this); // scene = new QGraphicsScene; /*or(int x = 0; x <= ui->graphicsView->width(); x += 10){ scene->addLine(x,0,x,ui->graphicsView->height(),QPen(Qt::green)); } for(int y = 0; y <= ui->graphicsView->height(); y += 10){ scene->addLine(0,y,ui->graphicsView->width(),y,QPen(Qt::green)); } for(int x = 10; x <= ui->graphicsView->width(); x += 100){ scene->addLine(x,0,x,ui->graphicsView->height(),QPen(Qt::darkGreen)); } for(int y = 10; y <= ui->graphicsView->height(); y += 100){ scene->addLine(0,y,ui->graphicsView->width(),y,QPen(Qt::darkGreen)); } ui->graphicsView->setScene(scene);*/ connect(ui->pointButton, SIGNAL(clicked()), this, SLOT(drawPoint())); connect(ui->lineButton, SIGNAL(clicked()), this, SLOT(drawLine())); connect(ui->circleButton, SIGNAL(clicked()), this, SLOT(drawCircle())); connect(ui->ellipseButton, SIGNAL(clicked()), this, SLOT(drawEllipse())); connect(ui->actionPoints, SIGNAL(triggered()), this, SLOT(drawPoint())); connect(ui->actionLine, SIGNAL(triggered()), this, SLOT(drawLine())); connect(ui->actionCircle, SIGNAL(triggered()), this, SLOT(drawCircle())); connect(ui->actionEllipse, SIGNAL(triggered()), this, SLOT(drawEllipse())); connect(actionNew, SIGNAL(triggered()), this, SLOT(newFile())); connect(actionQuit, SIGNAL(triggered()), this, SLOT(close())); connect(actionNew, SIGNAL(triggered()), this, SLOT(newFile())); connect(actionQuit, SIGNAL(triggered()), this, SLOT(close())); connect(actionPrint, SIGNAL(triggered()), this, SLOT(filePrint())); connect(actionPrintPreview, SIGNAL(triggered()), this, SLOT(filePrintPreview())); }
void Krecipes::setupActions() { printAction = KStandardAction::print( this, SLOT( filePrint() ), actionCollection() ); reloadAction = new KAction( this ); reloadAction->setText( i18nc("@action:inmenu Reload Recipe", "Reloa&d" ) ); reloadAction->setIcon( KIcon( "view-refresh" ) ); reloadAction->setShortcut( Qt::Key_F5 ); actionCollection()->addAction( "reload_action" , reloadAction ); connect( reloadAction, SIGNAL(triggered(bool)), m_view, SLOT( reloadDisplay() ) ); editAction = new KAction( this ); editAction->setText( i18n( "&Edit Recipe" ) ); editAction->setIcon( KIcon( "document-edit" ) ); editAction->setShortcut( Qt::CTRL + Qt::Key_E ); actionCollection()->addAction( "edit_action" , editAction ); connect( editAction, SIGNAL(triggered(bool)), m_view, SLOT( editRecipe() ) ); converterAction = new KAction( this ); converterAction->setText( i18n( "&Measurement Converter" ) ); converterAction->setShortcut( Qt::CTRL + Qt::Key_M ); actionCollection()->addAction( "converter_action" , converterAction ); connect( converterAction, SIGNAL(triggered(bool)), this , SLOT( conversionToolSlot() ) ); KConfigGroup grp(KGlobal::config(),"Advanced"); if ( grp.readEntry("UnhideMergeTools",false) ) { //FIXME: Please review it, not used yet mergeCategoriesAction = new KAction( this ); mergeCategoriesAction->setIcon( KIcon( "folder-yellow" ) ); mergeCategoriesAction->setText( i18n( "&Merge Similar Categories..." ) ); //mergeCategoriesAction->setShortcut( Qt::CTRL + Qt::Key_M ); actionCollection()->addAction( "merge_categories_action", mergeCategoriesAction ); connect( mergeCategoriesAction, SIGNAL(triggered(bool)), this, SLOT( mergeSimilarCategories() ) ); mergeIngredientsAction = new KAction( this ); mergeIngredientsAction->setIcon( KIcon( "ingredients" ) ); mergeIngredientsAction->setText( i18n( "&Merge Similar Ingredients..." ) ); //ºmergeIngredientsAction->setShortcut( Qt::CTRL + Qt::Key_M ); actionCollection()->addAction( "merge_ingredients_action", mergeIngredientsAction ); connect( mergeIngredientsAction, SIGNAL(triggered(bool)), this, SLOT( mergeSimilarIngredients() ) ); }
/* * Constructs a RenderWindow as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ RenderWindow::RenderWindow(QWidget* parent, const char* name, Qt::WFlags fl) : QMainWindow(parent, name, fl) { setupUi(this); (void)statusBar(); // signals and slots connections connect(fileOpenAction, SIGNAL(activated()), this, SLOT(fileOpen())); connect(filePrintAction, SIGNAL(activated()), this, SLOT(filePrint())); connect(filePrintToPDFAction, SIGNAL(activated()), this, SLOT(filePrintToPDF())); connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit())); connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_table, SIGNAL(selectionChanged()), this, SLOT(sSelectionChanged())); connect(_list, SIGNAL(clicked()), this, SLOT(sList())); }
MQLEdit::MQLEdit(QWidget* parent, Qt::WindowFlags fl) : QMainWindow(parent, fl) { setupUi(this); (void)statusBar(); // signals and slots connections connect(fileNewAction, SIGNAL(activated()), this, SLOT(fileNew())); connect(fileOpenAction, SIGNAL(activated()), this, SLOT(fileOpen())); connect(fileSaveAction, SIGNAL(activated()), this, SLOT(fileSave())); connect(fileSaveAsAction, SIGNAL(activated()), this, SLOT(fileSaveAs())); connect(filePrintAction, SIGNAL(activated()), this, SLOT(filePrint())); connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit())); connect(editFindAction, SIGNAL(activated()), this, SLOT(editFind())); connect(helpIndexAction, SIGNAL(activated()), this, SLOT(helpIndex())); connect(helpContentsAction, SIGNAL(activated()), this, SLOT(helpContents())); connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout())); connect(fileDatabaseConnectAction, SIGNAL(activated()), this, SLOT(fileDatabaseConnect())); connect(fileDatabaseDisconnectAction, SIGNAL(activated()), this, SLOT(fileDatabaseDisconnect())); connect(viewParameter_ListAction, SIGNAL(activated()), this, SLOT(showParamList())); connect(toolsParse_QueryAction, SIGNAL(activated()), this, SLOT(parseQuery())); connect(toolsExecute_QueryAction, SIGNAL(activated()), this, SLOT(execQuery())); connect(viewLog_OutputAction, SIGNAL(activated()), this, SLOT(showLog())); connect(viewResultsAction, SIGNAL(activated()), this, SLOT(showResults())); connect(viewExecuted_SQLAction, SIGNAL(activated()), this, SLOT(showExecutedSQL())); QSqlDatabase db = QSqlDatabase(); if(_loggedIn && db.isValid() && db.isOpen()) { _loggedIn = true; } else { _loggedIn = false; } fileDatabaseConnectAction->setEnabled(!_loggedIn); fileDatabaseDisconnectAction->setEnabled(_loggedIn); _pEdit = new ParameterEdit(this); _log = new LogOutput(this); _sql = new LogOutput(this); _results = new ResultsOutput(this); }
void TextEdit::setupFileActions() { QMenu *menu = new QMenu(tr("&File"), this); menuBar()->addMenu(menu); QAction *a; a = new QAction(QIcon(rsrcPath + "/filenew.png"), tr("&New"), this); a->setShortcut(QKeySequence::New); connect(a, SIGNAL(triggered()), this, SLOT(fileNew())); menu->addAction(a); a = new QAction(QIcon(rsrcPath + "/fileopen.png"), tr("&Open..."), this); a->setShortcut(QKeySequence::Open); connect(a, SIGNAL(triggered()), this, SLOT(fileOpen())); menu->addAction(a); menu->addSeparator(); actionSave = a = new QAction(QIcon(rsrcPath + "/filesave.png"), tr("&Save"), this); a->setShortcut(QKeySequence::Save); connect(a, SIGNAL(triggered()), this, SLOT(fileSave())); a->setEnabled(false); menu->addAction(a); a = new QAction(tr("Save &As..."), this); connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAs())); menu->addAction(a); menu->addSeparator(); a = new QAction(QIcon(rsrcPath + "/fileprint.png"), tr("&Print..."), this); a->setShortcut(QKeySequence::Print); connect(a, SIGNAL(triggered()), this, SLOT(filePrint())); menu->addAction(a); menu->addSeparator(); a = new QAction(tr("&Quit"), this); a->setShortcut(Qt::CTRL + Qt::Key_Q); connect(a, SIGNAL(triggered()), this, SLOT(close())); menu->addAction(a); }
void k2send::setupActions() { KAction *action; KShortcut cut; setXMLFile( "k2sendui.rc" ); KStdAction::openNew(this, SLOT(fileNew()), actionCollection(),"file_new"); KStdAction::open(this, SLOT(fileOpen()), actionCollection(),"file_open"); action = new KAction(i18n("Import Playlist"), cut, this, SLOT(importPlaylist()), actionCollection(), "file_import"); KStdAction::print(this, SLOT(filePrint()), actionCollection(),"file_print"); KStdAction::quit(kapp, SLOT(quit()), actionCollection(),"file_quit"); m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection(),"preferences"); action = new KAction(i18n("Remove"), "editdelete", cut, m_view, SLOT(slotRemoveBranch()), actionCollection(), "file_remove"); action = new KAction(i18n("Play"), "player_play", cut, m_view, SLOT(slotPlay()), actionCollection(), "player_play"); action = new KAction(i18n("Stop"), "player_stop", cut,m_view, SLOT(slotStop()), actionCollection(), "player_stop"); action = new KAction(i18n("Next"), "player_fwd", cut,m_view, SLOT(slotSkip()), actionCollection(), "player_next"); action = new KAction(i18n("Loudness"), 0, cut,m_view, SLOT(slotLoudness()), actionCollection(), "player_loudness"); action = new KAction(i18n("Clear"), "reload", cut,m_view, SLOT(slotPlaylistClear()), actionCollection(), "playlist_clear"); action = new KAction(i18n("Play"), "player_play", cut,m_view, SLOT(slotConsolePlay()), actionCollection(), "console_play"); action = new KAction(i18n("Stop"), "player_stop", cut,m_view, SLOT(slotConsoleStop()), actionCollection(), "console_stop"); action = new KAction(i18n("Clear"), "reload", cut,m_view, SLOT(slotConsoleClear()), actionCollection(), "console_clear"); createGUI(); }
RenderWindow::RenderWindow(QWidget* parent, Qt::WindowFlags fl) : QMainWindow(parent, fl) { setupUi(this); (void)statusBar(); // signals and slots connections connect(fileOpenAction, SIGNAL(activated()), this, SLOT(fileOpen())); connect(fileLoadFromDB, SIGNAL(activated()), this, SLOT(fileLoad())); connect(filePrintPreviewAction, SIGNAL(activated()), this, SLOT(filePreview())); connect(filePrintAction, SIGNAL(activated()), this, SLOT(filePrint())); connect(filePrintToPDFAction, SIGNAL(activated()), this, SLOT(filePrintToPDF())); connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit())); connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_table, SIGNAL(itemSelectionChanged()), this, SLOT(sSelectionChanged())); connect(_list, SIGNAL(clicked()), this, SLOT(sList())); _autoPrint = false; //AUTOPRINT }
void TextEdit::setupFileActions() { QToolBar *tb = new QToolBar( this ); tb->setLabel( "File Actions" ); QPopupMenu *menu = new QPopupMenu( this ); menuBar()->insertItem( tr( "&File" ), menu ); QAction *a; a = new QAction( QPixmap::fromMimeSource( "filenew.xpm" ), tr( "&New..." ), CTRL + Key_N, this, "fileNew" ); connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); a->addTo( tb ); a->addTo( menu ); a = new QAction( QPixmap::fromMimeSource( "fileopen.xpm" ), tr( "&Open..." ), CTRL + Key_O, this, "fileOpen" ); connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); a->addTo( tb ); a->addTo( menu ); menu->insertSeparator(); a = new QAction( QPixmap::fromMimeSource( "filesave.xpm" ), tr( "&Save..." ), CTRL + Key_S, this, "fileSave" ); connect( a, SIGNAL( activated() ), this, SLOT( fileSave() ) ); a->addTo( tb ); a->addTo( menu ); a = new QAction( tr( "Save &As..." ), 0, this, "fileSaveAs" ); connect( a, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) ); a->addTo( menu ); menu->insertSeparator(); a = new QAction( QPixmap::fromMimeSource( "fileprint.xpm" ), tr( "&Print..." ), CTRL + Key_P, this, "filePrint" ); connect( a, SIGNAL( activated() ), this, SLOT( filePrint() ) ); a->addTo( tb ); a->addTo( menu ); a = new QAction( tr( "&Close" ), 0, this, "fileClose" ); connect( a, SIGNAL( activated() ), this, SLOT( fileClose() ) ); a->addTo( menu ); a = new QAction( tr( "E&xit" ), 0, this, "fileExit" ); connect( a, SIGNAL( activated() ), this, SLOT( fileExit() ) ); a->addTo( menu ); }
void Kooka::setupActions() { KStdAction::print(this, SLOT(filePrint()), actionCollection()); KStdAction::quit(this , SLOT(close()), actionCollection()); KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection()); KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); m_view->createDockMenu(actionCollection(), this, "settings_show_docks" ); /* Image Viewer action Toolbar - OCR, Scaling etc. */ (void) new KAction(i18n("&OCR Image..."), "ocr", CTRL+Key_O, m_view, SLOT(doOCR()), actionCollection(), "ocrImage" ); (void) new KAction(i18n("O&CR on Selection..."), "ocr-select", CTRL+Key_C, m_view, SLOT(doOCRonSelection()), actionCollection(), "ocrImageSelect" ); KAction *act; act = new KAction(i18n("Scale to W&idth"), "scaletowidth", CTRL+Key_I, m_view, SLOT( slIVScaleToWidth()), actionCollection(), "scaleToWidth" ); m_view->connectViewerAction( act ); act = new KAction(i18n("Scale to &Height"), "scaletoheight", CTRL+Key_H, m_view, SLOT( slIVScaleToHeight()), actionCollection(), "scaleToHeight" ); m_view->connectViewerAction( act ); act = new KAction(i18n("Original &Size"), "scaleorig", CTRL+Key_S, m_view, SLOT( slIVScaleOriginal()), actionCollection(), "scaleOriginal" ); m_view->connectViewerAction( act ); #ifdef QICONSET_HONOUR_ON_OFF /* The Toggleaction does not seem to handle the on/off icon from QIconSet */ QIconSet lockSet; lockSet.setPixmap(BarIcon("lock") , QIconSet::Automatic, QIconSet::Normal, QIconSet::On ); lockSet.setPixmap(BarIcon("unlock"), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off); act = new KToggleAction ( i18n("Keep &Zoom Setting"), lockSet, CTRL+Key_Z, actionCollection(), "keepZoom" ); #else act = new KToggleAction( i18n("Keep &Zoom Setting"), BarIcon("lockzoom"), CTRL+Key_Z, actionCollection(), "keepZoom" ); #endif connect( act, SIGNAL( toggled( bool ) ), m_view->getImageViewer(), SLOT(setKeepZoom(bool))); m_view->connectViewerAction( act ); /* thumbview and gallery actions */ act = new KAction(i18n("Set Zoom..."), "viewmag", 0, m_view, SLOT( slIVShowZoomDialog()), actionCollection(), "showZoomDialog" ); m_view->connectViewerAction( act ); (void) new KAction(i18n("Create From Selectio&n"), "crop", CTRL+Key_N, m_view, SLOT( slCreateNewImgFromSelection() ), actionCollection(), "createFromSelection" ); (void) new KAction(i18n("Mirror Image &Vertically"), "mirror-vert", CTRL+Key_V, this, SLOT( slMirrorVertical() ), actionCollection(), "mirrorVertical" ); (void) new KAction(i18n("&Mirror Image Horizontally"), "mirror-horiz", CTRL+Key_M, this, SLOT( slMirrorHorizontal() ), actionCollection(), "mirrorHorizontal" ); (void) new KAction(i18n("Mirror Image &Both Directions"), "mirror-both", CTRL+Key_B, this, SLOT( slMirrorBoth() ), actionCollection(), "mirrorBoth" ); (void) new KAction(i18n("Open Image in &Graphic Application..."), "fileopen", CTRL+Key_G, m_view, SLOT( slOpenCurrInGraphApp() ), actionCollection(), "openInGraphApp" ); act = new KAction(i18n("&Rotate Image Clockwise"), "rotate_cw", CTRL+Key_R, this, SLOT( slRotateClockWise() ), actionCollection(), "rotateClockwise" ); m_view->connectViewerAction( act ); act = new KAction(i18n("Rotate Image Counter-Clock&wise"), "rotate_ccw", CTRL+Key_W, this, SLOT( slRotateCounterClockWise() ), actionCollection(), "rotateCounterClockwise" ); m_view->connectViewerAction( act ); act = new KAction(i18n("Rotate Image 180 &Degrees"), "rotate", CTRL+Key_D, this, SLOT( slRotate180() ), actionCollection(), "upsitedown" ); m_view->connectViewerAction( act ); /* Gallery actions */ act = new KAction(i18n("&Create Folder..."), "folder_new", 0, m_view->gallery(), SLOT( slotCreateFolder() ), actionCollection(), "foldernew" ); m_view->connectGalleryAction( act ); act = new KAction(i18n("&Save Image..."), "filesave", 0, m_view->gallery(), SLOT( slotExportFile() ), actionCollection(), "saveImage" ); m_view->connectGalleryAction( act ); act = new KAction(i18n("&Import Image..."), "inline_image", 0, m_view->gallery(), SLOT( slotImportFile() ), actionCollection(), "importImage" ); m_view->connectGalleryAction( act ); act = new KAction(i18n("&Delete Image"), "edittrash", 0, m_view->gallery(), SLOT( slotDeleteItems() ), actionCollection(), "deleteImage" ); m_view->connectGalleryAction( act ); act = new KAction(i18n("&Unload Image"), "fileclose", 0, m_view->gallery(), SLOT( slotUnloadItems() ), actionCollection(), "unloadImage" ); m_view->connectGalleryAction( act ); #if 0 /* not yet supported actions - coming post 3.1 */ (void) new KAction(i18n("&Load Scan Parameters"), "bookmark_add", CTRL+Key_L, m_view, SLOT(slLoadScanParams()), actionCollection(), "loadscanparam" ); (void) new KAction(i18n("Save &Scan Parameters"), "bookmark_add", CTRL+Key_S, m_view, SLOT(slSaveScanParams()), actionCollection(), "savescanparam" ); #endif (void) new KAction(i18n("Select Scan Device"), "scanner", 0, m_view, SLOT( slSelectDevice()), actionCollection(), "selectsource" ); (void) new KAction( i18n("Enable All Warnings && Messages"), 0, this, SLOT(slEnableWarnings()), actionCollection(), "enable_msgs"); m_saveOCRTextAction = new KAction( i18n("Save OCR Res&ult Text"), "filesaveas", CTRL+Key_U, m_view, SLOT(slSaveOCRResult()), actionCollection(), "saveOCRResult"); }
MQLEdit::MQLEdit(QWidget* parent, Qt::WindowFlags fl) : QWidget(parent, fl) { setupUi(this); if (OpenRPT::name.isEmpty()) OpenRPT::name = tr("MetaSQL Editor"); _mqlSelector = 0; _document = _text->document(); _document->setDefaultFont(QFont("Courier")); connect(_document, SIGNAL(modificationChanged(bool)), this, SLOT(setWindowModified(bool))); connect(editFindAction, SIGNAL(triggered()), this, SLOT(editFind())); connect(fileDatabaseConnectAction, SIGNAL(triggered()), this, SLOT(fileDatabaseConnect())); connect(fileDatabaseDisconnectAction,SIGNAL(triggered()), this, SLOT(fileDatabaseDisconnect())); connect(fileDatabaseOpenAction, SIGNAL(triggered()), this, SLOT(fileDatabaseOpen())); connect(fileDatabaseSaveAsAction, SIGNAL(triggered()), this, SLOT(fileDatabaseSaveAs())); connect(fileExitAction, SIGNAL(triggered()), this, SLOT(fileExit())); connect(fileNewAction, SIGNAL(triggered()), this, SLOT(fileNew())); connect(fileOpenAction, SIGNAL(triggered()), this, SLOT(fileOpen())); connect(filePrintAction, SIGNAL(triggered()), this, SLOT(filePrint())); connect(fileSaveAction, SIGNAL(triggered()), this, SLOT(fileSave())); connect(fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs())); connect(helpAboutAction, SIGNAL(triggered()), this, SLOT(helpAbout())); connect(helpContentsAction, SIGNAL(triggered()), this, SLOT(helpContents())); connect(helpIndexAction, SIGNAL(triggered()), this, SLOT(helpIndex())); connect(searchForParametersAction, SIGNAL(triggered()), this, SLOT(populateParameterEdit())); connect(toolsExecute_QueryAction, SIGNAL(triggered()), this, SLOT(execQuery())); connect(toolsParse_QueryAction, SIGNAL(triggered()), this, SLOT(parseQuery())); connect(viewExecuted_SQLAction, SIGNAL(triggered()), this, SLOT(showExecutedSQL())); connect(viewLog_OutputAction, SIGNAL(triggered()), this, SLOT(showLog())); connect(viewParameter_ListAction, SIGNAL(triggered()), this, SLOT(showParamList())); connect(viewResultsAction, SIGNAL(triggered()), this, SLOT(showResults())); QSqlDatabase db = QSqlDatabase().database(); if(db.isValid() && db.isOpen()) OpenRPT::loggedIn = true; else { OpenRPT::loggedIn = false; db = QSqlDatabase(); } if (parent) // then must be embedded { if (DEBUG) qDebug("MQLEdit::MQLEdit(%p) OpenRPT::loggedIn = %d", parent, OpenRPT::loggedIn); fileDatabaseConnectAction->setVisible(! OpenRPT::loggedIn); fileDatabaseDisconnectAction->setVisible(! OpenRPT::loggedIn); fileExitAction->setText(tr("Close")); QToolBar *menuproxy = new QToolBar(this); menuproxy->setObjectName("menuproxy"); menuproxy->setOrientation(Qt::Horizontal); verticalLayout->insertWidget(0, menuproxy); menuproxy->addAction(fileMenu->menuAction()); menuproxy->addAction(editMenu->menuAction()); menuproxy->addAction(ViewMenu->menuAction()); menuproxy->addAction(ToolsMenu->menuAction()); menuproxy->addAction(helpMenu->menuAction()); } fileDatabaseConnectAction->setEnabled(!OpenRPT::loggedIn); fileDatabaseDisconnectAction->setEnabled(OpenRPT::loggedIn); fileDatabaseOpenAction->setEnabled(OpenRPT::loggedIn); fileDatabaseSaveAsAction->setEnabled(OpenRPT::loggedIn); _pEdit = new ParameterEdit(this, Qt::Window); _log = new LogOutput(this); _sql = new LogOutput(this); _results = new ResultsOutput(this); _highlighter = new MetaSQLHighlighter(_document); clear(); setDestType(MQLUnknown); }
void TaskJuggler::setupActions() { // "File" menu KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); new KAction(i18n("New &Include File" ), "file_temporary", KShortcut(), this, SLOT(fileNewInclude()), actionCollection(), "new_include"); KStdAction::open(this, SLOT(fileOpen()), actionCollection()); KStdAction::close(this, SLOT(fileClose()), actionCollection()); KStdAction::print(this, SLOT(filePrint()), actionCollection()); KStdAction::quit(kapp, SLOT(closeAllWindows()), actionCollection()); // Setup "Open Recent" menu and load old recent files. m_recentAction = KStdAction::openRecent(this, SLOT(load(const KURL&)), actionCollection()); // "Goto" menu new KAction(i18n("Tas&ks"), "tj_task_group", KShortcut(KKey("ALT+k")), m_view, SLOT(setFocusToTaskList()), actionCollection(), "tasks"); new KAction(i18n("&Resources"), "tj_resource_group", KShortcut(KKey("ALT+r")), m_view, SLOT(setFocusToResourceList()), actionCollection(), "resources"); new KAction(i18n("&Accounts"), "tj_account_group", KShortcut(KKey("ALT+a")), m_view, SLOT(setFocusToAccountList()), actionCollection(), "accounts"); new KAction(i18n("Re&ports"), "tj_report_list", KShortcut(KKey("ALT+p")), m_view, SLOT(setFocusToReportList()), actionCollection(), "reports"); new KAction(i18n("F&iles"), "tj_file_list", KShortcut(KKey("ALT+i")), m_view, SLOT(setFocusToFileList()), actionCollection(), "files"); new KAction(i18n("E&ditor"), "tj_editor", KShortcut("ALT+d"), m_view, SLOT(setFocusToEditor()), actionCollection(), "editor"); new KAction(i18n("Rep&ort"), "tj_report", KShortcut("ALT+o"), m_view, SLOT(setFocusToReport()), actionCollection(), "report"); // "Tools" menu new KAction(i18n("&Schedule"), "tj_schedule", KShortcut(KKey("F9")), m_view, SLOT(schedule()), actionCollection(), "schedule"); new KAction(i18n("Stop scheduling"), "stop", 0, m_view, SLOT(stop()), actionCollection(), "stop"); new KAction(i18n("&Generate all Reports"), 0, 0, m_view, SLOT(generate()), actionCollection(), "generate"); new KAction(i18n("Goto &previous Problem"), "tj_previous_problem", KShortcut(KKey("F10")), m_view, SLOT(previousProblem()), actionCollection(), "previous_problem"); new KAction(i18n("Goto &next Problem"), "tj_next_problem", KShortcut(KKey("F11")), m_view, SLOT(nextProblem()), actionCollection(), "next_problem"); new KAction(i18n("Zoom &In"), "viewmag+", KShortcut(KKey("F7")), m_view, SLOT(zoomIn()), actionCollection(), "zoom_in"); new KAction(i18n("Zoom &Out"), "viewmag-", KShortcut(KKey("F8")), m_view, SLOT(zoomOut()), actionCollection(), "zoom_out"); // "Help" menu new KAction(i18n("Tip of the day"), "idea", 0, this, SLOT(showTip()), actionCollection(), "tip"); new KAction(i18n("Explain Keyword"), "tj_keyword_help", KShortcut(KKey("F2")), m_view, SLOT(keywordHelp()), actionCollection(), "keyword_help"); new KAction(i18n("Tutorial"), "tj_tutorial", 0, m_view, SLOT(tutorial()), actionCollection(), "tutorial"); setupGUI(ToolBar | Keys | StatusBar | Save | Create); }
void TextEdit::setupFileActions() { QToolBar *tb = new QToolBar(this); tb->setWindowTitle(tr("File Actions")); addToolBar(tb); QMenu *menu = new QMenu(tr("&File"), this); menuBar()->addMenu(menu); QAction *a; a = new QAction(QIcon(rsrcPath + "/filenew.png"), tr("&New"), this); a->setShortcut(QKeySequence::New); connect(a, SIGNAL(triggered()), this, SLOT(fileNew())); tb->addAction(a); menu->addAction(a); a = new QAction(QIcon(rsrcPath + "/fileopen.png"), tr("&Open..."), this); a->setShortcut(QKeySequence::Open); connect(a, SIGNAL(triggered()), this, SLOT(fileOpen())); tb->addAction(a); menu->addAction(a); menu->addSeparator(); actionSave = a = new QAction(QIcon(rsrcPath + "/filesave.png"), tr("&Save"), this); a->setShortcut(QKeySequence::Save); connect(a, SIGNAL(triggered()), this, SLOT(fileSave())); a->setEnabled(false); tb->addAction(a); menu->addAction(a); a = new QAction(tr("Save &As..."), this); connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAs())); menu->addAction(a); menu->addSeparator(); #ifndef QT_NO_PRINTER a = new QAction(QIcon(rsrcPath + "/fileprint.png"), tr("&Print..."), this); a->setShortcut(QKeySequence::Print); connect(a, SIGNAL(triggered()), this, SLOT(filePrint())); tb->addAction(a); menu->addAction(a); a = new QAction(QIcon(rsrcPath + "/fileprint.png"), tr("Print Preview..."), this); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPreview())); menu->addAction(a); a = new QAction(QIcon(rsrcPath + "/exportpdf.png"), tr("&Export PDF..."), this); a->setShortcut(Qt::CTRL + Qt::Key_D); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf())); tb->addAction(a); menu->addAction(a); menu->addSeparator(); #endif a = new QAction(tr("&Quit"), this); a->setShortcut(Qt::CTRL + Qt::Key_Q); connect(a, SIGNAL(triggered()), this, SLOT(close())); menu->addAction(a); }
LDViewMainWindow::LDViewMainWindow(QApplication *a) :QMainWindow(),Ui::LDView(), fileSeparatorIndex(-1), toolbarMaxStep(new QLabel), toolbarCurrentStep(new QLabel), toolbarStepLabel(new QLabel("Step :")), toolbarViewAngle(NULL), toolbarWireframeMenu(new QMenu(this)), edgeMenu(new QMenu(this)), bfcMenu(new QMenu(this)), primitiveMenu(new QMenu(this)) { setupUi(this); toolbar->insertWidget(toolbarFirstStep,toolbarStepLabel); toolbar->insertWidget(toolbarFirstStep,toolbarCurrentStep); toolbar->insertWidget(toolbarFirstStep,toolbarMaxStep); if (modelViewer) modelViewer->setMainWindow(this); connect( fileOpenAction, SIGNAL( triggered() ), this, SLOT( fileOpen() ) ); connect( fileSaveSettingsAction, SIGNAL( triggered() ), this, SLOT( fileSaveSettings() ) ); connect( fileExportAction, SIGNAL( triggered() ), this, SLOT( fileExport() ) ); connect( fileExportOptionAction, SIGNAL( triggered() ), this, SLOT( fileExportOption() ) ); connect( file3DSExportOptionAction, SIGNAL( triggered() ), this, SLOT( file3DSExportOption() ) ); connect( fileJPEGOptionsAction, SIGNAL( triggered() ), this, SLOT( fileJPEGOptions() ) ); connect( fileSaveAction, SIGNAL( triggered() ), this, SLOT( fileSave() ) ); connect( filePrintAction, SIGNAL( triggered() ), this, SLOT( filePrint() ) ); connect( fileExitAction, SIGNAL( triggered() ), this, SLOT( fileExit() ) ); connect( helpContentsAction, SIGNAL( triggered() ), this, SLOT( helpContents() ) ); connect( helpAboutAction, SIGNAL( triggered() ), this, SLOT( helpAbout() ) ); connect( helpAboutQtAction, SIGNAL( triggered() ), this, SLOT( helpAboutQt() ) ); connect( editPreferencesAction, SIGNAL( triggered() ), this, SLOT( editPreferences() ) ); connect( viewToolBarAction, SIGNAL( toggled(bool) ), this, SLOT( viewToolBar(bool) ) ); connect( toolbarWireframeAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarWireframe(bool) ) ); connect( toolbarEdgeAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarEdge(bool) ) ); connect( toolbarPrimitiveSubstitutionAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarPrimitiveSubstitution(bool) ) ); connect( toolbarLightingAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarLighting(bool) ) ); connect( toolbarBFCAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarBFC(bool) ) ); connect( toolbarAxesAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarAxes(bool) ) ); connect( toolbarSeamsAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarSeams(bool) ) ); connect( viewStatusBarAction, SIGNAL( toggled(bool) ), this, SLOT( viewStatusBar(bool) ) ); connect( viewLatitudeRotationAction, SIGNAL( toggled(bool) ), this, SLOT( latitudeRotation(bool) ) ); connect( viewKeepRightSideUpAction, SIGNAL( toggled(bool) ), this, SLOT( keepRightSideUp(bool) ) ); connect( viewFullScreenAction, SIGNAL( triggered() ), this, SLOT( viewFullScreen() ) ); connect( viewResetViewAction, SIGNAL( triggered() ), this, SLOT( viewResetView() ) ); connect( helpOpenGLDriverInfoAction, SIGNAL( triggered() ), this, SLOT( helpOpenGLDriverInfo() ) ); connect( fileLDrawDirAction, SIGNAL( triggered() ), this, SLOT( fileLDrawDir() ) ); connect( fileExtraDirAction, SIGNAL( triggered() ), this, SLOT( fileExtraDir() ) ); connect( fileCheckForUpdatesAction, SIGNAL( triggered() ), this, SLOT( fileCheckForUpdates() ) ); connect( fileReloadAction, SIGNAL( triggered() ), this, SLOT( fileReload() ) ); connect( viewShowErrorsAction, SIGNAL( triggered() ), this, SLOT( viewShowErrors() ) ); connect( pollActionGroup, SIGNAL( triggered(QAction*) ), this, SLOT( pollChanged(QAction*) ) ); connect( viewZoomToFitAction, SIGNAL( triggered() ), this, SLOT( viewZoomToFit() ) ); connect( viewRightSideUpAction, SIGNAL( triggered() ), this, SLOT( viewRightSideUp() ) ); connect( viewModeActionGroup, SIGNAL( triggered(QAction*) ), this, SLOT( viewModeChanged(QAction*) ) ); connect( frontViewAngleAction, SIGNAL( triggered() ), this, SLOT( frontViewAngle() ) ); connect( backViewAngleAction, SIGNAL( triggered() ), this, SLOT( backViewAngle() ) ); connect( leftViewAngleAction, SIGNAL( triggered() ), this, SLOT( leftViewAngle() ) ); connect( rightViewAngleAction, SIGNAL( triggered() ), this, SLOT( rightViewAngle() ) ); connect( topViewAngleAction, SIGNAL( triggered() ), this, SLOT( topViewAngle() ) ); connect( bottomViewAngleAction, SIGNAL( triggered() ), this, SLOT( bottomViewAngle() ) ); connect( latLongViewAngleAction, SIGNAL( triggered() ), this, SLOT( latLongViewAngle() ) ); connect( isoViewAngleAction, SIGNAL( triggered() ), this, SLOT( isoViewAngle() ) ); connect( saveDefaultViewAngleAction, SIGNAL( triggered() ), this, SLOT( saveDefaultViewAngle() ) ); connect( fileCancelLoadAction, SIGNAL( triggered() ), this, SLOT( fileCancelLoad() ) ); connect( showViewInfoAction, SIGNAL( triggered() ), this, SLOT( showViewInfo() ) ); connect( showPovCameraAction, SIGNAL( triggered() ), this, SLOT( showPovCamera() ) ); connect( showPovAspectRatioAction, SIGNAL( toggled(bool) ), this, SLOT( showPovAspectRatio(bool) ) ); connect( toolsPartListAction, SIGNAL( triggered() ), this, SLOT( toolsPartList() ) ); connect( toolbarPrevStep, SIGNAL( triggered() ), this, SLOT( prevStep() ) ); connect( toolbarNextStep, SIGNAL( triggered() ), this, SLOT( nextStep() ) ); connect( toolbarFirstStep, SIGNAL( triggered() ), this, SLOT( firstStep() ) ); connect( toolbarLastStep, SIGNAL( triggered() ), this, SLOT( lastStep() ) ); connect( stepGoto, SIGNAL( triggered() ), this, SLOT( gotoStep() ) ); connect( toolsModelTreeAction, SIGNAL( triggered() ), this, SLOT( toolsModelTree() ) ); connect( toolsBoundingBoxAction, SIGNAL( triggered() ), this, SLOT( toolsBoundingBox() ) ); connect( toolsMpdModelSelectionAction, SIGNAL( triggered() ), this, SLOT( toolsMpdModelSelection() ) ); connect(fileMenu, SIGNAL(aboutToShow()), this, SLOT(doFileMenuAboutToShow())); connect(editMenu, SIGNAL(aboutToShow()), this, SLOT(doEditMenuAboutToShow())); connect(viewMenu, SIGNAL(aboutToShow()), this, SLOT(doViewMenuAboutToShow())); connect(toolsMenu,SIGNAL(aboutToShow()), this, SLOT(doToolsMenuAboutToShow())); connect(helpMenu, SIGNAL(aboutToShow()), this, SLOT(doHelpMenuAboutToShow())); int cnt,i; QAction *item; for ( cnt = i = 0; ; i++) { item = fileMenu->actions()[i]; if (item->isSeparator()) { if (++cnt == 2) break; } } fileSeparatorIndex = i; #ifdef __APPLE__ fileMenu->removeItemAt(fileSeparatorIndex); fileSeparatorIndex = -1; openRecentMenu = new QMenu(this, "openRecentMenu"); fileMenu->insertItem("Open Recent", openRecentMenu, -1, 1); #endif // __APPLE__ if (!recentFiles) { recentFiles = new TCStringArray(10); populateRecentFiles(); } populateRecentFileMenuItems(); setupStandardSizes(); #ifdef __APPLE__ // Since Preferences is the only item in the edit menu, we need to // delete the edit menu on the Mac, since the item is going to get // magically moved to the LDView menu. The problem is, if we delete // the edit menu, the magic stops working, since it's apparently all // done on the fly. So, we're going to create a new fully-functional // Preferences menu item at the top of the File menu, and THEN delete // the edit menu. This newly created menu item won't be visible to the // user, but it will make the other one continue to function after the // deletion of the edit menu. fileMenu->insertItem("Preferences", this, SLOT(doPreferences()), 0, -1, 0); // Remove the (empty without Preferences) edit menu. menuBar->removeItem(menuBar->idAt(1)); #endif //__APPLE__ toolbarViewAngle = new QToolButton(toolbar); toolbarViewAngle->setMenu(viewingAnglePopupMenu); toolbarViewAngle->setPopupMode(QToolButton::InstantPopup); toolbarViewAngle->setIcon(QPixmap( ":/images/images/toolbar_view.png")); toolbarViewAngle->setEnabled(false); toolbar->insertWidget(editPreferencesAction,toolbarViewAngle); connect( wireframeFogAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarWireframeFog(bool) ) ); connect( wireframeRemoveHiddenLinesAction, SIGNAL( toggled(bool) ), this, SLOT( toolbarWireframeRemoveHiddenLines(bool) ) ); toolbarWireframeMenu->addAction(wireframeFogAction); toolbarWireframeMenu->addAction(wireframeRemoveHiddenLinesAction); QToolButton *toolbarWireframe = (QToolButton *)toolbar->widgetForAction(toolbarWireframeAction); if (toolbarWireframe != NULL) { toolbarWireframe->setMenu(toolbarWireframeMenu); toolbarWireframe->setPopupMode(QToolButton::MenuButtonPopup); } connect( textureStudAction, SIGNAL( toggled(bool) ), this, SLOT( textureStud(bool) ) ); primitiveMenu->addAction(textureStudAction); QToolButton *toolbarPrimitives = (QToolButton *)toolbar->widgetForAction(toolbarPrimitiveSubstitutionAction); if (toolbarPrimitives) { toolbarPrimitives->setMenu(primitiveMenu); toolbarPrimitives->setPopupMode(QToolButton::MenuButtonPopup); } connect( edgeShowEdgeOnlyAction, SIGNAL( toggled(bool) ), this, SLOT( edgeShowEdgeOnly(bool) ) ); connect( edgeConditionalLineAction, SIGNAL( toggled(bool) ), this, SLOT( edgeConditionalLine(bool) ) ); connect( edgeHighQualityAction, SIGNAL( toggled(bool) ), this, SLOT( edgeHighQuality(bool) ) ); connect( edgeAlwaysBlackAction, SIGNAL( toggled(bool) ), this, SLOT( edgeAlwaysBlack(bool) ) ); edgeMenu->addAction(edgeShowEdgeOnlyAction); edgeMenu->addAction(edgeConditionalLineAction); edgeMenu->addAction(edgeHighQualityAction); edgeMenu->addAction(edgeAlwaysBlackAction); QToolButton *toolbarEdge = (QToolButton *)toolbar->widgetForAction(toolbarEdgeAction); if (toolbarEdge) { toolbarEdge->setMenu(edgeMenu); toolbarEdge->setPopupMode(QToolButton::MenuButtonPopup); } connect( bfcRedBackFacesAction, SIGNAL( toggled(bool) ), this, SLOT( bfcRedBackFaces(bool) ) ); connect( bfcGreenFrontFacesAction, SIGNAL( toggled(bool) ), this, SLOT( bfcGreenFrontFaces(bool) ) ); connect( bfcBlueNeutralFacesAction, SIGNAL( toggled(bool) ), this, SLOT( bfcBlueNeutralFaces(bool) ) ); bfcMenu->addAction(bfcRedBackFacesAction); bfcMenu->addAction(bfcGreenFrontFacesAction); bfcMenu->addAction(bfcBlueNeutralFacesAction); QToolButton *toolbarBfc = (QToolButton *)toolbar->widgetForAction(toolbarBFCAction); if (toolbarBfc) { toolbarBfc->setMenu(bfcMenu); toolbarBfc->setPopupMode(QToolButton::MenuButtonPopup); } modelViewer->setApplication(a); }
void MainWindow::setupFileActions() { QToolBar *tb = new QToolBar(this); tb->setWindowTitle(tr("File Actions")); addToolBar(tb); QMenu *menu = new QMenu(tr("&File"), this); menuBar()->addMenu(menu); QAction *a; QIcon newIcon = QIcon::fromTheme("document-new", QIcon(rsrcPath + "/filenew.png")); a = new QAction( newIcon, tr("&New"), this); a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::New); connect(a, SIGNAL(triggered()), this, SLOT(fileNew())); tb->addAction(a); menu->addAction(a); a = new QAction(QIcon::fromTheme("document-open", QIcon(rsrcPath + "/fileopen.png")), tr("&Open..."), this); a->setShortcut(QKeySequence::Open); connect(a, SIGNAL(triggered()), this, SLOT(fileOpen())); tb->addAction(a); menu->addAction(a); menu->addSeparator(); actionSave = a = new QAction(QIcon::fromTheme("document-save", QIcon(rsrcPath + "/filesave.png")), tr("&Save"), this); a->setShortcut(QKeySequence::Save); connect(a, SIGNAL(triggered()), this, SLOT(fileSave())); a->setEnabled(false); tb->addAction(a); menu->addAction(a); a = new QAction(tr("Save &As..."), this); a->setPriority(QAction::LowPriority); connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAs())); menu->addAction(a); menu->addSeparator(); #ifndef QT_NO_PRINTER a = new QAction(QIcon::fromTheme("document-print", QIcon(rsrcPath + "/fileprint.png")), tr("&Print..."), this); a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::Print); connect(a, SIGNAL(triggered()), this, SLOT(filePrint())); tb->addAction(a); menu->addAction(a); a = new QAction(QIcon::fromTheme("fileprint", QIcon(rsrcPath + "/fileprint.png")), tr("Print Preview..."), this); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPreview())); menu->addAction(a); a = new QAction(QIcon::fromTheme("exportpdf", QIcon(rsrcPath + "/exportpdf.png")), tr("&Export PDF..."), this); a->setPriority(QAction::LowPriority); a->setShortcut(Qt::CTRL + Qt::Key_D); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf())); tb->addAction(a); menu->addAction(a); menu->addSeparator(); #endif a = new QAction(tr("&Quit"), this); a->setShortcut(Qt::CTRL + Qt::Key_Q); //connect(a, SIGNAL(triggered()), this, SLOT(close())); connect(a, &QAction::triggered, this, [&](){ ADDEBUG() << "close..."; close(); }); menu->addAction(a); }
void TextEdit::setupFileActions() { standardToolBar = new QToolBar(this); standardToolBar->setWindowTitle(tr("File Actions")); addToolBar(standardToolBar); QMenu *menu = new QMenu(tr("&File"), this); menuBar()->addMenu(menu); QAction *a; a = new QAction( QIcon(":/res/smallNew.png"), tr("&New"), this); a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::New); connect(a, SIGNAL(triggered()), this, SLOT(fileNew())); standardToolBar->addAction(a); menu->addAction(a); a = new QAction(QIcon(":/res/smallOpen.png"), tr("&Open..."), this); a->setShortcut(QKeySequence::Open); connect(a, SIGNAL(triggered()), this, SLOT(fileOpen())); standardToolBar->addAction(a); menu->addAction(a); menu->addSeparator(); actionSave = a = new QAction(QIcon(":/res/smallSave.png"),tr("&Save"), this); a->setShortcut(QKeySequence::Save); connect(a, SIGNAL(triggered()), this, SLOT(fileSave())); a->setEnabled(false); standardToolBar->addAction(a); menu->addAction(a); a = new QAction(tr("Save &As..."), this); a->setPriority(QAction::LowPriority); connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAs())); menu->addAction(a); menu->addSeparator(); #ifndef QT_NO_PRINTER a = new QAction(QIcon(":/res/smallPrint.png"),tr("&Print..."), this); a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::Print); connect(a, SIGNAL(triggered()), this, SLOT(filePrint())); standardToolBar->addAction(a); menu->addAction(a); a = new QAction(QIcon(":/res/smallPrintPreview.png"),tr("Print Preview..."), this); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPreview())); menu->addAction(a); a = new QAction(QIcon(":/res/smallSavePDF.png"),tr("&Export PDF..."), this); a->setPriority(QAction::LowPriority); a->setShortcut(Qt::CTRL + Qt::Key_D); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf())); standardToolBar->addAction(a); menu->addAction(a); menu->addSeparator(); #endif a = new QAction(tr("&Quit"), this); a->setShortcut(Qt::CTRL + Qt::Key_Q); connect(a, SIGNAL(triggered()), this, SLOT(close())); menu->addAction(a); }
void LiteEditor::createActions() { LiteApi::IActionContext *actionContext = m_liteApp->actionManager()->getActionContext(this,"Editor"); m_undoAct = new QAction(QIcon("icon:liteeditor/images/undo.png"),tr("Undo"),this); actionContext->regAction(m_undoAct,"Undo",QKeySequence::Undo); m_redoAct = new QAction(QIcon("icon:liteeditor/images/redo.png"),tr("Redo"),this); actionContext->regAction(m_redoAct,"Redo","Ctrl+Shift+Z; Ctrl+Y"); m_cutAct = new QAction(QIcon("icon:liteeditor/images/cut.png"),tr("Cut"),this); actionContext->regAction(m_cutAct,"Cut",QKeySequence::Cut); m_copyAct = new QAction(QIcon("icon:liteeditor/images/copy.png"),tr("Copy"),this); actionContext->regAction(m_copyAct,"Copy",QKeySequence::Copy); m_pasteAct = new QAction(QIcon("icon:liteeditor/images/paste.png"),tr("Paste"),this); actionContext->regAction(m_pasteAct,"Paste",QKeySequence::Paste); m_selectAllAct = new QAction(tr("Select All"),this); actionContext->regAction(m_selectAllAct,"SelectAll",QKeySequence::SelectAll); m_exportHtmlAct = new QAction(QIcon("icon:liteeditor/images/exporthtml.png"),tr("Export HTML..."),this); #ifndef QT_NO_PRINTER m_exportPdfAct = new QAction(QIcon("icon:liteeditor/images/exportpdf.png"),tr("Export PDF..."),this); m_filePrintAct = new QAction(QIcon("icon:liteeditor/images/fileprint.png"),tr("Print..."),this); m_filePrintPreviewAct = new QAction(QIcon("icon:liteeditor/images/fileprintpreview.png"),tr("Print Preview..."),this); #endif m_gotoPrevBlockAct = new QAction(tr("Go To Previous Block"),this); actionContext->regAction(m_gotoPrevBlockAct,"GotoPreviousBlock","Ctrl+["); m_gotoNextBlockAct = new QAction(tr("Go To Next Block"),this); actionContext->regAction(m_gotoNextBlockAct,"GotoNextBlock","Ctrl+]"); m_selectBlockAct = new QAction(tr("Select Block"),this); actionContext->regAction(m_selectBlockAct,"SelectBlock","Ctrl+U"); m_gotoMatchBraceAct = new QAction(tr("Go To Matching Brace"),this); actionContext->regAction(m_gotoMatchBraceAct,"GotoMatchBrace","Ctrl+E"); m_foldAct = new QAction(tr("Fold"),this); actionContext->regAction(m_foldAct,"Fold","Ctrl+<"); m_unfoldAct = new QAction(tr("Unfold"),this); actionContext->regAction(m_unfoldAct,"Unfold","Ctrl+>"); m_foldAllAct = new QAction(tr("Fold All"),this); actionContext->regAction(m_foldAllAct,"FoldAll",""); m_unfoldAllAct = new QAction(tr("Unfold All"),this); actionContext->regAction(m_unfoldAllAct,"UnfoldAll",""); connect(m_foldAct,SIGNAL(triggered()),m_editorWidget,SLOT(fold())); connect(m_unfoldAct,SIGNAL(triggered()),m_editorWidget,SLOT(unfold())); connect(m_foldAllAct,SIGNAL(triggered()),m_editorWidget,SLOT(foldAll())); connect(m_unfoldAllAct,SIGNAL(triggered()),m_editorWidget,SLOT(unfoldAll())); m_gotoLineAct = new QAction(tr("Go To Line"),this); actionContext->regAction(m_gotoLineAct,"GotoLine","Ctrl+L"); m_lockAct = new QAction(QIcon("icon:liteeditor/images/lock.png"),tr("Locked"),this); m_lockAct->setEnabled(false); m_duplicateAct = new QAction(tr("Duplicate"),this); actionContext->regAction(m_duplicateAct,"Duplicate","Ctrl+D"); connect(m_duplicateAct,SIGNAL(triggered()),m_editorWidget,SLOT(duplicate())); m_deleteLineAct = new QAction(tr("Delete Line"),this); actionContext->regAction(m_deleteLineAct,"DeleteLine","Ctrl+Shift+K"); connect(m_deleteLineAct,SIGNAL(triggered()),m_editorWidget,SLOT(deleteLine())); m_insertLineBeforeAct = new QAction(tr("Insert Line Before"),this); actionContext->regAction(m_insertLineBeforeAct,"InsertLineBefore","Ctrl+Shift+Return"); connect(m_insertLineBeforeAct,SIGNAL(triggered()),m_editorWidget,SLOT(insertLineBefore())); m_insertLineAfterAct = new QAction(tr("Insert Line After"),this); actionContext->regAction(m_insertLineAfterAct,"InsertLineAfter","Ctrl+Return"); connect(m_insertLineAfterAct,SIGNAL(triggered()),m_editorWidget,SLOT(insertLineAfter())); m_increaseFontSizeAct = new QAction(tr("Increase Font Size"),this); actionContext->regAction(m_increaseFontSizeAct,"IncreaseFontSize","Ctrl++;Ctrl+="); m_decreaseFontSizeAct = new QAction(tr("Decrease Font Size"),this); actionContext->regAction(m_decreaseFontSizeAct,"DecreaseFontSize","Ctrl+-"); m_resetFontSizeAct = new QAction(tr("Reset Font Size"),this); actionContext->regAction(m_resetFontSizeAct,"ResetFontSize","Ctrl+0"); m_cleanWhitespaceAct = new QAction(tr("Clean Whitespace"),this); actionContext->regAction(m_cleanWhitespaceAct,"CleanWhitespace",""); m_wordWrapAct = new QAction(tr("Word Wrap"),this); m_wordWrapAct->setCheckable(true); actionContext->regAction(m_wordWrapAct,"WordWrap",""); // m_widget->addAction(m_foldAct); // m_widget->addAction(m_unfoldAct); // m_widget->addAction(m_gotoLineAct); // m_widget->addAction(m_gotoPrevBlockAct); // m_widget->addAction(m_gotoNextBlockAct); // m_widget->addAction(m_selectBlockAct); // m_widget->addAction(m_gotoMatchBraceAct); connect(m_editorWidget,SIGNAL(undoAvailable(bool)),m_undoAct,SLOT(setEnabled(bool))); connect(m_editorWidget,SIGNAL(redoAvailable(bool)),m_redoAct,SLOT(setEnabled(bool))); connect(m_editorWidget,SIGNAL(copyAvailable(bool)),m_cutAct,SLOT(setEnabled(bool))); connect(m_editorWidget,SIGNAL(copyAvailable(bool)),m_copyAct,SLOT(setEnabled(bool))); connect(m_editorWidget,SIGNAL(wordWrapChanged(bool)),m_wordWrapAct,SLOT(setChecked(bool))); connect(m_undoAct,SIGNAL(triggered()),m_editorWidget,SLOT(undo())); connect(m_redoAct,SIGNAL(triggered()),m_editorWidget,SLOT(redo())); connect(m_cutAct,SIGNAL(triggered()),m_editorWidget,SLOT(cut())); connect(m_copyAct,SIGNAL(triggered()),m_editorWidget,SLOT(copy())); connect(m_pasteAct,SIGNAL(triggered()),m_editorWidget,SLOT(paste())); connect(m_selectAllAct,SIGNAL(triggered()),m_editorWidget,SLOT(selectAll())); connect(m_selectBlockAct,SIGNAL(triggered()),m_editorWidget,SLOT(selectBlock())); connect(m_exportHtmlAct,SIGNAL(triggered()),this,SLOT(exportHtml())); #ifndef QT_NO_PRINTER connect(m_exportPdfAct,SIGNAL(triggered()),this,SLOT(exportPdf())); connect(m_filePrintAct,SIGNAL(triggered()),this,SLOT(filePrint())); connect(m_filePrintPreviewAct,SIGNAL(triggered()),this,SLOT(filePrintPreview())); #endif connect(m_gotoPrevBlockAct,SIGNAL(triggered()),m_editorWidget,SLOT(gotoPrevBlock())); connect(m_gotoNextBlockAct,SIGNAL(triggered()),m_editorWidget,SLOT(gotoNextBlock())); connect(m_gotoMatchBraceAct,SIGNAL(triggered()),m_editorWidget,SLOT(gotoMatchBrace())); connect(m_gotoLineAct,SIGNAL(triggered()),this,SLOT(gotoLine())); connect(m_increaseFontSizeAct,SIGNAL(triggered()),this,SLOT(increaseFontSize())); connect(m_decreaseFontSizeAct,SIGNAL(triggered()),this,SLOT(decreaseFontSize())); connect(m_resetFontSizeAct,SIGNAL(triggered()),this,SLOT(resetFontSize())); connect(m_cleanWhitespaceAct,SIGNAL(triggered()),m_editorWidget,SLOT(cleanWhitespace())); connect(m_wordWrapAct,SIGNAL(triggered(bool)),m_editorWidget,SLOT(setWordWrapOverride(bool))); QClipboard *clipboard = QApplication::clipboard(); connect(clipboard,SIGNAL(dataChanged()),this,SLOT(clipbordDataChanged())); clipbordDataChanged(); }
void LiteEditor::createActions() { LiteApi::IActionContext *actionContext = m_liteApp->actionManager()->getActionContext(this,"Editor"); m_undoAct = new QAction(QIcon("icon:liteeditor/images/undo.png"),tr("Undo"),this); actionContext->regAction(m_undoAct,"Undo",QKeySequence::Undo); m_redoAct = new QAction(QIcon("icon:liteeditor/images/redo.png"),tr("Redo"),this); actionContext->regAction(m_redoAct,"Redo","Ctrl+Shift+Z; Ctrl+Y"); m_cutAct = new QAction(QIcon("icon:liteeditor/images/cut.png"),tr("Cut"),this); actionContext->regAction(m_cutAct,"Cut",QKeySequence::Cut); m_copyAct = new QAction(QIcon("icon:liteeditor/images/copy.png"),tr("Copy"),this); actionContext->regAction(m_copyAct,"Copy",QKeySequence::Copy); m_pasteAct = new QAction(QIcon("icon:liteeditor/images/paste.png"),tr("Paste"),this); actionContext->regAction(m_pasteAct,"Paste",QKeySequence::Paste); m_selectAllAct = new QAction(tr("Select All"),this); actionContext->regAction(m_selectAllAct,"SelectAll",QKeySequence::SelectAll); m_exportHtmlAct = new QAction(QIcon("icon:liteeditor/images/exporthtml.png"),tr("Export HTML..."),this); #ifndef QT_NO_PRINTER m_exportPdfAct = new QAction(QIcon("icon:liteeditor/images/exportpdf.png"),tr("Export PDF..."),this); m_filePrintAct = new QAction(QIcon("icon:liteeditor/images/fileprint.png"),tr("Print..."),this); m_filePrintPreviewAct = new QAction(QIcon("icon:liteeditor/images/fileprintpreview.png"),tr("Print Preview..."),this); #endif m_gotoPrevBlockAct = new QAction(tr("Go To Previous Block"),this); actionContext->regAction(m_gotoPrevBlockAct,"GotoPreviousBlock","Ctrl+["); m_gotoNextBlockAct = new QAction(tr("Go To Next Block"),this); actionContext->regAction(m_gotoNextBlockAct,"GotoNextBlock","Ctrl+]"); m_selectBlockAct = new QAction(tr("Select Block"),this); actionContext->regAction(m_selectBlockAct,"SelectBlock","Ctrl+U"); m_gotoMatchBraceAct = new QAction(tr("Go To Matching Brace"),this); actionContext->regAction(m_gotoMatchBraceAct,"GotoMatchBrace","Ctrl+E"); m_foldAct = new QAction(tr("Fold"),this); actionContext->regAction(m_foldAct,"Fold","Ctrl+<"); m_unfoldAct = new QAction(tr("Unfold"),this); actionContext->regAction(m_unfoldAct,"Unfold","Ctrl+>"); m_foldAllAct = new QAction(tr("Fold All"),this); actionContext->regAction(m_foldAllAct,"FoldAll",""); m_unfoldAllAct = new QAction(tr("Unfold All"),this); actionContext->regAction(m_unfoldAllAct,"UnfoldAll",""); connect(m_foldAct,SIGNAL(triggered()),m_editorWidget,SLOT(fold())); connect(m_unfoldAct,SIGNAL(triggered()),m_editorWidget,SLOT(unfold())); connect(m_foldAllAct,SIGNAL(triggered()),m_editorWidget,SLOT(foldAll())); connect(m_unfoldAllAct,SIGNAL(triggered()),m_editorWidget,SLOT(unfoldAll())); m_gotoLineAct = new QAction(tr("Go To Line"),this); actionContext->regAction(m_gotoLineAct,"GotoLine","Ctrl+L"); m_lockAct = new QAction(QIcon("icon:liteeditor/images/lock.png"),tr("Locked"),this); m_lockAct->setEnabled(false); m_duplicateAct = new QAction(tr("Duplicate"),this); actionContext->regAction(m_duplicateAct,"Duplicate","Ctrl+Shift+D"); connect(m_duplicateAct,SIGNAL(triggered()),m_editorWidget,SLOT(duplicate())); m_deleteLineAct = new QAction(tr("Delete Line"),this); actionContext->regAction(m_deleteLineAct,"DeleteLine","Ctrl+Shift+K"); connect(m_deleteLineAct,SIGNAL(triggered()),m_editorWidget,SLOT(deleteLine())); m_copyLineAct = new QAction(tr("Copy Line"),this); actionContext->regAction(m_copyLineAct,"CopyLine","Ctrl+Ins"); connect(m_copyLineAct,SIGNAL(triggered()),m_editorWidget,SLOT(copyLine())); m_cutLineAct = new QAction(tr("Cut Line"),this); actionContext->regAction(m_cutLineAct,"CutLine","Shift+Del"); connect(m_cutLineAct,SIGNAL(triggered()),m_editorWidget,SLOT(cutLine())); m_insertLineBeforeAct = new QAction(tr("Insert Line Before"),this); actionContext->regAction(m_insertLineBeforeAct,"InsertLineBefore","Ctrl+Shift+Return"); connect(m_insertLineBeforeAct,SIGNAL(triggered()),m_editorWidget,SLOT(insertLineBefore())); m_insertLineAfterAct = new QAction(tr("Insert Line After"),this); actionContext->regAction(m_insertLineAfterAct,"InsertLineAfter","Ctrl+Return"); connect(m_insertLineAfterAct,SIGNAL(triggered()),m_editorWidget,SLOT(insertLineAfter())); m_increaseFontSizeAct = new QAction(tr("Increase Font Size"),this); actionContext->regAction(m_increaseFontSizeAct,"IncreaseFontSize","Ctrl++"); m_decreaseFontSizeAct = new QAction(tr("Decrease Font Size"),this); actionContext->regAction(m_decreaseFontSizeAct,"DecreaseFontSize","Ctrl+-"); m_resetFontSizeAct = new QAction(tr("Reset Font Size"),this); actionContext->regAction(m_resetFontSizeAct,"ResetFontSize","Ctrl+0"); m_cleanWhitespaceAct = new QAction(tr("Clean Whitespace"),this); actionContext->regAction(m_cleanWhitespaceAct,"CleanWhitespace",""); m_wordWrapAct = new QAction(tr("Word Wrap (MimeType)"),this); m_wordWrapAct->setCheckable(true); actionContext->regAction(m_wordWrapAct,"WordWrap",""); m_codeCompleteAct = new QAction(tr("Code Complete"),this); #ifdef Q_OS_MAC actionContext->regAction(m_codeCompleteAct,"CodeComplete","Meta+Space"); #else actionContext->regAction(m_codeCompleteAct,"CodeComplete","Ctrl+Space"); #endif m_commentAct = new QAction(tr("Toggle Comment"),this); actionContext->regAction(m_commentAct,"Comment","Ctrl+/"); m_blockCommentAct = new QAction(tr("Toggle Block Commnet"),this); actionContext->regAction(m_blockCommentAct,"BlockComment","Ctrl+Shift+/"); m_autoIndentAct = new QAction(tr("Auto-indent Selection"),this); actionContext->regAction(m_autoIndentAct,"AutoIndent","Ctrl+I"); m_autoIndentAct->setVisible(false); m_tabToSpacesAct = new QAction(tr("Tab To Spaces (MimeType)"),this); actionContext->regAction(m_tabToSpacesAct,"TabToSpaces",""); m_tabToSpacesAct->setCheckable(true); m_lineEndingWindowAct = new QAction(tr("Line End Windows (\\r\\n)"),this); actionContext->regAction(m_lineEndingWindowAct,"LineEndingWindow",""); m_lineEndingWindowAct->setCheckable(true); m_lineEndingUnixAct = new QAction(tr("Line End Unix (\\n)"),this); actionContext->regAction(m_lineEndingUnixAct,"LineEndingUnix",""); m_lineEndingUnixAct->setCheckable(true); m_visualizeWhitespaceAct = new QAction(tr("Visualize Whitespace (Global)"),this); actionContext->regAction(m_visualizeWhitespaceAct,"VisualizeWhitespace",""); m_visualizeWhitespaceAct->setCheckable(true); m_commentAct->setVisible(false); m_blockCommentAct->setVisible(false); m_moveLineUpAction = new QAction(tr("Move Line Up"),this); actionContext->regAction(m_moveLineUpAction,"MoveLineUp","Ctrl+Shift+Up"); m_moveLineDownAction = new QAction(tr("Move Line Down"),this); actionContext->regAction(m_moveLineDownAction,"MoveLineDown","Ctrl+Shift+Down"); m_copyLineUpAction = new QAction(tr("Copy Line Up"),this); actionContext->regAction(m_copyLineUpAction,"CopyLineUp","Ctrl+Alt+Up"); m_copyLineDownAction = new QAction(tr("Copy Line Down"),this); actionContext->regAction(m_copyLineDownAction,"CopyLineDown","Ctrl+Alt+Down"); m_joinLinesAction = new QAction(tr("Join Lines"),this); actionContext->regAction(m_joinLinesAction,"JoinLines","Ctrl+J"); connect(m_codeCompleteAct,SIGNAL(triggered()),m_editorWidget,SLOT(codeCompleter())); // m_widget->addAction(m_foldAct); // m_widget->addAction(m_unfoldAct); // m_widget->addAction(m_gotoLineAct); // m_widget->addAction(m_gotoPrevBlockAct); // m_widget->addAction(m_gotoNextBlockAct); // m_widget->addAction(m_selectBlockAct); // m_widget->addAction(m_gotoMatchBraceAct); connect(m_editorWidget,SIGNAL(undoAvailable(bool)),m_undoAct,SLOT(setEnabled(bool))); connect(m_editorWidget,SIGNAL(redoAvailable(bool)),m_redoAct,SLOT(setEnabled(bool))); connect(m_editorWidget,SIGNAL(copyAvailable(bool)),m_cutAct,SLOT(setEnabled(bool))); connect(m_editorWidget,SIGNAL(copyAvailable(bool)),m_copyAct,SLOT(setEnabled(bool))); connect(m_editorWidget,SIGNAL(wordWrapChanged(bool)),m_wordWrapAct,SLOT(setChecked(bool))); connect(m_undoAct,SIGNAL(triggered()),m_editorWidget,SLOT(undo())); connect(m_redoAct,SIGNAL(triggered()),m_editorWidget,SLOT(redo())); connect(m_cutAct,SIGNAL(triggered()),m_editorWidget,SLOT(cut())); connect(m_copyAct,SIGNAL(triggered()),m_editorWidget,SLOT(copy())); connect(m_pasteAct,SIGNAL(triggered()),m_editorWidget,SLOT(paste())); connect(m_selectAllAct,SIGNAL(triggered()),m_editorWidget,SLOT(selectAll())); connect(m_selectBlockAct,SIGNAL(triggered()),m_editorWidget,SLOT(selectBlock())); connect(m_exportHtmlAct,SIGNAL(triggered()),this,SLOT(exportHtml())); #ifndef QT_NO_PRINTER connect(m_exportPdfAct,SIGNAL(triggered()),this,SLOT(exportPdf())); connect(m_filePrintAct,SIGNAL(triggered()),this,SLOT(filePrint())); connect(m_filePrintPreviewAct,SIGNAL(triggered()),this,SLOT(filePrintPreview())); #endif connect(m_gotoPrevBlockAct,SIGNAL(triggered()),m_editorWidget,SLOT(gotoPrevBlock())); connect(m_gotoNextBlockAct,SIGNAL(triggered()),m_editorWidget,SLOT(gotoNextBlock())); connect(m_gotoMatchBraceAct,SIGNAL(triggered()),m_editorWidget,SLOT(gotoMatchBrace())); connect(m_gotoLineAct,SIGNAL(triggered()),this,SLOT(gotoLine())); connect(m_increaseFontSizeAct,SIGNAL(triggered()),this,SLOT(increaseFontSize())); connect(m_decreaseFontSizeAct,SIGNAL(triggered()),this,SLOT(decreaseFontSize())); connect(m_resetFontSizeAct,SIGNAL(triggered()),this,SLOT(resetFontSize())); connect(m_cleanWhitespaceAct,SIGNAL(triggered()),m_editorWidget,SLOT(cleanWhitespace())); connect(m_wordWrapAct,SIGNAL(triggered(bool)),m_editorWidget,SLOT(setWordWrapOverride(bool))); connect(m_commentAct,SIGNAL(triggered()),this,SLOT(comment())); connect(m_blockCommentAct,SIGNAL(triggered()),this,SLOT(blockComment())); connect(m_autoIndentAct,SIGNAL(triggered()),this,SLOT(autoIndent())); connect(m_tabToSpacesAct,SIGNAL(toggled(bool)),this,SLOT(tabToSpacesToggled(bool))); connect(m_visualizeWhitespaceAct,SIGNAL(toggled(bool)),this,SLOT(toggledVisualizeWhitespace(bool))); connect(m_moveLineUpAction,SIGNAL(triggered()),m_editorWidget,SLOT(moveLineUp())); connect(m_moveLineDownAction,SIGNAL(triggered()),m_editorWidget,SLOT(moveLineDown())); connect(m_copyLineUpAction,SIGNAL(triggered()),m_editorWidget,SLOT(copyLineUp())); connect(m_copyLineDownAction,SIGNAL(triggered()),m_editorWidget,SLOT(copyLineDown())); connect(m_joinLinesAction,SIGNAL(triggered()),m_editorWidget,SLOT(joinLines())); //connect(m_lineEndingWindowAct,SIGNAL(triggered()),this,SLOT(lineEndingWindow())); //connect(m_lineEndingUnixAct,SIGNAL(triggered()),this,SLOT(lineEndingUnixAct())); QActionGroup *group = new QActionGroup(this); group->addAction(m_lineEndingWindowAct); group->addAction(m_lineEndingUnixAct); connect(group,SIGNAL(triggered(QAction*)),this,SLOT(triggeredLineEnding(QAction*))); #ifdef Q_OS_WIN QClipboard *clipboard = QApplication::clipboard(); connect(clipboard,SIGNAL(dataChanged()),this,SLOT(clipbordDataChanged())); clipbordDataChanged(); #endif }
/* * Constructs a TestWindow as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ TestWindow::TestWindow( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { (void)statusBar(); QImage img; img.loadFromData( image0_data, sizeof( image0_data ), "PNG" ); image0 = img; img.loadFromData( image1_data, sizeof( image1_data ), "PNG" ); image1 = img; img.loadFromData( image2_data, sizeof( image2_data ), "PNG" ); image2 = img; img.loadFromData( image3_data, sizeof( image3_data ), "PNG" ); image3 = img; img.loadFromData( image4_data, sizeof( image4_data ), "PNG" ); image4 = img; img.loadFromData( image5_data, sizeof( image5_data ), "PNG" ); image5 = img; img.loadFromData( image6_data, sizeof( image6_data ), "PNG" ); image6 = img; img.loadFromData( image7_data, sizeof( image7_data ), "PNG" ); image7 = img; img.loadFromData( image8_data, sizeof( image8_data ), "PNG" ); image8 = img; img.loadFromData( image9_data, sizeof( image9_data ), "PNG" ); image9 = img; if ( !name ) setName( "TestWindow" ); setCentralWidget( new QWidget( this, "qt_central_widget" ) ); TestWindowLayout = new QVBoxLayout( centralWidget(), 11, 6, "TestWindowLayout"); mainPanel = new QGroupBox( centralWidget(), "mainPanel" ); mainPanel->setPaletteForegroundColor( QColor( 255, 255, 255 ) ); mainPanel->setPaletteBackgroundColor( QColor( 0, 0, 0 ) ); mainPanel->setFrameShadow( QGroupBox::Sunken ); mainPanel->setFlat( FALSE ); grpbuffer = new QGroupBox( mainPanel, "grpbuffer" ); grpbuffer->setGeometry( QRect( 10, 20, 320, 60 ) ); grpbuffer->setPaletteForegroundColor( QColor( 255, 255, 255 ) ); grpbuffer->setFlat( FALSE ); TestWindowLayout->addWidget( mainPanel ); layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); btnStart = new QPushButton( centralWidget(), "btnStart" ); layout1->addWidget( btnStart ); btnStop = new QPushButton( centralWidget(), "btnStop" ); layout1->addWidget( btnStop ); TestWindowLayout->addLayout( layout1 ); // actions fileNewAction = new QAction( this, "fileNewAction" ); fileNewAction->setIconSet( QIconSet( image0 ) ); fileOpenAction = new QAction( this, "fileOpenAction" ); fileOpenAction->setIconSet( QIconSet( image1 ) ); fileSaveAction = new QAction( this, "fileSaveAction" ); fileSaveAction->setIconSet( QIconSet( image2 ) ); fileSaveAsAction = new QAction( this, "fileSaveAsAction" ); filePrintAction = new QAction( this, "filePrintAction" ); filePrintAction->setIconSet( QIconSet( image3 ) ); fileExitAction = new QAction( this, "fileExitAction" ); editUndoAction = new QAction( this, "editUndoAction" ); editUndoAction->setIconSet( QIconSet( image4 ) ); editRedoAction = new QAction( this, "editRedoAction" ); editRedoAction->setIconSet( QIconSet( image5 ) ); editCutAction = new QAction( this, "editCutAction" ); editCutAction->setIconSet( QIconSet( image6 ) ); editCopyAction = new QAction( this, "editCopyAction" ); editCopyAction->setIconSet( QIconSet( image7 ) ); editPasteAction = new QAction( this, "editPasteAction" ); editPasteAction->setIconSet( QIconSet( image8 ) ); editFindAction = new QAction( this, "editFindAction" ); editFindAction->setIconSet( QIconSet( image9 ) ); helpContentsAction = new QAction( this, "helpContentsAction" ); helpIndexAction = new QAction( this, "helpIndexAction" ); helpAboutAction = new QAction( this, "helpAboutAction" ); // toolbars // menubar menubar = new QMenuBar( this, "menubar" ); menubar->setEnabled( FALSE ); menubar->setPaletteBackgroundColor( QColor( 239, 239, 239 ) ); fileMenu = new QPopupMenu( this ); fileNewAction->addTo( fileMenu ); fileOpenAction->addTo( fileMenu ); fileSaveAction->addTo( fileMenu ); fileSaveAsAction->addTo( fileMenu ); fileMenu->insertSeparator(); filePrintAction->addTo( fileMenu ); fileMenu->insertSeparator(); fileExitAction->addTo( fileMenu ); menubar->insertItem( QString(""), fileMenu, 3 ); editMenu = new QPopupMenu( this ); editUndoAction->addTo( editMenu ); editRedoAction->addTo( editMenu ); editMenu->insertSeparator(); editCutAction->addTo( editMenu ); editCopyAction->addTo( editMenu ); editPasteAction->addTo( editMenu ); editMenu->insertSeparator(); editFindAction->addTo( editMenu ); menubar->insertItem( QString(""), editMenu, 4 ); Help = new QPopupMenu( this ); helpContentsAction->addTo( Help ); helpIndexAction->addTo( Help ); Help->insertSeparator(); helpAboutAction->addTo( Help ); menubar->insertItem( QString(""), Help, 5 ); languageChange(); resize( QSize(373, 363).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( fileNewAction, SIGNAL( activated() ), this, SLOT( fileNew() ) ); connect( fileOpenAction, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); connect( fileSaveAction, SIGNAL( activated() ), this, SLOT( fileSave() ) ); connect( fileSaveAsAction, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) ); connect( filePrintAction, SIGNAL( activated() ), this, SLOT( filePrint() ) ); connect( fileExitAction, SIGNAL( activated() ), this, SLOT( fileExit() ) ); connect( editUndoAction, SIGNAL( activated() ), this, SLOT( editUndo() ) ); connect( editRedoAction, SIGNAL( activated() ), this, SLOT( editRedo() ) ); connect( editCutAction, SIGNAL( activated() ), this, SLOT( editCut() ) ); connect( editCopyAction, SIGNAL( activated() ), this, SLOT( editFind() ) ); connect( editPasteAction, SIGNAL( activated() ), this, SLOT( editPaste() ) ); connect( editFindAction, SIGNAL( activated() ), this, SLOT( editFind() ) ); connect( helpIndexAction, SIGNAL( activated() ), this, SLOT( helpIndex() ) ); connect( helpContentsAction, SIGNAL( activated() ), this, SLOT( helpContents() ) ); connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) ); connect( btnStart, SIGNAL( released() ), this, SLOT( add() ) ); connect( btnStop, SIGNAL( released() ), this, SLOT( remove() ) ); }
void DevGUI::setupFileActions() { QToolBar *tb = new QToolBar(this); tb->setWindowTitle(tr("File Actions")); addToolBar(tb); QMenu *menu = new QMenu(tr("&File"), this); menuBar()->addMenu(menu); QAction *a; a = new QAction(QIcon(":/new.png"), tr("&New..."), this); a->setShortcut(Qt::CTRL + Qt::Key_N); connect(a, SIGNAL(triggered()), this, SLOT(fileNew())); tb->addAction(a); menu->addAction(a); a = new QAction(QIcon(":/open.png"), tr("&Open..."), this); a->setShortcut(Qt::CTRL + Qt::Key_O); connect(a, SIGNAL(triggered()), this, SLOT(fileOpen())); tb->addAction(a); menu->addAction(a); menu->addSeparator(); actionSave = a = new QAction(QIcon(":/save.png"), tr("&Save"), this); a->setShortcut(Qt::CTRL + Qt::Key_S); connect(a, SIGNAL(triggered()), this, SLOT(fileSave())); a->setEnabled(false); tb->addAction(a); menu->addAction(a); a = new QAction(QIcon(":/save.png"), tr("Save &As..."), this); connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAs())); a->setEnabled(false); menu->addAction(a); menu->addSeparator(); actionSaveAll = a = new QAction(QIcon(":/saveall.png"), tr("&Save All"), this); a->setShortcut(Qt::CTRL + Qt::Key_A); connect(a, SIGNAL(triggered()), this, SLOT(fileSaveAll())); tb->addAction(a); menu->addAction(a); menu->addSeparator(); a = new QAction(QIcon(":/print.png"), tr("&Print..."), this); a->setShortcut(Qt::CTRL + Qt::Key_P); connect(a, SIGNAL(triggered()), this, SLOT(filePrint())); tb->addAction(a); menu->addAction(a); actionClose = a = new QAction(QIcon(":/close.png"), tr("&Close"), this); a->setShortcut(Qt::CTRL + Qt::Key_W); a->setEnabled(false); connect(a, SIGNAL(triggered()), this, SLOT(fileClose())); tb->addAction(a); menu->addAction(a); menu->addSeparator(); a = new QAction(QIcon(":/exit.png"), tr("E&xit"), this); a->setShortcut(Qt::CTRL + Qt::Key_Q); connect( a, SIGNAL(triggered()), qApp, SLOT( quit() ) ); menu->addAction(a); }
/* * Constructs a MainWindow as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ MainWindow::MainWindow( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { (void)statusBar(); QImage img; img.loadFromData( image0_data, sizeof( image0_data ), "PNG" ); image0 = img; img.loadFromData( image1_data, sizeof( image1_data ), "PNG" ); image1 = img; img.loadFromData( image2_data, sizeof( image2_data ), "PNG" ); image2 = img; img.loadFromData( image3_data, sizeof( image3_data ), "PNG" ); image3 = img; img.loadFromData( image4_data, sizeof( image4_data ), "PNG" ); image4 = img; img.loadFromData( image5_data, sizeof( image5_data ), "PNG" ); image5 = img; img.loadFromData( image6_data, sizeof( image6_data ), "PNG" ); image6 = img; img.loadFromData( image7_data, sizeof( image7_data ), "PNG" ); image7 = img; img.loadFromData( image8_data, sizeof( image8_data ), "PNG" ); image8 = img; img.loadFromData( image9_data, sizeof( image9_data ), "PNG" ); image9 = img; if ( !name ) setName( "MainWindow" ); setCentralWidget( new QWidget( this, "qt_central_widget" ) ); QWidget* privateLayoutWidget = new QWidget( centralWidget(), "layout8" ); privateLayoutWidget->setGeometry( QRect( 1, 11, 340, 300 ) ); layout8 = new QVBoxLayout( privateLayoutWidget, 11, 6, "layout8"); BotonesLector = new QButtonGroup( privateLayoutWidget, "BotonesLector" ); BotonesLector->setColumnLayout(0, Qt::Vertical ); BotonesLector->layout()->setSpacing( 6 ); BotonesLector->layout()->setMargin( 11 ); BotonesLectorLayout = new QHBoxLayout( BotonesLector->layout() ); BotonesLectorLayout->setAlignment( Qt::AlignTop ); layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); pushButton1 = new QPushButton( BotonesLector, "pushButton1" ); layout9->addWidget( pushButton1 ); pushButton2 = new QPushButton( BotonesLector, "pushButton2" ); layout9->addWidget( pushButton2 ); BotonesLectorLayout->addLayout( layout9 ); layout8->addWidget( BotonesLector ); layout6 = new QHBoxLayout( 0, 0, 6, "layout6"); layout5 = new QVBoxLayout( 0, 0, 6, "layout5"); txtSldrTitleTemp = new QLabel( privateLayoutWidget, "txtSldrTitleTemp" ); txtSldrTitleTemp->setFrameShape( QLabel::Box ); txtSldrTitleTemp->setScaledContents( FALSE ); layout5->addWidget( txtSldrTitleTemp ); sldrTemp = new QSlider( privateLayoutWidget, "sldrTemp" ); sldrTemp->setMaxValue( 4 ); sldrTemp->setOrientation( QSlider::Vertical ); layout5->addWidget( sldrTemp ); txtTemp = new QLabel( privateLayoutWidget, "txtTemp" ); QFont txtTemp_font( txtTemp->font() ); txtTemp_font.setPointSize( 8 ); txtTemp->setFont( txtTemp_font ); layout5->addWidget( txtTemp ); layout6->addLayout( layout5 ); Grupo1 = new QGroupBox( privateLayoutWidget, "Grupo1" ); layout6->addWidget( Grupo1 ); layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); txtSldrTitleVelocidad = new QLabel( privateLayoutWidget, "txtSldrTitleVelocidad" ); txtSldrTitleVelocidad->setFrameShape( QLabel::Box ); txtSldrTitleVelocidad->setScaledContents( FALSE ); layout4->addWidget( txtSldrTitleVelocidad ); sldrVelocidad = new QSlider( privateLayoutWidget, "sldrVelocidad" ); sldrVelocidad->setOrientation( QSlider::Vertical ); layout4->addWidget( sldrVelocidad ); txtVelocidad = new QLabel( privateLayoutWidget, "txtVelocidad" ); QFont txtVelocidad_font( txtVelocidad->font() ); txtVelocidad_font.setPointSize( 8 ); txtVelocidad->setFont( txtVelocidad_font ); layout4->addWidget( txtVelocidad ); layout6->addLayout( layout4 ); layout8->addLayout( layout6 ); BotonActivar = new QButtonGroup( privateLayoutWidget, "BotonActivar" ); BotonActivar->setColumnLayout(0, Qt::Vertical ); BotonActivar->layout()->setSpacing( 6 ); BotonActivar->layout()->setMargin( 11 ); BotonActivarLayout = new QHBoxLayout( BotonActivar->layout() ); BotonActivarLayout->setAlignment( Qt::AlignTop ); btnIniciar = new QPushButton( BotonActivar, "btnIniciar" ); btnIniciar->setToggleButton( TRUE ); BotonActivarLayout->addWidget( btnIniciar ); layout8->addWidget( BotonActivar ); // actions fileNewAction = new QAction( this, "fileNewAction" ); fileNewAction->setIconSet( QIconSet( image0 ) ); fileOpenAction = new QAction( this, "fileOpenAction" ); fileOpenAction->setIconSet( QIconSet( image1 ) ); fileSaveAction = new QAction( this, "fileSaveAction" ); fileSaveAction->setIconSet( QIconSet( image2 ) ); fileSaveAsAction = new QAction( this, "fileSaveAsAction" ); filePrintAction = new QAction( this, "filePrintAction" ); filePrintAction->setIconSet( QIconSet( image3 ) ); fileExitAction = new QAction( this, "fileExitAction" ); editUndoAction = new QAction( this, "editUndoAction" ); editUndoAction->setIconSet( QIconSet( image4 ) ); editRedoAction = new QAction( this, "editRedoAction" ); editRedoAction->setIconSet( QIconSet( image5 ) ); editCutAction = new QAction( this, "editCutAction" ); editCutAction->setIconSet( QIconSet( image6 ) ); editCopyAction = new QAction( this, "editCopyAction" ); editCopyAction->setIconSet( QIconSet( image7 ) ); editPasteAction = new QAction( this, "editPasteAction" ); editPasteAction->setIconSet( QIconSet( image8 ) ); editFindAction = new QAction( this, "editFindAction" ); editFindAction->setIconSet( QIconSet( image9 ) ); helpContentsAction = new QAction( this, "helpContentsAction" ); helpIndexAction = new QAction( this, "helpIndexAction" ); helpAboutAction = new QAction( this, "helpAboutAction" ); // toolbars // menubar menubar = new QMenuBar( this, "menubar" ); fileMenu = new QPopupMenu( this ); fileOpenAction->addTo( fileMenu ); fileSaveAction->addTo( fileMenu ); fileMenu->insertSeparator(); fileMenu->insertSeparator(); fileExitAction->addTo( fileMenu ); menubar->insertItem( QString(""), fileMenu, 1 ); helpMenu = new QPopupMenu( this ); helpMenu->insertSeparator(); helpAboutAction->addTo( helpMenu ); menubar->insertItem( QString(""), helpMenu, 2 ); languageChange(); resize( QSize(351, 352).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); // signals and slots connections connect( fileNewAction, SIGNAL( activated() ), this, SLOT( fileNew() ) ); connect( fileOpenAction, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); connect( fileSaveAction, SIGNAL( activated() ), this, SLOT( fileSave() ) ); connect( fileSaveAsAction, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) ); connect( filePrintAction, SIGNAL( activated() ), this, SLOT( filePrint() ) ); connect( fileExitAction, SIGNAL( activated() ), this, SLOT( fileExit() ) ); connect( editUndoAction, SIGNAL( activated() ), this, SLOT( editUndo() ) ); connect( editRedoAction, SIGNAL( activated() ), this, SLOT( editRedo() ) ); connect( editCutAction, SIGNAL( activated() ), this, SLOT( editCut() ) ); connect( editCopyAction, SIGNAL( activated() ), this, SLOT( editCopy() ) ); connect( editPasteAction, SIGNAL( activated() ), this, SLOT( editPaste() ) ); connect( editFindAction, SIGNAL( activated() ), this, SLOT( editFind() ) ); connect( helpIndexAction, SIGNAL( activated() ), this, SLOT( helpIndex() ) ); connect( helpContentsAction, SIGNAL( activated() ), this, SLOT( helpContents() ) ); connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) ); connect( sldrTemp, SIGNAL( valueChanged(int) ), txtTemp, SLOT( setNum(int) ) ); connect( sldrVelocidad, SIGNAL( valueChanged(int) ), txtVelocidad, SLOT( setNum(int) ) ); connect( BotonActivar, SIGNAL( toggled(bool) ), this, SLOT( Activar(bool) ) ); }