Commit 5d0464ea authored by Claudio Valerio's avatar Claudio Valerio

fixed issue of widget that doesn't follow the scroll area on the presentation widget

parent 572bb698
......@@ -955,8 +955,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
{
QString mimeType = pContentTypeHeader;
qDebug() << sourceUrl.toString();
// In some cases "image/jpeg;charset=" is retourned by the drag-n-drop. That is
// why we will check if an ; exists and take the first part (the standard allows this kind of mimetype)
if(mimeType.isEmpty())
......@@ -985,7 +983,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
QPixmap pix;
if(pData.length() == 0){
pix.load(sourceUrl.toString());
pix.load(sourceUrl.toLocalFile());
}
else{
QImage img;
......@@ -993,8 +991,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
pix = QPixmap::fromImage(img);
}
UBGraphicsPixmapItem* pixItem = mActiveScene->addPixmap(pix, NULL, pPos, 1.);
pixItem->setSourceUrl(sourceUrl);
......
......@@ -468,6 +468,10 @@ UBTeacherGuidePresentationWidget::UBTeacherGuidePresentationWidget(QWidget *pare
mpTreeWidget->setIconSize(QSize(24,24));
connect(mpTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onAddItemClicked(QTreeWidgetItem*,int)));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
#ifdef Q_WS_MAC
// on mac and with the custom qt the widget on the tree are not automatically relocated when using the vertical scrollbar. To relocate them we link the valueChange signal of the vertical scrollbar witht a local signal to trig a change and a repaint of the tree widget
connect(mpTreeWidget->verticalScrollBar(),SIGNAL(valueChanged(int)),this,SLOT(onSliderMoved(int)));
#endif
}
UBTeacherGuidePresentationWidget::~UBTeacherGuidePresentationWidget()
......@@ -484,6 +488,14 @@ UBTeacherGuidePresentationWidget::~UBTeacherGuidePresentationWidget()
DELETEPTR(mpLayout);
}
#ifdef Q_WS_MAC
void UBTeacherGuidePresentationWidget::onSliderMoved(int size)
{
Q_UNUSED(size);
mpMediaSwitchItem->setExpanded(true);
}
#endif
bool UBTeacherGuidePresentationWidget::eventFilter(QObject* object, QEvent* event)
{
Q_UNUSED(object);
......
......@@ -114,6 +114,12 @@ private:
QTreeWidgetItem* mpRootWidgetItem;
QTreeWidgetItem* mpMediaSwitchItem;
#ifdef Q_WS_MACX
private slots:
void onSliderMoved(int size);
#endif
};
/***************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment