Mercurial > hg > octave-lojdl
changeset 15368:36ececf69385
avoid some GCC warnings in the libgui code
* file-editor-interface.h, lexer-octave-gui.cc, main-window.cc,
settings-dialog.cc, workspace-model.cc, workspace-view.cc:
Avoid some shadowed variable, unused switch case, and C-style cast
warnings.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 12 Sep 2012 20:32:57 -0400 |
parents | 501a9cc2c68f |
children | 715220d2b511 |
files | libgui/src/documentation-dockwidget.cc libgui/src/files-dockwidget.cc libgui/src/history-dockwidget.cc libgui/src/m-editor/file-editor-interface.h libgui/src/m-editor/file-editor-tab.cc libgui/src/m-editor/file-editor.cc libgui/src/m-editor/find-dialog.cc libgui/src/m-editor/lexer-octave-gui.cc libgui/src/main-window.cc libgui/src/octave-gui.cc libgui/src/octave-qt-event-listener.cc libgui/src/qtinfo/parser.cc libgui/src/qtinfo/webinfo.cc libgui/src/settings-dialog.cc libgui/src/terminal-dockwidget.cc libgui/src/welcome-wizard.cc libgui/src/workspace-model.cc libgui/src/workspace-model.h libgui/src/workspace-view.cc |
diffstat | 19 files changed, 156 insertions(+), 145 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/documentation-dockwidget.cc +++ b/libgui/src/documentation-dockwidget.cc @@ -26,8 +26,8 @@ #include "documentation-dockwidget.h" -documentation_dock_widget::documentation_dock_widget (QWidget *parent) - : QDockWidget (parent) +documentation_dock_widget::documentation_dock_widget (QWidget *p) + : QDockWidget (p) { setObjectName ("DocumentationDockWidget"); setWindowTitle (tr ("Documentation")); @@ -47,8 +47,8 @@ } void -documentation_dock_widget::closeEvent (QCloseEvent *event) +documentation_dock_widget::closeEvent (QCloseEvent *e) { emit active_changed (false); - QDockWidget::closeEvent (event); + QDockWidget::closeEvent (e); }
--- a/libgui/src/files-dockwidget.cc +++ b/libgui/src/files-dockwidget.cc @@ -34,8 +34,8 @@ #include <QProcess> #include <QDebug> -files_dock_widget::files_dock_widget (QWidget *parent) - : QDockWidget (parent) +files_dock_widget::files_dock_widget (QWidget *p) + : QDockWidget (p) { setObjectName ("FilesDockWidget"); setWindowTitle (tr ("Current Directory")); @@ -88,13 +88,12 @@ SLOT (item_double_clicked (const QModelIndex &))); // Layout the widgets vertically with the toolbar on top - QVBoxLayout * - layout = new QVBoxLayout (); - layout->setSpacing (0); - layout->addWidget (_navigation_tool_bar); - layout->addWidget (_file_tree_view); - layout->setMargin (1); - widget ()->setLayout (layout); + QVBoxLayout *vbox_layout = new QVBoxLayout (); + vbox_layout->setSpacing (0); + vbox_layout->addWidget (_navigation_tool_bar); + vbox_layout->addWidget (_file_tree_view); + vbox_layout->setMargin (1); + widget ()->setLayout (vbox_layout); // TODO: Add right-click contextual menus for copying, pasting, deleting files (and others) connect (_current_directory, SIGNAL (returnPressed ()), @@ -190,8 +189,8 @@ } void -files_dock_widget::closeEvent (QCloseEvent *event) +files_dock_widget::closeEvent (QCloseEvent *e) { emit active_changed (false); - QDockWidget::closeEvent (event); + QDockWidget::closeEvent (e); }
--- a/libgui/src/history-dockwidget.cc +++ b/libgui/src/history-dockwidget.cc @@ -32,8 +32,8 @@ #include "history-dockwidget.h" -history_dock_widget::history_dock_widget (QWidget * parent) - : QDockWidget (parent), octave_event_observer () +history_dock_widget::history_dock_widget (QWidget * p) + : QDockWidget (p), octave_event_observer () { setObjectName ("HistoryDockWidget"); construct (); @@ -106,16 +106,16 @@ _history_list_view->setStatusTip (tr ("Doubleclick a command to transfer it to the terminal.")); _filter_line_edit = new QLineEdit (this); _filter_line_edit->setStatusTip (tr ("Enter text to filter the command history.")); - QVBoxLayout *layout = new QVBoxLayout (); + QVBoxLayout *vbox_layout = new QVBoxLayout (); setWindowTitle (tr ("Command History")); setWidget (new QWidget ()); - layout->addWidget (_history_list_view); - layout->addWidget (_filter_line_edit); - layout->setMargin (2); + vbox_layout->addWidget (_history_list_view); + vbox_layout->addWidget (_filter_line_edit); + vbox_layout->setMargin (2); - widget ()->setLayout (layout); + widget ()->setLayout (vbox_layout); connect (_filter_line_edit, SIGNAL (textEdited (QString)), @@ -172,8 +172,8 @@ } void -history_dock_widget::closeEvent (QCloseEvent *event) +history_dock_widget::closeEvent (QCloseEvent *e) { emit active_changed (false); - QDockWidget::closeEvent (event); + QDockWidget::closeEvent (e); }
--- a/libgui/src/m-editor/file-editor-interface.h +++ b/libgui/src/m-editor/file-editor-interface.h @@ -66,10 +66,10 @@ QTerminal* _terminal; main_window* _main_window; - void closeEvent (QCloseEvent *event) + void closeEvent (QCloseEvent *e) { emit active_changed (false); - QDockWidget::closeEvent (event); + QDockWidget::closeEvent (e); } protected slots:
--- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -91,10 +91,10 @@ _edit_area->autoCompleteFromAll (); _edit_area->setAutoCompletionSource(QsciScintilla::AcsAll); - QVBoxLayout *layout = new QVBoxLayout (); - layout->addWidget (_edit_area); - layout->setMargin (0); - setLayout (layout); + QVBoxLayout *edit_area_layout = new QVBoxLayout (); + edit_area_layout->addWidget (_edit_area); + edit_area_layout->setMargin (0); + setLayout (edit_area_layout); // connect modified signal connect (_edit_area, SIGNAL (modificationChanged (bool)), @@ -158,13 +158,13 @@ } void -file_editor_tab::closeEvent (QCloseEvent *event) +file_editor_tab::closeEvent (QCloseEvent *e) { if (_file_editor->get_main_window ()->is_closing ()) { // close whole application: save file or not if modified check_file_modified ("Closing Octave", 0); // no cancel possible - event->accept (); + e->accept (); } else { @@ -173,11 +173,11 @@ if (check_file_modified ("Close File", QMessageBox::Cancel) == QMessageBox::Cancel) { - event->ignore (); + e->ignore (); } else { - event->accept(); + e->accept(); } } } @@ -197,18 +197,18 @@ Q_UNUSED (state); if (margin == 1) { - unsigned int mask = _edit_area->markersAtLine (line); + unsigned int markers_mask = _edit_area->markersAtLine (line); if (state & Qt::ControlModifier) { - if (mask && (1 << bookmark)) + if (markers_mask && (1 << bookmark)) _edit_area->markerDelete(line,bookmark); else _edit_area->markerAdd(line,bookmark); } else { - if (mask && (1 << breakpoint)) + if (markers_mask && (1 << breakpoint)) { request_remove_breakpoint (line); }
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -35,12 +35,12 @@ #include <QStyle> #include <QTextStream> -file_editor::file_editor (QTerminal *terminal, main_window *m) - : file_editor_interface(terminal, m) +file_editor::file_editor (QTerminal *t, main_window *m) + : file_editor_interface (t, m) { construct (); - _terminal = terminal; + _terminal = t; _main_window = m; setVisible (false); } @@ -387,12 +387,12 @@ void file_editor::construct () { - QWidget *widget = new QWidget (this); - QStyle *style = QApplication::style (); + QWidget *editor_widget = new QWidget (this); + QStyle *editor_style = QApplication::style (); - _menu_bar = new QMenuBar (widget); - _tool_bar = new QToolBar (widget); - _tab_widget = new QTabWidget (widget); + _menu_bar = new QMenuBar (editor_widget); + _tool_bar = new QToolBar (editor_widget); + _tab_widget = new QTabWidget (editor_widget); _tab_widget->setTabsClosable (true); QAction *new_action = new QAction (QIcon(":/actions/icons/filenew.png"), @@ -529,13 +529,13 @@ _run_menu->addAction (_run_action); _menu_bar->addMenu (_run_menu); - QVBoxLayout *layout = new QVBoxLayout (); - layout->addWidget (_menu_bar); - layout->addWidget (_tool_bar); - layout->addWidget (_tab_widget); - layout->setMargin (0); - widget->setLayout (layout); - setWidget (widget); + QVBoxLayout *vbox_layout = new QVBoxLayout (); + vbox_layout->addWidget (_menu_bar); + vbox_layout->addWidget (_tool_bar); + vbox_layout->addWidget (_tab_widget); + vbox_layout->setMargin (0); + editor_widget->setLayout (vbox_layout); + setWidget (editor_widget); connect (new_action, SIGNAL (triggered ()), this, SLOT (request_new_file ())); @@ -586,7 +586,7 @@ resize (500, 400); setWindowIcon (QIcon::fromTheme ("accessories-text-editor", - style->standardIcon (QStyle::SP_FileIcon))); + editor_style->standardIcon (QStyle::SP_FileIcon))); setWindowTitle ("Octave Editor"); //restore previous session
--- a/libgui/src/m-editor/find-dialog.cc +++ b/libgui/src/m-editor/find-dialog.cc @@ -47,8 +47,8 @@ #include <QIcon> #include "find-dialog.h" -find_dialog::find_dialog (QsciScintilla* edit_area, QWidget *parent) - : QDialog (parent) +find_dialog::find_dialog (QsciScintilla* edit_area, QWidget *p) + : QDialog (p) { setWindowTitle ("Find and Replace"); setWindowIcon (QIcon(":/actions/icons/logo.png"));
--- a/libgui/src/m-editor/lexer-octave-gui.cc +++ b/libgui/src/m-editor/lexer-octave-gui.cc @@ -31,8 +31,8 @@ // ----------------------------------------------------- // Some basic functions // ----------------------------------------------------- -lexer_octave_gui::lexer_octave_gui(QObject *parent) - : QsciLexer(parent) // inherit from base lexer +lexer_octave_gui::lexer_octave_gui (QObject *p) + : QsciLexer (p) { }
--- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -41,8 +41,8 @@ #include "file-editor.h" #include "settings-dialog.h" -main_window::main_window (QWidget * parent) - : QMainWindow (parent), octave_event_observer () +main_window::main_window (QWidget *p) + : QMainWindow (p), octave_event_observer () { // We have to set up all our windows, before we finally launch octave. construct (); @@ -185,10 +185,10 @@ // FIXME -- what should happen if settings is 0? - QFont font = QFont(); - font.setFamily(settings->value("terminal/fontName").toString()); - font.setPointSize(settings->value("terminal/fontSize").toInt ()); - _terminal->setTerminalFont(font); + QFont term_font = QFont(); + term_font.setFamily(settings->value("terminal/fontName").toString()); + term_font.setPointSize(settings->value("terminal/fontSize").toInt ()); + _terminal->setTerminalFont (term_font); QString cursorType = settings->value ("terminal/cursorType").toString (); bool cursorBlinking = settings->value ("terminal/cursorBlinking").toBool (); @@ -422,9 +422,9 @@ } void -main_window::closeEvent (QCloseEvent * closeEvent) +main_window::closeEvent (QCloseEvent *e) { - closeEvent->ignore (); + e->ignore (); octave_link::instance ()->post_event (new octave_exit_event (*this)); }
--- a/libgui/src/octave-gui.cc +++ b/libgui/src/octave-gui.cc @@ -30,7 +30,8 @@ #include <iostream> -#include <syswait.h> +#include "lo-utils.h" +#include "syswait.h" #include "welcome-wizard.h" #include "resource-manager.h" @@ -69,7 +70,8 @@ waitpid (pid, &status, 0); - exit (WIFEXITED (status) ? WEXITSTATUS (status) : 127); + exit (octave_wait::ifexited (status) + ? octave_wait::exitstatus (status) : 127); } #endif
--- a/libgui/src/octave-qt-event-listener.cc +++ b/libgui/src/octave-qt-event-listener.cc @@ -27,8 +27,8 @@ #include "octave-qt-event-listener.h" #include <QApplication> -octave_qt_event_listener::octave_qt_event_listener (QObject *parent) - : QObject (parent), octave_event_listener () +octave_qt_event_listener::octave_qt_event_listener (QObject *p) + : QObject (p), octave_event_listener () { }
--- a/libgui/src/qtinfo/parser.cc +++ b/libgui/src/qtinfo/parser.cc @@ -30,8 +30,8 @@ #include <QProcess> #include <QBuffer> -parser::parser(QObject *parent) - : QObject(parent) +parser::parser(QObject *p) + : QObject(p) { _compressors_map.insert ("bz2", "bzip2 -dc \"%1\""); _compressors_map.insert ("gz", "gzip -dc \"%1\"");
--- a/libgui/src/qtinfo/webinfo.cc +++ b/libgui/src/qtinfo/webinfo.cc @@ -30,53 +30,53 @@ #include "defaults.h" -webinfo::webinfo (QWidget *parent) - : QWidget (parent) +webinfo::webinfo (QWidget *p) + : QWidget (p) { _font_web = font (); - QVBoxLayout *layout = new QVBoxLayout (); - layout->setMargin (0); - setLayout (layout); + QVBoxLayout *vbox_layout = new QVBoxLayout (); + vbox_layout->setMargin (0); + setLayout (vbox_layout); - QHBoxLayout *hboxLayout = new QHBoxLayout (); - hboxLayout->setMargin (2); - layout->addLayout (hboxLayout); + QHBoxLayout *hbox_layout = new QHBoxLayout (); + hbox_layout->setMargin (2); + vbox_layout->addLayout (hbox_layout); _close_tab_button = new QPushButton (this); _close_tab_button->setSizePolicy (QSizePolicy::Fixed,QSizePolicy::Preferred); _close_tab_button->setIcon (QIcon (":/actions/icons/stop.png")); - hboxLayout->addWidget (_close_tab_button); + hbox_layout->addWidget (_close_tab_button); _tab_bar = new QTabBar (this); _tab_bar->setSizePolicy (QSizePolicy::Preferred,QSizePolicy::Preferred); _tab_bar->setExpanding (false); - hboxLayout->addWidget (_tab_bar); + hbox_layout->addWidget (_tab_bar); _zoom_in_button = new QToolButton (this); _zoom_in_button->setSizePolicy (QSizePolicy::Fixed,QSizePolicy::Preferred); _zoom_in_button->setIcon (QIcon (":/actions/icons/zoom-in.png")); - hboxLayout->addWidget (_zoom_in_button); + hbox_layout->addWidget (_zoom_in_button); _zoom_out_button = new QToolButton (this); _zoom_out_button->setSizePolicy (QSizePolicy::Fixed,QSizePolicy::Preferred); _zoom_out_button->setIcon (QIcon (":/actions/icons/zoom-out.png")); - hboxLayout->addWidget (_zoom_out_button); + hbox_layout->addWidget (_zoom_out_button); _stacked_widget = new QStackedWidget (this); - layout->addWidget (_stacked_widget); + vbox_layout->addWidget (_stacked_widget); - hboxLayout = new QHBoxLayout (); - layout->addLayout (hboxLayout); + hbox_layout = new QHBoxLayout (); + vbox_layout->addLayout (hbox_layout); _search_line_edit = new QLineEdit(this); #ifdef HAVE_SETPLACEHOLDERTEXT _search_line_edit->setPlaceholderText (tr ("Type here and press \'Return\' to search")); #endif - hboxLayout->addWidget (_search_line_edit); + hbox_layout->addWidget (_search_line_edit); _search_check_box = new QCheckBox (tr ("Global search")); - hboxLayout->addWidget (_search_check_box); + hbox_layout->addWidget (_search_check_box); connect (_close_tab_button, SIGNAL (clicked ()), this, SLOT (close_tab ())); connect (_tab_bar, SIGNAL (currentChanged (int)), this, SLOT (current_tab_changed (int))); @@ -130,8 +130,8 @@ void webinfo::current_tab_changed (int index) { - QVariant data = _tab_bar->tabData (index); - _text_browser = (QTextBrowser*) (data.value<void*> ()); + QVariant tab_data = _tab_bar->tabData (index); + _text_browser = (QTextBrowser*) (tab_data.value<void*> ()); _stacked_widget->setCurrentIndex (_stacked_widget->indexOf (_text_browser)); @@ -156,9 +156,9 @@ int nt = _tab_bar->addTab (name); _tab_bar->setCurrentIndex (nt); - QVariant data; - data.setValue ( (void*)_text_browser); - _tab_bar->setTabData (nt, data); + QVariant tab_data; + tab_data.setValue ( (void*)_text_browser); + _tab_bar->setTabData (nt, tab_data); connect (_tab_bar, SIGNAL (currentChanged (int)), this, SLOT (current_tab_changed (int))); @@ -180,8 +180,8 @@ void webinfo::closeTab (int index) { - QVariant data = _tab_bar->tabData (index); - QWidget *w = (QWidget*) (data.value<void*> ()); + QVariant tab_data = _tab_bar->tabData (index); + QWidget *w = (QWidget*) (tab_data.value<void*> ()); _stacked_widget->removeWidget (w); delete w;
--- a/libgui/src/settings-dialog.cc +++ b/libgui/src/settings-dialog.cc @@ -29,8 +29,8 @@ #include "ui-settings-dialog.h" #include <QSettings> -settings_dialog::settings_dialog (QWidget * parent): - QDialog (parent), ui (new Ui::settings_dialog) +settings_dialog::settings_dialog (QWidget *p): + QDialog (p), ui (new Ui::settings_dialog) { ui->setupUi (this);
--- a/libgui/src/terminal-dockwidget.cc +++ b/libgui/src/terminal-dockwidget.cc @@ -26,8 +26,8 @@ #include "terminal-dockwidget.h" -terminal_dock_widget::terminal_dock_widget (QTerminal *terminal, QWidget *parent) - : QDockWidget (parent) +terminal_dock_widget::terminal_dock_widget (QTerminal *terminal, QWidget *p) + : QDockWidget (p) { setObjectName ("TerminalDockWidget"); setWindowTitle (tr ("Command Window"));
--- a/libgui/src/welcome-wizard.cc +++ b/libgui/src/welcome-wizard.cc @@ -27,9 +27,8 @@ #include "welcome-wizard.h" #include "ui-welcome-wizard.h" -welcome_wizard::welcome_wizard (QWidget *parent) : - QDialog (parent), - _ui (new Ui::welcome_wizard) +welcome_wizard::welcome_wizard (QWidget *p) + : QDialog (p), _ui (new Ui::welcome_wizard) { _ui->setupUi (this); connect (_ui->nextButton1, SIGNAL (clicked ()), this, SLOT (next ()));
--- a/libgui/src/workspace-model.cc +++ b/libgui/src/workspace-model.cc @@ -34,8 +34,8 @@ #include "workspace-model.h" #include "octave-link.h" -workspace_model::workspace_model(QObject *parent) - : QAbstractItemModel(parent), octave_event_observer () +workspace_model::workspace_model(QObject *p) + : QAbstractItemModel (p), octave_event_observer () { QList<QVariant> rootData; rootData << tr ("Name") << tr ("Class") << tr("Dimension") << tr ("Value"); @@ -95,9 +95,20 @@ switch (s.scope ()) { - case symbol_information::local: top_level_item (0)->add_child (child); break; - case symbol_information::global: top_level_item (1)->add_child (child); break; - case symbol_information::persistent: top_level_item (2)->add_child (child); break; + case symbol_information::local: + top_level_item (0)->add_child (child); + break; + + case symbol_information::global: + top_level_item (1)->add_child (child); + break; + + case symbol_information::persistent: + top_level_item (2)->add_child (child); + break; + + default: + break; } } @@ -118,17 +129,17 @@ } QModelIndex -workspace_model::index(int row, int column, const QModelIndex &parent) const +workspace_model::index(int row, int column, const QModelIndex &p) const { - if (!hasIndex(row, column, parent)) + if (!hasIndex(row, column, p)) return QModelIndex(); tree_item *parentItem; - if (!parent.isValid()) + if (!p.isValid()) parentItem = _rootItem; else - parentItem = static_cast<tree_item*>(parent.internalPointer()); + parentItem = static_cast<tree_item*>(p.internalPointer()); tree_item *childItem = parentItem->child(row); if (childItem) @@ -138,12 +149,12 @@ } QModelIndex -workspace_model::parent(const QModelIndex &index) const +workspace_model::parent(const QModelIndex &idx) const { - if (!index.isValid()) + if (!idx.isValid()) return QModelIndex(); - tree_item *childItem = static_cast<tree_item*>(index.internalPointer()); + tree_item *childItem = static_cast<tree_item*>(idx.internalPointer()); if (childItem) { @@ -159,25 +170,25 @@ } int -workspace_model::rowCount(const QModelIndex &parent) const +workspace_model::rowCount(const QModelIndex &p) const { tree_item *parentItem; - if (parent.column() > 0) + if (p.column() > 0) return 0; - if (!parent.isValid()) + if (!p.isValid()) parentItem = _rootItem; else - parentItem = static_cast<tree_item*>(parent.internalPointer()); + parentItem = static_cast<tree_item*>(p.internalPointer()); return parentItem->child_count(); } int -workspace_model::columnCount(const QModelIndex &parent) const +workspace_model::columnCount(const QModelIndex &p) const { - if (parent.isValid()) - return static_cast<tree_item*>(parent.internalPointer())->column_count(); + if (p.isValid()) + return static_cast<tree_item*>(p.internalPointer())->column_count(); else return _rootItem->column_count(); } @@ -195,9 +206,9 @@ } Qt::ItemFlags -workspace_model::flags(const QModelIndex &index) const +workspace_model::flags(const QModelIndex &idx) const { - if (!index.isValid()) + if (!idx.isValid()) return 0; return Qt::ItemIsEnabled | Qt::ItemIsSelectable; @@ -213,16 +224,16 @@ } QVariant -workspace_model::data(const QModelIndex &index, int role) const +workspace_model::data(const QModelIndex &idx, int role) const { - if (!index.isValid()) + if (!idx.isValid()) return QVariant(); if (role != Qt::DisplayRole) return QVariant(); - tree_item *item = static_cast<tree_item*>(index.internalPointer()); + tree_item *item = static_cast<tree_item*>(idx.internalPointer()); - return item->data(index.column()); + return item->data(idx.column()); }
--- a/libgui/src/workspace-model.h +++ b/libgui/src/workspace-model.h @@ -35,15 +35,15 @@ class tree_item { public: - tree_item (const QList<QVariant> &data, tree_item *parent = 0) { - _parent_item = parent; - _item_data = data; + tree_item (const QList<QVariant> &d, tree_item *p = 0) { + _parent_item = p; + _item_data = d; } - tree_item (QVariant data = QVariant(), tree_item *parent = 0) { + tree_item (QVariant d = QVariant(), tree_item *p = 0) { QList<QVariant> variantList; - variantList << data << QVariant () << QVariant () << QVariant (); - _parent_item = parent; + variantList << d << QVariant () << QVariant () << QVariant (); + _parent_item = p; _item_data = variantList; } @@ -75,13 +75,13 @@ return _item_data[column]; } - void set_data (int column, QVariant data) + void set_data (int column, QVariant d) { - _item_data[column] = data; + _item_data[column] = d; } - tree_item *child (int row) { - return _child_items[row]; + tree_item *child (int r) { + return _child_items[r]; } int child_count () const {
--- a/libgui/src/workspace-view.cc +++ b/libgui/src/workspace-view.cc @@ -30,8 +30,8 @@ #include <QVBoxLayout> #include <QPushButton> -workspace_view::workspace_view (QWidget * parent) : QDockWidget - (parent) +workspace_view::workspace_view (QWidget *p) + : QDockWidget (p) { setObjectName ("WorkspaceView"); setWindowTitle (tr ("Workspace")); @@ -51,12 +51,12 @@ setWidget (new QWidget (this)); // Create a new layout and add widgets to it. - QVBoxLayout *layout = new QVBoxLayout (); - layout->addWidget (_workspace_tree_view); - layout->setMargin (2); + QVBoxLayout *vbox_layout = new QVBoxLayout (); + vbox_layout->addWidget (_workspace_tree_view); + vbox_layout->setMargin (2); // Set the empty widget to have our layout. - widget ()->setLayout (layout); + widget ()->setLayout (vbox_layout); // Initialize collapse/expand state of the workspace subcategories. @@ -205,8 +205,8 @@ } void -workspace_view::closeEvent (QCloseEvent *event) +workspace_view::closeEvent (QCloseEvent *e) { emit active_changed (false); - QDockWidget::closeEvent (event); + QDockWidget::closeEvent (e); }