Advertisement
Guest User

QT turorial 5 by Derek Banas

a guest
Sep 18th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.03 KB | None | 0 0
  1. // add the following includes.
  2. #include <QInputDialog>
  3.  
  4. #include <QDir>
  5. #include <QFileDialog>
  6. #include <QColorDialog>
  7.  
  8. #include <QMessageBox>
  9.  
  10. MainWindow::MainWindow(QWidget *parent) :
  11.     QMainWindow(parent),
  12.     ui(new Ui::MainWindow)
  13. {
  14.     ui->setupUi(this);
  15.  
  16.     scribbleArea = new ScribbleArea;
  17.     //ui->centralWidget(scriblearea);
  18.     setCentralWidget(scribbleArea);
  19.     //ui->MainWindow::
  20.  
  21.  
  22.     createActions();
  23.     createMenus();
  24.     setWindowTitle("scribble");
  25.     resize(500,500);
  26. }
  27.  
  28. Paint_App/mainwindow.cpp:20: error: 'scribbleArea' was not declared in this scope
  29.      scribbleArea = new ScribbleArea;
  30.      ^
  31.  
  32. Paint_App/mainwindow.cpp:49: error: 'scribbleArea' was not declared in this scope
  33.          scribbleArea->openImage(fileName);
  34.          ^
  35. // void MainWindow::penColor(){
  36. Paint_App/mainwindow.cpp:61: error: 'scribbleArea' was not declared in this scope
  37.      QColor newColor = QColorDialog::getColor(scribbleArea->penColor());
  38.                                               ^
  39.  
  40. // void MainWindow::penWidth(){
  41. Paint_App/mainwindow.cpp:72: error: 'scribbleArea' was not declared in this scope
  42.                                              scribbleArea->penWidth(),
  43.                                              ^
  44. // foreach (QByteArray format, QImageWriter::supportedImageFormats())
  45. Paint_App/mainwindow.cpp:96: error: incomplete type 'QImageWriter' used in nested name specifier
  46.      foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
  47.                                  ^
  48. // connect(printAct, SIGNAL(triggered()), scribbleArea, SLOT(print()));
  49. Paint_App/mainwindow.cpp:112: error: 'scribbleArea' was not declared in this scope
  50.      connect(printAct, SIGNAL(triggered()), scribbleArea, SLOT(print()));
  51.  
  52. // bool MainWindow::saveFile(const QByteArray &fileFormat)                                         ^
  53. Paint_App/mainwindow.cpp:210: error: 'scribbleArea' was not declared in this scope
  54.          return scribbleArea->saveImage(fileName, fileFormat.constData());
  55.                 ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement