From 90e65ce0bf786b0d19d9503cfc3ecb415388fedc Mon Sep 17 00:00:00 2001 From: markuspg Date: Thu, 22 Sep 2016 21:17:45 +0200 Subject: [PATCH] Made 'icons' a QVector on the stack --- src/mainwindow.cpp | 3 +-- src/mainwindow.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7d20c34..7470023 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -24,7 +24,7 @@ lc::MainWindow::MainWindow( QWidget *argParent ) : QMainWindow{ argParent }, - icons{ new QPixmap[ icons_t::ICON_QUANTITY ] }, + icons( static_cast< int >( icons_t::ICON_QUANTITY ) ), ui{ new Ui::MainWindow } { ui->setupUi( this ); @@ -44,7 +44,6 @@ lc::MainWindow::MainWindow( QWidget *argParent ) : lc::MainWindow::~MainWindow() { delete ui; delete valid_items; - delete[] icons; } bool lc::MainWindow::CheckIfUserIsAdmin() { diff --git a/src/mainwindow.h b/src/mainwindow.h index 7b9a470..fbdaccf 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -102,7 +102,7 @@ private: QStandardItemModel *clients_view_model = nullptr; //! The view storing all clients data QTimer *gui_update_timer = nullptr; //! A QTimer triggering updates of the graphical user interface - QPixmap *icons = nullptr; //! Array of pixmaps storing the icons indicating the clients' statuses + QVector< QPixmap > icons; //! Vector of pixmaps storing the icons indicating the clients' statuses Lablib *lablib = nullptr; //! Accumulator of all program logic being accessed by the GUI bool local_zLeaves_are_running = false; //! Stores if a local zLeaf instance is running on the server ('true' if local zLeaf exists) QButtonGroup *userChooseButtonGroup = nullptr; //! Used to group the radio buttons choosing which user shall be used for administrative client actions