Dragndrop operations on w3cwidgets, some code cleaning unused files in file system

preferencesAboutTextFull
Ivan Ilin 13 years ago
parent 21e57fbc83
commit 969706ae17
  1. 8
      src/adaptors/UBSvgSubsetAdaptor.cpp
  2. 21
      src/api/UBWidgetUniboardAPI.cpp
  3. 25
      src/api/UBWidgetUniboardAPI.h
  4. 6
      src/board/UBBoardController.cpp
  5. 149
      src/board/UBBoardView.cpp
  6. 5
      src/board/UBBoardView.h
  7. 2
      src/board/UBLibraryController.cpp
  8. 3
      src/core/UBApplication.cpp
  9. 1
      src/core/UBSettings.cpp
  10. 6
      src/domain/UBGraphicsAudioItem.h
  11. 14
      src/domain/UBGraphicsMediaItem.cpp
  12. 4
      src/domain/UBGraphicsMediaItem.h
  13. 2
      src/domain/UBGraphicsPDFItem.h
  14. 1
      src/domain/UBGraphicsPixmapItem.h
  15. 2
      src/domain/UBGraphicsProxyWidget.h
  16. 2
      src/domain/UBGraphicsScene.cpp
  17. 2
      src/domain/UBGraphicsTextItem.h
  18. 6
      src/domain/UBGraphicsVideoItem.h
  19. 4
      src/domain/UBGraphicsWidgetItem.cpp
  20. 2
      src/domain/UBGraphicsWidgetItem.h
  21. 1
      src/domain/UBItem.h
  22. 17
      src/frameworks/UBCoreGraphicsScene.cpp
  23. 22
      src/frameworks/UBFileSystemUtils.cpp
  24. 2
      src/frameworks/UBFileSystemUtils.h
  25. 9
      src/gui/UBThumbnailWidget.cpp
  26. 1
      src/tools/UBGraphicsCurtainItem.h

@ -1827,13 +1827,13 @@ UBGraphicsAudioItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::audioItemFromSvg()
return 0;
}
QString href = audioHref.toString();
QString href = mDocumentPath + "/" + audioHref.toString();
//Claudio this is necessary to fix the absolute path added on Sankore 3.1 1.00.00
//The absoult path doesn't work when you want to share Sankore documents.
if(!href.startsWith("audios/")){
int indexOfAudioDirectory = href.lastIndexOf("audios");
href = href.right(href.length() - indexOfAudioDirectory);
href = mDocumentPath + "/" + href.right(href.length() - indexOfAudioDirectory);
}
UBGraphicsAudioItem* audioItem = new UBGraphicsAudioItem(href);
@ -1861,13 +1861,13 @@ UBGraphicsVideoItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::videoItemFromSvg()
return 0;
}
QString href = videoHref.toString();
QString href = mDocumentPath + "/" + videoHref.toString();
//Claudio this is necessary to fix the absolute path added on Sankore 3.1 1.00.00
//The absoult path doesn't work when you want to share Sankore documents.
if(!href.startsWith("videos/")){
int indexOfAudioDirectory = href.lastIndexOf("videos");
href = href.right(href.length() - indexOfAudioDirectory);
href = mDocumentPath + "/" + href.right(href.length() - indexOfAudioDirectory);
}
UBGraphicsVideoItem* videoItem = new UBGraphicsVideoItem(href);

@ -34,9 +34,12 @@
#include "adaptors/UBThumbnailAdaptor.h"
#include "UBWidgetMessageAPI.h"
#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
const QString objectsPath = "objects";
UBWidgetUniboardAPI::UBWidgetUniboardAPI(UBGraphicsScene *pScene, UBGraphicsWidgetItem *widget)
: QObject(pScene)
, mScene(pScene)
@ -433,14 +436,20 @@ void UBWidgetUniboardAPI::enableDropOnWidget()
mGraphicsWidget->setAcceptDrops(true);
}
QString UBWidgetUniboardAPI::downloadUrl(QString objectUrl)
QString UBWidgetUniboardAPI::downloadUrl(const QString &objectUrl, const QString &extention)
{
qDebug() << "UBWidgetUniboardAPI : " << objectUrl;
QString result;
QUrl widgetUrl = mGraphicsWidget->widgetWebView()->widgetUrl();
QString destFileName =widgetUrl.toString()+ "/objects/" + QUuid::createUuid().toString();
QFile(objectUrl).copy(destFileName);
qDebug() << "destFileName : " << destFileName;
return destFileName.remove(widgetUrl.toString());
QString destFileName =widgetUrl.toLocalFile() + "/objects/" + QUuid::createUuid().toString() + extention;
if (UBFileSystemUtils::copyFile(objectUrl, destFileName)) {
result = destFileName.remove(widgetUrl.toLocalFile());
} else {
qDebug() << "can't copy from " << widgetUrl << "to" << destFileName;
result = QString();
}
return result;
}

@ -27,26 +27,25 @@ class UBWidgetMessageAPI;
class UBDatastoreAPI;
class UBDocumentDatastoreAPI;
class UBWidgetUniboardAPI : public QObject
{
Q_OBJECT;
Q_OBJECT
/**
* The number of pages in the current document
*/
Q_PROPERTY(int pageCount READ pageCount SCRIPTABLE true);
Q_PROPERTY(int pageCount READ pageCount SCRIPTABLE true)
/**
* The page number of the current page
*/
Q_PROPERTY(int currentPageNumber READ currentPageNumber SCRIPTABLE true);
Q_PROPERTY(int currentPageNumber READ currentPageNumber SCRIPTABLE true)
/**
* instance UUID, return a unique identifier for the widget, this value is guaranted to be unique
* and constant for a widget, deprecated, use window.widget.uuid instead
*/
Q_PROPERTY(QString uuid READ uuid SCRIPTABLE true);
Q_PROPERTY(QString uuid READ uuid SCRIPTABLE true)
/**
* Returns the language and eventually the country of this locale as a string of the form
@ -63,11 +62,11 @@ class UBWidgetUniboardAPI : public QObject
* fr-FR
*
*/
Q_PROPERTY(QString lang READ lang SCRIPTABLE true);
Q_PROPERTY(QString lang READ lang SCRIPTABLE true)
Q_PROPERTY(QObject* messages READ messages SCRIPTABLE true);
Q_PROPERTY(QObject* messages READ messages SCRIPTABLE true)
Q_PROPERTY(QObject* datastore READ datastore SCRIPTABLE true);
Q_PROPERTY(QObject* datastore READ datastore SCRIPTABLE true)
public:
@ -245,7 +244,7 @@ class UBWidgetUniboardAPI : public QObject
* When an object is dropped on a widget, this one send us the informations to download it locally.
* this method download the object on the widget directory and return the path of the downloaded object
*/
QString downloadUrl(QString objectUrl);
QString downloadUrl(const QString &objectUrl, const QString &extention = "");
private:
@ -272,13 +271,13 @@ class UBWidgetUniboardAPI : public QObject
class UBDatastoreAPI : public QObject
{
Q_OBJECT;
Q_OBJECT
Q_PROPERTY(QObject* document READ document SCRIPTABLE true);
Q_PROPERTY(QObject* document READ document SCRIPTABLE true)
public:
UBDatastoreAPI(UBGraphicsW3CWidgetItem *widget);
virtual ~UBDatastoreAPI(){};
virtual ~UBDatastoreAPI(){;}
QObject* document();
@ -291,7 +290,7 @@ class UBDatastoreAPI : public QObject
class UBDocumentDatastoreAPI : public UBW3CWebStorage
{
Q_OBJECT;
Q_OBJECT
public:
UBDocumentDatastoreAPI(UBGraphicsW3CWidgetItem *graphicsWidget);

@ -1221,7 +1221,7 @@ void UBBoardController::ClearUndoStack()
while (itUniq.hasNext())
{
QGraphicsItem* item = itUniq.next();
UBGraphicsScene *scene = (UBGraphicsScene*)item->scene();
UBGraphicsScene *scene = dynamic_cast<UBGraphicsScene*>(item->scene());
if(!scene)
{
mActiveScene->deleteItem(item);
@ -1365,15 +1365,13 @@ void UBBoardController::documentSceneChanged(UBDocumentProxy* pDocumentProxy, in
}
}
void UBBoardController::closing()
{
mIsClosing = true;
ClearUndoStack();
lastWindowClosed();
}
void UBBoardController::lastWindowClosed()
{
if (!mCleanupDone)

@ -15,6 +15,7 @@
#include "UBBoardView.h"
#include <QtGui>
#include <QtXml>
#include "UBDrawingController.h"
@ -48,6 +49,24 @@
#include "core/memcheck.h"
//Known extentions for files, add if you know more supported
const QString audioExtentions = ".mp3.wma.ogg";
const QString videoExtentions = ".avi.flv";
const QString imageExtentions = ".png.jpg.tif.bmp.tga";
const QString htmlExtentions = ".htm.html.xhtml";
//Allways use aliases instead of const char* itself
const QString imageAlias = "image";
const QString videoAlias = "video";
const QString audioAlias = "audio";
const QString htmlAlias = "html";
//Xml tag names
const QString tMainSection = "mimedata";
const QString tType = "type";
const QString tPath = "path";
UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent)
: QGraphicsView (pParent)
, mController (pController)
@ -720,64 +739,93 @@ void UBBoardView::dragMoveEvent (QDragMoveEvent *event)
UBGraphicsWidgetItem* graphicsWidget = dynamic_cast<UBGraphicsWidgetItem*>(graphicsItemAtPos);
if (graphicsWidget && graphicsWidget->acceptDrops()){
QPoint newPoint(graphicsWidget->mapFromScene(mapToScene(event->pos())).toPoint());
QDragMoveEvent newEvent(newPoint, event->dropAction(), event->mimeData(), event->mouseButtons(), event->keyboardModifiers());
QApplication::sendEvent(graphicsWidget->widgetWebView(),&newEvent);
return;
if (isDropableData(event->mimeData())) {
QPoint newPoint(graphicsWidget->mapFromScene(mapToScene(event->pos())).toPoint());
QDragMoveEvent newEvent(newPoint, event->dropAction(), event->mimeData(), event->mouseButtons(), event->keyboardModifiers());
QApplication::sendEvent(graphicsWidget->widgetWebView(),&newEvent);
} else {
event->ignore();
}
} else {
event->acceptProposedAction();
}
event->acceptProposedAction();
}
QList<QUrl> UBBoardView::processMimeData(const QMimeData* pMimeData)
QString UBBoardView::processMimeData(const QMimeData *pMimeData, UBGraphicsWidgetItem *widget)
{
QList<QUrl> result;
if(pMimeData->hasHtml())
{
QString qsHtml = pMimeData->html();
result.append(QUrl(UBApplication::urlFromHtml(qsHtml)));
}
QString mimeXml;
QXmlStreamWriter writer(&mimeXml);
writer.setAutoFormatting(true);
writer.writeStartDocument();
writer.writeStartElement(tMainSection);
if (pMimeData->hasUrls()) {
QList<QUrl> urls = pMimeData->urls();
QString ext = fileExtention(urls.at(0).toLocalFile());
if (ext.isNull()) {
qDebug() << "unknown file type";
return QString();
}
QString fileType = typeForExtention(ext);
if (fileType.isNull()) {
qDebug() << "unknown extention";
return QString();
}
if (pMimeData->hasUrls())
{
result.append(pMimeData->urls());
return result;
}
//writing type of element
writer.writeTextElement(tType, fileType);
if (pMimeData->hasImage())
{
qWarning() << "Not supported yet";
}
QString fileName = urls.at(0).toLocalFile();
QString destName = widget->downloadUrl(fileName, ext);
if (pMimeData->hasText())
{
if("" != pMimeData->text()){
// Sometimes, it is possible to have an URL as text. we check here if it is the case
QString qsTmp = pMimeData->text().remove(QRegExp("[\\0]"));
if(qsTmp.startsWith("http")){
result.append(QUrl(qsTmp));
}
else{
qWarning() << "what to do with this : " << pMimeData->text();
//mActiveScene->addText(pMimeData->text(), pPos);
}
}
else{
#ifdef Q_WS_MACX
// With Safari, in 95% of the drops, the mime datas are hidden in Apple Web Archive pasteboard type.
// This is due to the way Safari is working so we have to dig into the pasteboard in order to retrieve
// the data.
QString qsUrl = UBPlatformUtils::urlFromClipboard();
if("" != qsUrl){
// We finally got the url of the dropped ressource! Let's import it!
result.append(QUrl(qsUrl));
}
#endif
if (destName.isNull()) {
qDebug() << "error at creating destination folder";
return QString();
}
//writing path to created object
writer.writeTextElement(tPath, destName);
}
writer.writeEndElement();
writer.writeEndDocument();
return mimeXml;
}
QString UBBoardView::fileExtention(const QString &filename)
{
int pos = filename.lastIndexOf(".");
if (pos != -1)
return filename.right(filename.size() - pos);
else
return QString();
}
QString UBBoardView::typeForExtention(const QString &extention)
{
QString result = QString();
if (audioExtentions.contains(extention)) {
result = audioAlias;
} else if (videoExtentions.contains(extention)) {
result = videoAlias;
} else if (imageExtentions.contains(extention)) {
result = imageAlias;
} else if (htmlExtentions.contains(extention)) {
result = htmlAlias;
}
return result;
}
bool UBBoardView::isDropableData(const QMimeData *pMimeData)
{
if (pMimeData->hasUrls())
if (!typeForExtention(fileExtention(pMimeData->urls().at(0).toLocalFile())).isNull())
return true;
return false;
}
void UBBoardView::dropEvent (QDropEvent *event)
{
@ -785,21 +833,18 @@ void UBBoardView::dropEvent (QDropEvent *event)
QGraphicsItem* graphicsItemAtPos = itemAt(event->pos().x(),event->pos().y());
UBGraphicsWidgetItem* graphicsWidget = dynamic_cast<UBGraphicsWidgetItem*>(graphicsItemAtPos);
bool acceptDrops(false);
if (graphicsWidget) {
acceptDrops = graphicsWidget->acceptDrops();
graphicsWidget->setAcceptDrops(true);
}
if (graphicsWidget && graphicsWidget->acceptDrops()){
// A new event is build to avoid problem related to different way to pass the mime type
// A parsing is done to try to provide a mimeType with only urls.
QMimeData mimeData;
mimeData.setData("Text",processMimeData(event->mimeData()).at(0).toString().toAscii());
QString str = processMimeData(event->mimeData(), graphicsWidget);
mimeData.setData("text/plain", str.toAscii());
QPoint newPoint(graphicsWidget->mapFromScene(mapToScene(event->pos())).toPoint());
QDropEvent cleanedEvent(newPoint, event->dropAction(), &mimeData, event->mouseButtons(), event->keyboardModifiers());
QApplication::sendEvent(graphicsWidget->widgetWebView(),&cleanedEvent);
cleanedEvent.acceptProposedAction();
event->acceptProposedAction();
return;
}
if(!event->source() || dynamic_cast<UBThumbnailWidget *>(event->source()) || dynamic_cast<QWebView*>(event->source()))

@ -22,6 +22,7 @@
class UBBoardController;
class UBAppleWidget;
class UBGraphicsScene;
class UBGraphicsWidgetItem;
class UBBoardView : public QGraphicsView
{
@ -87,6 +88,8 @@ class UBBoardView : public QGraphicsView
}
QList<QUrl> processMimeData(const QMimeData* pMimeData);
QString processMimeData(const QMimeData *pMimeData, UBGraphicsWidgetItem *widget);
bool isDropableData(const QMimeData *pMimeData);
UBBoardController* mController;
@ -113,6 +116,8 @@ class UBBoardView : public QGraphicsView
bool isAbsurdPoint(QPoint point);
bool mVirtualKeyboardActive;
QString typeForExtention(const QString &extention);
QString fileExtention(const QString &filename);
private slots:

@ -649,7 +649,7 @@ QRectF UBLibraryController::visibleSceneRect()
void UBLibraryController::addImagesToCurrentPage(const QList<QUrl>& images)
{
QPointF pos = visibleSceneRect().topLeft();
QPointF pos = visibleSceneRect().center();
foreach(const QUrl url, images)
{

@ -138,7 +138,8 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
QTranslator *translator = new QTranslator(this);
translator->load(UBPlatformUtils::preferredTranslation());
// translator->load(UBPlatformUtils::preferredTranslation());
translator->load("/home/ilia/Sankore/Sankore-3.1/resources/i18n/sankore_ru.qm");
installTranslator(translator);

@ -362,6 +362,7 @@ void UBSettings::init()
podcastPublishToIntranet = new UBSetting(this, "IntranetPodcast", "PublishToIntranet", false);
intranetPodcastPublishingUrl = new UBSetting(this, "IntranetPodcast", "PublishingUrl", "");
intranetPodcastAuthor = new UBSetting(this, "IntranetPodcast", "Author", "");
}

@ -19,6 +19,8 @@
#include "phonon/seekslider.h"
#include "phonon/mediasource.h"
#include "core/UB.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
class UBGraphicsAudioItem : public UBGraphicsMediaItem
{
@ -39,6 +41,10 @@ public:
virtual UBItem* deepCopy () const;
virtual UBGraphicsItemDelegate *Delegate() const {return mDelegate;}
virtual void clearSource()
{
UBGraphicsMediaItem::clearSource();
}
private slots:

@ -82,6 +82,20 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
return UBGraphicsProxyWidget::itemChange(change, value);
}
void UBGraphicsMediaItem::clearSource()
{
QString path = mediaFileUrl().path();
//if path is absolute clean duplicated path string
if (!path.contains(UBApplication::boardController->activeDocument()->persistencePath()))
path = UBApplication::boardController->activeDocument()->persistencePath() + "/" + path;
QFile f(path);
f.setPermissions(path, QFile::ReadOwner | QFile::WriteOwner);
f.remove();
}
void UBGraphicsMediaItem::toggleMute()
{
mMuted = !mMuted;

@ -18,6 +18,8 @@
#include "UBGraphicsProxyWidget.h"
#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
class UBGraphicsMediaItem : public UBGraphicsProxyWidget
@ -65,6 +67,8 @@ protected:
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
virtual void clearSource();
Phonon::MediaObject *mMediaObject;
Phonon::AudioOutput *mAudioOutput;

@ -50,6 +50,8 @@ class UBGraphicsPDFItem: public GraphicsPDFItem, public UBItem, public UBGraphic
virtual UBGraphicsPixmapItem* toPixmapItem() const;
virtual UBGraphicsItemDelegate *Delegate() const {return mDelegate;}
virtual void clearSource(){;}
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);

@ -50,6 +50,7 @@ class UBGraphicsPixmapItem : public QObject, public QGraphicsPixmapItem, public
qreal opacity() const;
virtual UBGraphicsItemDelegate* Delegate() const {return mDelegate;}
virtual void clearSource(){;}
protected:

@ -43,6 +43,8 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual UBGraphicsItemDelegate* Delegate() const { return mDelegate;}
virtual void clearSource(){;}
protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);

@ -1442,13 +1442,11 @@ void UBGraphicsScene::deselectAllItems()
}
}
bool UBGraphicsScene::isEmpty() const
{
return mItemCount == 0;
}
QGraphicsItem* UBGraphicsScene::setAsBackgroundObject(QGraphicsItem* item, bool pAdaptTransformation, bool pExpand)
{
if (mBackgroundObject)

@ -80,6 +80,8 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
}
virtual UBGraphicsItemDelegate *Delegate() const {return mDelegate;}
virtual void clearSource(){;}
signals:
void textUndoCommandAdded(UBGraphicsTextItem *textItem);

@ -18,6 +18,8 @@
#include <phonon/VideoWidget>
#include "UBGraphicsMediaItem.h"
#include "core/UB.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
class UBGraphicsVideoItem : public UBGraphicsMediaItem
{
@ -42,6 +44,10 @@ public:
}
virtual UBGraphicsItemDelegate *Delegate() const {return mDelegate;}
virtual void clearSource()
{
UBGraphicsMediaItem::clearSource();
}
public slots:
void hasVideoChanged(bool hasVideo);

@ -246,6 +246,10 @@ void UBGraphicsWidgetItem::removeScript()
mWebKitWidget->page()->mainFrame()->evaluateJavaScript("if(widget && widget.onremove) { widget.onremove();}");
}
}
QString UBGraphicsWidgetItem::downloadUrl(const QString &fileUrl, const QString &extention)
{
return mUniboardAPI->downloadUrl(fileUrl, extention);
}
UBGraphicsAppleWidgetItem::UBGraphicsAppleWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent)
: UBGraphicsWidgetItem(parent)

@ -66,8 +66,10 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
virtual void remove();
void removeScript();
QString downloadUrl(const QString &fileUrl, const QString &extention);
virtual void clearSource(){;}
protected:

@ -105,6 +105,7 @@ public:
virtual void remove() = 0;
virtual void clearSource(){;}
};
#endif // UBITEM_H

