git conflict resolved

preferencesAboutTextFull
Ivan Ilin 13 years ago
commit 34646dab0b
  1. 4
      src/board/UBBoardController.cpp
  2. 12
      src/domain/UBGraphicsScene.cpp
  3. 13
      src/frameworks/UBCoreGraphicsScene.cpp
  4. 3
      src/frameworks/UBCoreGraphicsScene.h
  5. 12
      src/gui/UBTeacherBarWidget.cpp
  6. 2
      src/gui/UBTeacherBarWidget.h

@ -1212,7 +1212,9 @@ void UBBoardController::ClearUndoStack()
QGraphicsItem* item = itUniq.next(); QGraphicsItem* item = itUniq.next();
UBGraphicsScene *scene = (UBGraphicsScene*)item->scene(); UBGraphicsScene *scene = (UBGraphicsScene*)item->scene();
if(!scene) if(!scene)
delete item; {
bool retCode = mActiveScene->deleteItem(item);
}
} }
} }

@ -152,34 +152,28 @@ UBGraphicsScene::~UBGraphicsScene()
void UBGraphicsScene::selectionChangedProcessing() void UBGraphicsScene::selectionChangedProcessing()
{ {
if (selectedItems().count()) if (selectedItems().count())
UBApplication::showMessage("ZValue is " + QString::number(selectedItems().first()->zValue(), 'f')); UBApplication::showMessage("ZValue is " + QString::number(selectedItems().first()->zValue(), 'f'));
QList<QGraphicsItem *> allItemsList = items(); QList<QGraphicsItem *> allItemsList = items();
qreal maxZ = 0.; qreal maxZ = 0.;
for( int i = 0; i < allItemsList.size(); i++ ) for( int i = 0; i < allItemsList.size(); i++ ) {
{
QGraphicsItem *nextItem = allItemsList.at(i); QGraphicsItem *nextItem = allItemsList.at(i);
//Temporary stub. Due to ugly z-order implementation I need to do this (sankore 360) //Temporary stub. Due to ugly z-order implementation I need to do this (sankore 360)
//z-order behavior should be reimplemented and this stub should be deleted //z-order behavior should be reimplemented and this stub should be deleted
if (nextItem == mBackgroundObject) if (nextItem == mBackgroundObject)
continue; continue;
//Temporary stub end (sankore 360) //Temporary stub end (sankore 360)
// qreal zValue = nextItem->zValue();
if (nextItem->zValue() > maxZ) if (nextItem->zValue() > maxZ)
maxZ = nextItem->zValue(); maxZ = nextItem->zValue();
nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal()); nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal());
// nextItem->setZValue(qreal(1)); // nextItem->setZValue(qreal(1));
} }
QList<QGraphicsItem *> selItemsList = selectedItems(); QList<QGraphicsItem *> selItemsList = selectedItems();
// QGraphicsItem *nextItem; for( int i = 0; i < selItemsList.size(); i++ ) {
for( int i = 0; i < selItemsList.size(); i++ )
{
QGraphicsItem *nextItem = selItemsList.at(i); QGraphicsItem *nextItem = selItemsList.at(i);
nextItem->setZValue(maxZ + 0.0001); nextItem->setZValue(maxZ + 0.0001);
// qDebug() << QString(" >>> %1 <<< ").arg(i) << QString(" >>> %1 <<< ").arg(zValue);
} }
} }

@ -53,3 +53,16 @@ void UBCoreGraphicsScene::removeItem(QGraphicsItem* item, bool forceDelete)
delete item; delete item;
} }
} }
bool UBCoreGraphicsScene::deleteItem(QGraphicsItem* item)
{
if(mItemsToDelete.contains(item))
{
mItemsToDelete.remove(item);
delete item;
return true;
}
else
return false;
}

@ -28,6 +28,9 @@ class UBCoreGraphicsScene : public QGraphicsScene
virtual void removeItem(QGraphicsItem* item, bool forceDelete = false); virtual void removeItem(QGraphicsItem* item, bool forceDelete = false);
virtual bool deleteItem(QGraphicsItem* item);
private: private:
QSet<QGraphicsItem*> mItemsToDelete; QSet<QGraphicsItem*> mItemsToDelete;
}; };

@ -62,6 +62,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpTitleLabel->setAlignment(Qt::AlignRight); mpTitleLabel->setAlignment(Qt::AlignRight);
mpTitle = new QLineEdit(mpContainer); mpTitle = new QLineEdit(mpContainer);
mpTitle->setObjectName("DockPaletteWidgetLineEdit"); mpTitle->setObjectName("DockPaletteWidgetLineEdit");
connect(mpTitle, SIGNAL(textChanged(const QString&)), this, SLOT(onTitleTextChanged(const QString&)));
mpTitleLayout = new QHBoxLayout(); mpTitleLayout = new QHBoxLayout();
mpTitleLayout->addWidget(mpTitleLabel, 0); mpTitleLayout->addWidget(mpTitleLabel, 0);
mpTitleLayout->addWidget(mpTitle, 1); mpTitleLayout->addWidget(mpTitle, 1);
@ -95,6 +96,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpEquipmentLabel->setAlignment(Qt::AlignRight); mpEquipmentLabel->setAlignment(Qt::AlignRight);
mpEquipment = new QLineEdit(mpContainer); mpEquipment = new QLineEdit(mpContainer);
mpEquipment->setObjectName("DockPaletteWidgetLineEdit"); mpEquipment->setObjectName("DockPaletteWidgetLineEdit");
connect(mpEquipment, SIGNAL(textChanged(const QString&)), this, SLOT(onEquipmentTextChanged(const QString&)));
mpEquipmentLayout = new QHBoxLayout(); mpEquipmentLayout = new QHBoxLayout();
mpEquipmentLayout->addWidget(mpEquipmentLabel, 0); mpEquipmentLayout->addWidget(mpEquipmentLabel, 0);
mpEquipmentLayout->addWidget(mpEquipment, 1); mpEquipmentLayout->addWidget(mpEquipment, 1);
@ -319,6 +321,16 @@ void UBTeacherBarWidget::loadContent()
mpAction3->setStudentText(nextInfos.action3Student); mpAction3->setStudentText(nextInfos.action3Student);
} }
void UBTeacherBarWidget::onTitleTextChanged(const QString& text)
{
mpTitle->setToolTip(text);
}
void UBTeacherBarWidget::onEquipmentTextChanged(const QString& text)
{
mpEquipment->setToolTip(text);
}
UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent) UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent, const char *name):QWidget(parent)
, mpActionLabel(NULL) , mpActionLabel(NULL)
, mpTeacherLabel(NULL) , mpTeacherLabel(NULL)

@ -48,6 +48,8 @@ private slots:
void saveContent(); void saveContent();
void loadContent(); void loadContent();
void onValueChanged(); void onValueChanged();
void onTitleTextChanged(const QString& text);
void onEquipmentTextChanged(const QString& text);
private: private:
void populateCombos(); void populateCombos();

Loading…
Cancel
Save