#include <QLabel>
#include <QMenuBar>
#include <QStatusBar>
+#include <QToolBar>
+#include <QSlider>
+#include <QSpinBox>
+#include <QColorDialog>
#include "connectionmanager.h"
#include "shareboard.h"
createActions();
createMenus();
+ createToolBars();
+
board = new Shareboard(this);
setCentralWidget(board);
}
+void MainWindow::createToolBars() {
+
+ // Create some of the basic tool actions.
+ // They should also be added to an exclusive tool group.
+ QActionGroup* toolGroup = new QActionGroup(this);
+ QAction* penAction = new QAction(QIcon("icons/pen.png"), "Pen", this);
+ QAction* eraserAction = new QAction(QIcon("icons/eraser.png"), "Eraser", this);
+ penAction->setChecked(true);
+ toolGroup->addAction(penAction);
+ toolGroup->addAction(eraserAction);
+
+ // Create some other one-click actions that are not a part of the action group.
+ QAction* imageAction = new QAction(QIcon("icons/import_image.png"), "Import Image", this);
+ QAction* clearAction = new QAction(QIcon("icons/clear.png"), "Clear", this);
+
+ // Style
+ QSpinBox* spinboxWidget = new QSpinBox(this);
+ spinboxWidget->setMinimum(4);
+ spinboxWidget->setMaximum(40);
+
+
+ QPixmap pixmap(16, 16);
+ pixmap.fill(QColor(0, 0, 255));
+ QAction* colorAction = new QAction(QIcon(pixmap), "Select Color", this);
+
+ // Create the history UI elements.
+ QAction* restartAction = new QAction(QIcon("icons/rewind.png"), "Replay History", this);
+ QAction* playAction = new QAction(QIcon("icons/play.png"), "Play", this);
+ QSlider* sliderWidget = new QSlider(Qt::Horizontal, this);
+
+ toolBar = addToolBar("Test");
+ toolBar->setMovable(false);
+
+ toolBar->addSeparator();
+// toolBar->addWidget(new QLabel("Tools", this));
+ toolBar->addAction(penAction);
+ toolBar->addAction(eraserAction);
+ toolBar->addAction(imageAction);
+ toolBar->addAction(clearAction);
+ toolBar->addSeparator();
+
+// toolBar->addWidget(new QLabel("Style", this));
+ toolBar->addWidget(new QLabel("Width: ", this));
+ toolBar->addWidget(spinboxWidget);
+ toolBar->addWidget(new QLabel("Color: ", this));
+ toolBar->addAction(colorAction);
+ toolBar->addSeparator();
+
+// toolBar->addWidget(new QLabel("History", this));
+ toolBar->addAction(restartAction);
+ toolBar->addWidget(sliderWidget);
+ toolBar->addAction(playAction);
+}