-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
46 lines (42 loc) · 1.3 KB
/
mainwindow.cpp
File metadata and controls
46 lines (42 loc) · 1.3 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "mainwindow.h"
#include "strip.h"
#include "ui_mainwindow.h"
#include <QDebug>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
centralWidget()->setAttribute(Qt::WA_TransparentForMouseEvents);
setMouseTracking(true);
}
//TODO: fix cllicking on strip.
//TODO: Strip reposition method in Strip
void MainWindow::mouseReleaseEvent(QMouseEvent *event) {
Strip* s = new Strip(ui->centralWidget);
s->move(ui->stageBarFrame->x()
+ ui->leftBar1->x()
+ ui->leftBar1->width()/2,
ui->stageBarFrame->y()
+ ui->leftBar1->y()
+ stripVec.size() * (s->height() + 5));
stripVec.push_back(s);
s->setHidden(false);
}
void MainWindow::resizeEvent(QResizeEvent *event) {
//QMainWindow::resizeEvent(event);
QFrame* stageBarFrame = ui->stageBarFrame;
qDebug() << stageBarFrame->x() << " " << stageBarFrame->y();
stageBarFrame->setGeometry(stageBarFrame->x(),
stageBarFrame->y(),
stageBarFrame->width(),
height()- 18);
}
MainWindow::~MainWindow()
{
while (!stripVec.empty()) {
delete stripVec[stripVec.size()-1];
stripVec.pop_back();
}
delete ui;
}