Permalink
Browse files

Allow the user to clear a slide.

  • Loading branch information...
1 parent 35201a0 commit fe04cb8bc99b903c85a39c55b1b9944c904a9b76 @tstaerk committed Sep 6, 2011
Showing with 20 additions and 21 deletions.
  1. +5 −7 mainwindow.cpp
  2. +5 −4 mainwindow.h
  3. +6 −0 moreform.cpp
  4. +3 −9 moreform.h
  5. +1 −1 moreform.ui
View
@@ -51,6 +51,11 @@ void MainWindow::deletemoreform()
ui->morebutton->setText(tr("More"));
}
+void MainWindow::clearactualpage()
+{
+ ui->graphicsView->scene()->clear();
+}
+
void MainWindow::saveactualpage(QString filename)
{
QImage* image=new QImage(QSize((int)ui->graphicsView->scene()->width(),(int)ui->graphicsView->scene()->height()),QImage::Format_RGB32);
@@ -107,10 +112,3 @@ void MainWindow::on_morebutton_clicked()
}
}
-
-void MainWindow::on_pushButton_2_clicked()
-{
- qDebug() << "entering";
- QString filename=QFileDialog::getSaveFileName(0);
-
-}
View
@@ -3,20 +3,23 @@
#include <QMainWindow>
-namespace Ui {
+namespace Ui
+{
class MainWindow;
}
class MoreForm;
-class MainWindow : public QMainWindow {
+class MainWindow : public QMainWindow
+{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
int page;
void setpencolor(QColor color);
void deletemoreform();
+ void clearactualpage();
void saveactualpage(QString filename=QString());
protected:
@@ -28,12 +31,10 @@ class MainWindow : public QMainWindow {
QColor pencolor;
private slots:
-
void loadpage(int page);
void on_nextbutton_clicked();
void on_prevbutton_clicked();
void on_morebutton_clicked();
- void on_pushButton_2_clicked();
};
#endif // MAINWINDOW_H
View
@@ -75,3 +75,9 @@ void MoreForm::on_savebutton_clicked()
//TODO: What if the user cancels the dialog?
parent->saveactualpage(QFileDialog::getSaveFileName(0));
}
+
+void MoreForm::on_clearbutton_clicked()
+{
+ parent->clearactualpage();
+ parent->deletemoreform();
+}
View
@@ -4,7 +4,8 @@
#include "mainwindow.h"
#include <QWidget>
-namespace Ui {
+namespace Ui
+{
class MoreForm;
class MainWindow;
}
@@ -20,22 +21,15 @@ class MoreForm : public QWidget
private slots:
void on_red_clicked();
void on_black_clicked();
-
void on_yellow_clicked();
-
void on_gray_clicked();
-
void on_green_clicked();
-
void on_blue_clicked();
-
void on_white_clicked();
-
void on_purple_clicked();
-
void on_turquoise_clicked();
-
void on_savebutton_clicked();
+ void on_clearbutton_clicked();
private:
Ui::MoreForm *ui;
View
@@ -3830,7 +3830,7 @@
</layout>
</item>
<item row="2" column="1">
- <widget class="QPushButton" name="pushButton_2">
+ <widget class="QPushButton" name="clearbutton">
<property name="text">
<string>Clear Slide</string>
</property>

0 comments on commit fe04cb8

Please sign in to comment.