QObject::connect(colorAction, SIGNAL(triggered()), this, SLOT(chooseColor()));
QObject::connect(clearAction, SIGNAL(triggered()), this, SLOT(clearBoard()));
+ QObject::connect(board, SIGNAL(rangeChanged(int)), this, SLOT(updateSliderRange(int)));
+ QObject::connect(board, SIGNAL(indexChanged(int)), sliderWidget, SLOT(setValue(int)));
+ QObject::connect(sliderWidget, SIGNAL(valueChanged(int)), board, SLOT(jumpToIndex(int)));
+
+
statusBar()->showMessage("Ready");
}
}
+void MainWindow::updateSliderRange(int newmax) {
+ sliderWidget->setRange(0, newmax);
+}
+
void MainWindow::chooseColor() {
lineColor = QColorDialog::getColor(lineColor, this, "Choose drawing color");
// update pixmap
// 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);
+ sliderWidget = new QSlider(Qt::Horizontal, this);
toolBar = addToolBar("Test");
toolBar->setMovable(false);
class Shareboard;
class Action;
class QSpinBox;
+class QSlider;
class MainWindow : public QMainWindow {
Q_OBJECT
void chooseColor();
void clearBoard();
void marshallAction(Action* action);
+ void updateSliderRange(int newmax);
private:
void createActions();
void createMenus();
QAction* colorAction;
QAction* clearAction;
QSpinBox* spinboxWidget;
+ QSlider* sliderWidget;
ConnectionManager* connMan;
// HistoryManager* historyManager;
Shareboard* board;
//void jumpToTime(QDateTime time);
signals:
+ void rangeChanged(int max);
+ void indexChanged(int index);
void connectToServer(QString, QString);
void actionHappened(Action* action);