This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

CModEditor.cpp

By: egor7 on Jul 12th, 2011  |  syntax: C++ (with Qt extensions)  |  size: 0.75 KB  |  views: 133  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <QtGui>
  2. #include <QDebug>
  3.  
  4. #include "CModEditor.h"
  5.  
  6. CModEditor::CModEditor(QWidget *parent)
  7. : QWidget(parent)
  8. , mainWnd( (QMainWindow*)parent )
  9. {
  10.  
  11.         createActions();
  12.         createToolBars();
  13.         interCom();
  14.  
  15. }
  16.  
  17. void CModEditor::cut()
  18.  
  19. {
  20.         qDebug() << "cut";
  21. }
  22. void CModEditor::createActions()
  23. {
  24.  
  25.         cutAct = new QAction(tr("Cu&t"), this);
  26.         cutAct->setShortcuts(QKeySequence::Cut);
  27.         cutAct->setStatusTip(tr("Cut the current selection's contents to the clipboard"));
  28.  
  29. }
  30.  
  31. void CModEditor::createToolBars()
  32. {
  33.  
  34.         editToolBar = mainWnd->addToolBar(tr("Edit"));
  35.         editToolBar->addAction(cutAct);
  36.         editToolBar->setIconSize(QSize(16, 16));
  37.  
  38. }
  39.  
  40. void CModEditor::interCom()
  41. {
  42.  
  43.         connect(cutAct, SIGNAL(triggered()), this, SLOT(cut()));
  44.  
  45. }
clone this paste RAW Paste Data