@ -16,6 +16,9 @@
#include "UBCoreGraphicsScene.h"
#include "core/memcheck.h"
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsMediaItem.h"
UBCoreGraphicsScene::UBCoreGraphicsScene(QObject * parent)
: QGraphicsScene ( parent )
@ -58,6 +61,20 @@ bool UBCoreGraphicsScene::deleteItem(QGraphicsItem* item)
{
if(mItemsToDelete.contains(item))
{
UBGraphicsItem* item_casted = 0;
switch (item->type())
{
case UBGraphicsAudioItem::Type:
item_casted = dynamic_cast<UBGraphicsAudioItem*>(item);
break;
case UBGraphicsVideoItem::Type:
item_casted = dynamic_cast<UBGraphicsVideoItem*>(item);
break;
}
if (0 != item_casted)
item_casted->clearSource();
mItemsToDelete.remove(item);
delete item;
return true;

@ -54,6 +54,28 @@ bool UBFileSystemUtils::isAZipFile(QString &filePath)
return result;
}
bool UBFileSystemUtils::copyFile(const QString &source, const QString &Destination, bool overwrite)
{
if (!QFile::exists(source)) {
qDebug() << "file" << source << "does not present in fs";
return false;
}
if (QFile::exists(Destination)) {
if (QFileInfo(Destination).isFile() && overwrite) {
QFile::remove(Destination);
}
} else {
int pos = Destination.lastIndexOf(QDir::separator());
if (pos != -1) {
QString newpath = Destination.left(pos);
if (!QDir().mkpath(newpath)) {
qDebug() << "can't create a new path at " << newpath;
}
}
}
return QFile::copy(source, Destination);
}
QString UBFileSystemUtils::defaultTempDirPath()
{
return QDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/" + defaultTempDirName();

@ -65,6 +65,8 @@ class UBFileSystemUtils
static bool isAZipFile(QString &filePath);
static bool copyFile(const QString &source, const QString &Destination, bool overwrite = false);
/**
* Compress a source directory in a zip file.
* @arg pDir the directory to add in zip

@ -122,7 +122,7 @@ void UBThumbnailWidget::refreshScene()
if (mLabelsItems.size() > 0)
{
QFontMetrics fm(mLabelsItems.at(0)->font());
labelSpacing = UBSettings::thumbnailSpacing + fm.height(); // TODO UB 4.x where is 20 from ??? configure ?? compute based on mSpacing ?? JBA Is it the font height ?
labelSpacing = UBSettings::thumbnailSpacing + fm.height(); // TODO UB 4.x where is 20 from ??? configure ?? compute based on mSpacing ?? JBA Is it the font height?
}
nbColumns = qMax(nbColumns, 1);
@ -383,11 +383,8 @@ void UBThumbnailWidget::mouseReleaseEvent(QMouseEvent *event)
deleteLasso();
QGraphicsView::mouseReleaseEvent(event);
if(elapsedTimeSincePress < STARTDRAGTIME)
{
if(!bSelectionInProgress)
emit mouseClick(itemAt(event->pos()), 0);
bSelectionInProgress = false;
if(elapsedTimeSincePress < STARTDRAGTIME) {
emit mouseClick(itemAt(event->pos()), 0);
}
}

@ -48,6 +48,7 @@ class UBGraphicsCurtainItem : public QObject, public QGraphicsRectItem, public U
//TODO UB 4.x not nice ...
void triggerRemovedSignal();
virtual UBGraphicsItemDelegate* Delegate() const {return mDelegate;}
virtual void clearSource(){};
signals:

Loading…
Cancel
Save