From 7c34bb558c0059ec85db778fa5c2f8c0df9e695e Mon Sep 17 00:00:00 2001 From: Elias Woods Date: Thu, 6 Jan 2011 15:01:57 -0500 Subject: [PATCH 1/1] Hopefully this fixes the progress bar on the autobuilder --- Makefile | 4 ++-- bottombar.cpp | 13 ++++++------- bottombar.h | 1 + bottombar.ui | 6 ++++++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 75253f8..ac47886 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: groove -# Generated by qmake (2.01a) (Qt 4.7.0) on: Wed Jan 5 17:21:15 2011 +# Generated by qmake (2.01a) (Qt 4.7.0) on: Thu Jan 6 02:27:50 2011 # Project: Groove.pro # Template: app # Command: /usr/bin/qmake -o Makefile Groove.pro @@ -16,7 +16,7 @@ CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/phonon -I/usr/include/qt4 -I. -I/usr/include/qjson -I/usr/include -I/usr/include/qt4/phonon_compat -I. -I. LINK = g++ LFLAGS = -Wl,-O1 -LIBS = $(SUBLIBS) -L/usr/lib -L/usr/local/lib -lqjson -lpulse-simple -lphonon -lQtGui -lQtNetwork -lQtCore -lpthread +LIBS = $(SUBLIBS) -L/usr/lib -L/usr/local/lib -lqjson -lphonon -lQtGui -lQtNetwork -lQtCore -lpthread AR = ar cqs RANLIB = QMAKE = /usr/bin/qmake diff --git a/bottombar.cpp b/bottombar.cpp index 7e7914e..8ca6d64 100644 --- a/bottombar.cpp +++ b/bottombar.cpp @@ -7,14 +7,13 @@ bottomBar::bottomBar(QWidget *parent) : ui(new Ui::bottomBar) { ui->setupUi(this); - QRect screenGeometry = QApplication::desktop()->screenGeometry(); - main = new QGraphicsScene(0,0,screenGeometry.width(),15); + main = new QGraphicsScene(0,0,this->width(),15); ui->graphicsView->setScene(main); - ui->graphicsView->setSceneRect(0,0,screenGeometry.width(),15); - ui->graphicsView->setTransformationAnchor(QGraphicsView::NoAnchor); + ui->graphicsView->setSceneRect(0,0,this->width(),15); + //ui->graphicsView->setTransformationAnchor(QGraphicsView::NoAnchor); main->setBackgroundBrush(this->palette().window()); - main->setSceneRect(0,0,screenGeometry.width(),15); - this->playbackProgress = main->addRect(0,0,screenGeometry.width()/2,15,QPen(Qt::white),QBrush(Qt::white)); + main->setSceneRect(0,0,this->width(),15); + this->playbackProgress = main->addRect(0,0,this->width()/2,15,QPen(Qt::white),QBrush(Qt::white)); #ifndef Q_WS_MAEMO_5 ui->stopButton->setIcon(QIcon::fromTheme("media-playback-stop")); ui->pauseB->setIcon(QIcon::fromTheme("media-playback-pause")); @@ -32,7 +31,7 @@ bottomBar::~bottomBar() void bottomBar::setPlaybackProgress(qint64 min,qint64 max) { - this->playbackProgress->setRect(0,0,((float)min/(float)max)*QApplication::desktop()->screenGeometry().width(),15); + this->playbackProgress->setRect(0,0,((float)min/(float)max)*this->width(),15); //ui->graphicsView->update(); } diff --git a/bottombar.h b/bottombar.h index 0108b2f..af5eb12 100644 --- a/bottombar.h +++ b/bottombar.h @@ -32,6 +32,7 @@ private slots: void on_pauseB_clicked(); void on_backB_clicked(); + private: Ui::bottomBar *ui; QGraphicsRectItem *playbackProgress; diff --git a/bottombar.ui b/bottombar.ui index 0a99b2b..15674e6 100644 --- a/bottombar.ui +++ b/bottombar.ui @@ -52,6 +52,12 @@ false + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + false -- 1.7.9.5