Merge branch 'Bett-2012' of github.com:Sankore/Sankore-3.1 into Bett-2012

preferencesAboutTextFull
shibakaneki 13 years ago
commit c3281a2c9e
  1. 8
      src/customWidgets/UBWidgetList.cpp
  2. 8
      src/gui/UBMediaPlayer.cpp
  3. 9
      src/gui/UBTeacherBarWidget.cpp

@ -53,6 +53,7 @@ void UBWidgetList::addWidget(QWidget *widget)
if(NULL != mpLayout){
mpEmptyLabel->setVisible(false);
mWidgetInfo[widget] = widget->size();
qDebug() << __FUNCTION__ << "widget->size () " << widget->size();
updateView(size());
mpLayout->addWidget(widget);
}
@ -75,6 +76,7 @@ void UBWidgetList::removeWidget(QWidget *widget)
int UBWidgetList::scaleWidgets(QSize pSize)
{
int result = 0;
int count = 0;
foreach(QWidget* eachWidget, mWidgetInfo.keys()){
qreal scaleFactor = 0;
int newWidgetWidth = pSize.width();
@ -89,6 +91,12 @@ int UBWidgetList::scaleWidgets(QSize pSize)
newWidgetWidth = mWidgetInfo[eachWidget].width()/scaleFactor;
result += newWidgetWidth;
}
qDebug() << __PRETTY_FUNCTION__ << "widget " << &eachWidget;
qDebug() << __PRETTY_FUNCTION__ << "count " << count++;
qDebug() << __PRETTY_FUNCTION__ << "widget orignal size " << mWidgetInfo[eachWidget];
qDebug() << __PRETTY_FUNCTION__ << "containes size " << pSize;
qDebug() << __PRETTY_FUNCTION__ << "scale factor " << scaleFactor;
qDebug() << __PRETTY_FUNCTION__ << "new height " << result;
}
return result;
}

@ -100,14 +100,17 @@ UBMediaPlayer::UBMediaPlayer() :
// vLayout->addWidget(info);
initVideoWindow();
vLayout->addWidget(&m_videoWindow);
// m_videoWidget->setStyleSheet(QString("background:red;"));
QVBoxLayout *buttonPanelLayout = new QVBoxLayout();
// m_videoWindow.hide();
//m_videoWindow.hide();
// buttonPanelLayout->addLayout(layout);
// timeLabel = new QLabel(this);
progressLabel = new QLabel(this);
QWidget *sliderPanel = new QWidget(this);
// sliderPanel->setStyleSheet(QString("background:green;"));
QHBoxLayout *sliderLayout = new QHBoxLayout();
// playButton->setStyleSheet(QString("background:yellow;"));
sliderLayout->addWidget(playButton);
sliderLayout->addWidget(slider);
// sliderLayout->addWidget(timeLabel);
@ -130,7 +133,6 @@ UBMediaPlayer::UBMediaPlayer() :
vLayout->addWidget(buttonPanelWidget);
QHBoxLayout *labelLayout = new QHBoxLayout();
vLayout->addLayout(labelLayout);
setLayout(vLayout);
@ -224,7 +226,7 @@ void UBMediaPlayer::initVideoWindow()
videoLayout->addWidget(m_videoWidget);
videoLayout->setContentsMargins(0, 0, 0, 0);
m_videoWindow.setLayout(videoLayout);
m_videoWindow.setMinimumSize(100, 100);
m_videoWindow.setMinimumSize(60, 40);
}
void UBMediaPlayer::playPause()

@ -911,8 +911,9 @@ UBTeacherBarPreviewMedia::UBTeacherBarPreviewMedia(QWidget* parent, const char*
{
setObjectName(name);
mWidget = new UBWidgetList(parent);
mWidget->setEmptyText(tr("No media found"));
// mWidget->setEmptyText(tr("No media found"));
mLayout.addWidget(mWidget);
// mWidget->setStyleSheet(QString("background-color: red;"));
setLayout(&mLayout);
mWidgetList.clear();
}
@ -929,9 +930,15 @@ UBTeacherBarPreviewMedia::~UBTeacherBarPreviewMedia()
void UBTeacherBarPreviewMedia::cleanMedia()
{
foreach(QWidget* eachWidget, mWidgetList.keys()){
if(QString(eachWidget->metaObject()->className()).contains("UBDraggable")){
mWidget->removeWidget(eachWidget);
delete eachWidget;
eachWidget = NULL;
}
else{
mWidget->removeWidget(eachWidget);
}
}
mWidgetList.clear();
}

Loading…
Cancel
Save