09faf6ceb6312d6a3c446c630487af76fb1134ae
[groove] / bottombar.cpp
1 #include "bottombar.h"
2 #include "ui_bottombar.h"
3
4 bottomBar::bottomBar(QWidget *parent) :
5     QWidget(parent),
6     ui(new Ui::bottomBar)
7 {
8     ui->setupUi(this);
9     QRect screenGeometry = QApplication::desktop()->screenGeometry();
10     QGraphicsScene *main = new QGraphicsScene(0,0,screenGeometry.width(),15);
11     ui->graphicsView->setScene(main);
12     ui->graphicsView->setSceneRect(0,0,screenGeometry.width(),15);
13     ui->graphicsView->setTransformationAnchor(QGraphicsView::NoAnchor);
14     main->setBackgroundBrush(this->palette().window());
15     main->setSceneRect(0,0,screenGeometry.width(),15);
16     main->addRect(0,0,screenGeometry.width()/2,15,QPen(Qt::white),QBrush(Qt::white));
17 }
18
19 bottomBar::~bottomBar()
20 {
21     delete ui;
22 }
23 void bottomBar::on_addButton_clicked()
24 {
25     emit this->addB();
26 }
27
28 void bottomBar::changeEvent(QEvent *e)
29 {
30     QWidget::changeEvent(e);
31     switch (e->type()) {
32     case QEvent::LanguageChange:
33         ui->retranslateUi(this);
34         break;
35     default:
36         break;
37     }
38 }