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

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 572bb69879
commit 5d0464ea80
  1. 6
      src/board/UBBoardController.cpp
  2. 12
      src/gui/UBTeacherGuideWidget.cpp
  3. 6
      src/gui/UBTeacherGuideWidget.h

@ -955,8 +955,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
{ {
QString mimeType = pContentTypeHeader; QString mimeType = pContentTypeHeader;
qDebug() << sourceUrl.toString();
// In some cases "image/jpeg;charset=" is retourned by the drag-n-drop. That is // 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) // why we will check if an ; exists and take the first part (the standard allows this kind of mimetype)
if(mimeType.isEmpty()) if(mimeType.isEmpty())
@ -985,7 +983,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
QPixmap pix; QPixmap pix;
if(pData.length() == 0){ if(pData.length() == 0){
pix.load(sourceUrl.toString()); pix.load(sourceUrl.toLocalFile());
} }
else{ else{
QImage img; QImage img;
@ -993,8 +991,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
pix = QPixmap::fromImage(img); pix = QPixmap::fromImage(img);
} }
UBGraphicsPixmapItem* pixItem = mActiveScene->addPixmap(pix, NULL, pPos, 1.); UBGraphicsPixmapItem* pixItem = mActiveScene->addPixmap(pix, NULL, pPos, 1.);
pixItem->setSourceUrl(sourceUrl); pixItem->setSourceUrl(sourceUrl);

@ -468,6 +468,10 @@ UBTeacherGuidePresentationWidget::UBTeacherGuidePresentationWidget(QWidget *pare
mpTreeWidget->setIconSize(QSize(24,24)); mpTreeWidget->setIconSize(QSize(24,24));
connect(mpTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onAddItemClicked(QTreeWidgetItem*,int))); connect(mpTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onAddItemClicked(QTreeWidgetItem*,int)));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged())); 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() UBTeacherGuidePresentationWidget::~UBTeacherGuidePresentationWidget()
@ -484,6 +488,14 @@ UBTeacherGuidePresentationWidget::~UBTeacherGuidePresentationWidget()
DELETEPTR(mpLayout); 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) bool UBTeacherGuidePresentationWidget::eventFilter(QObject* object, QEvent* event)
{ {
Q_UNUSED(object); Q_UNUSED(object);

@ -114,6 +114,12 @@ private:
QTreeWidgetItem* mpRootWidgetItem; QTreeWidgetItem* mpRootWidgetItem;
QTreeWidgetItem* mpMediaSwitchItem; QTreeWidgetItem* mpMediaSwitchItem;
#ifdef Q_WS_MACX
private slots:
void onSliderMoved(int size);
#endif
}; };
/*************************************************************************** /***************************************************************************

Loading…
Cancel
Save