]> git.sur5r.net Git - fstl/commitdiff
Made QActions const
authorMatt Keeter <matt.j.keeter@gmail.com>
Sat, 15 Mar 2014 01:49:38 +0000 (21:49 -0400)
committerMatt Keeter <matt.j.keeter@gmail.com>
Sat, 15 Mar 2014 01:49:38 +0000 (21:49 -0400)
src/window.cpp
src/window.h

index 885b0a832cdaf51e3f35d24a3c75890cf7a97969..203fff93533c6d4776810b91e3b0b6614b7f493d 100644 (file)
@@ -7,7 +7,11 @@
 #include "loader.h"
 
 Window::Window(QWidget *parent) :
-    QMainWindow(parent)
+    QMainWindow(parent),
+    open_action(new QAction("Open", this)),
+    about_action(new QAction("About", this)),
+    quit_action(new QAction("Quit", this))
+
 {
     setWindowTitle("fstl");
 
@@ -22,17 +26,14 @@ Window::Window(QWidget *parent) :
     canvas = new Canvas(format, this);
     setCentralWidget(canvas);
 
-    open_action = new QAction("Open", this);
     open_action->setShortcut(QKeySequence::Open);
     QObject::connect(open_action, &QAction::triggered,
                      this, &Window::on_open);
 
-    quit_action = new QAction("Quit", this);
     quit_action->setShortcut(QKeySequence::Quit);
     QObject::connect(quit_action, &QAction::triggered,
                      this, &Window::close);
 
-    about_action = new QAction("About", this);
     QObject::connect(about_action, &QAction::triggered,
                      this, &Window::on_about);
 
index 078a7f3c6708623cbfa41bad5f7fc256ddd6f649..866e1033697e848f2a27aa9c4137412d388860d2 100644 (file)
@@ -17,9 +17,9 @@ public slots:
     void on_about();
 
 private:
-    QAction* open_action;
-    QAction* about_action;
-    QAction* quit_action;
+    QAction* const open_action;
+    QAction* const about_action;
+    QAction* const quit_action;
 
     Canvas* canvas;
 };