-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtoolbar.cpp
More file actions
32 lines (27 loc) · 831 Bytes
/
toolbar.cpp
File metadata and controls
32 lines (27 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "main_window.h"
#include "draw_area.h"
/**
* @brief ToolBar::ToolBar - Wrapper class for QToolBar.
* construct a ToolBar with icons & actions.
*/
ToolBar::ToolBar(QWidget *parent, const QList<QAction*> &imageActions,
const QList<QAction*> &toolActions)
: QToolBar(parent)
{
this->imageActions = imageActions;
this->toolActions = toolActions;
// make sure we can't move or hide the toolbar
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
setContextMenuPolicy(Qt::PreventContextMenu);
setMovable(false);
createActions();
}
/**
* @brief ToolBar::createActions - Populate the toolbar with actions
*/
void ToolBar::createActions()
{
addActions(imageActions);
addSeparator();
addActions(toolActions);
}