Commit 34646dab authored by Ivan Ilin's avatar Ivan Ilin

git conflict resolved

parents a34fcbd5 e2539163
......@@ -1212,7 +1212,9 @@ void UBBoardController::ClearUndoStack()
QGraphicsItem* item = itUniq.next();
UBGraphicsScene *scene = (UBGraphicsScene*)item->scene();
if(!scene)
delete item;
{
bool retCode = mActiveScene->deleteItem(item);
}
}
}
......
......@@ -152,34 +152,28 @@ UBGraphicsScene::~UBGraphicsScene()
void UBGraphicsScene::selectionChangedProcessing()
{
if (selectedItems().count())
if (selectedItems().count())
UBApplication::showMessage("ZValue is " + QString::number(selectedItems().first()->zValue(), 'f'));
QList<QGraphicsItem *> allItemsList = items();
qreal maxZ = 0.;
for( int i = 0; i < allItemsList.size(); i++ )
{
for( int i = 0; i < allItemsList.size(); i++ ) {
QGraphicsItem *nextItem = allItemsList.at(i);
//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
if (nextItem == mBackgroundObject)
continue;
//Temporary stub end (sankore 360)
// qreal zValue = nextItem->zValue();
if (nextItem->zValue() > maxZ)
maxZ = nextItem->zValue();
nextItem->setZValue(nextItem->data(UBGraphicsItemData::ItemOwnZValue).toReal());
// nextItem->setZValue(qreal(1));
}
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);
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;
}
}
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 bool deleteItem(QGraphicsItem* item);
private:
QSet<QGraphicsItem*> mItemsToDelete;
};
......
......@@ -62,6 +62,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpTitleLabel->setAlignment(Qt::AlignRight);
mpTitle = new QLineEdit(mpContainer);
mpTitle->setObjectName("DockPaletteWidgetLineEdit");
connect(mpTitle, SIGNAL(textChanged(const QString&)), this, SLOT(onTitleTextChanged(const QString&)));
mpTitleLayout = new QHBoxLayout();
mpTitleLayout->addWidget(mpTitleLabel, 0);
mpTitleLayout->addWidget(mpTitle, 1);
......@@ -95,6 +96,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpEquipmentLabel->setAlignment(Qt::AlignRight);
mpEquipment = new QLineEdit(mpContainer);
mpEquipment->setObjectName("DockPaletteWidgetLineEdit");
connect(mpEquipment, SIGNAL(textChanged(const QString&)), this, SLOT(onEquipmentTextChanged(const QString&)));
mpEquipmentLayout = new QHBoxLayout();
mpEquipmentLayout->addWidget(mpEquipmentLabel, 0);
mpEquipmentLayout->addWidget(mpEquipment, 1);
......@@ -319,6 +321,16 @@ void UBTeacherBarWidget::loadContent()
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)
, mpActionLabel(NULL)
, mpTeacherLabel(NULL)
......
......@@ -48,6 +48,8 @@ private slots:
void saveContent();
void loadContent();
void onValueChanged();
void onTitleTextChanged(const QString& text);
void onEquipmentTextChanged(const QString& text);
private:
void populateCombos();
......
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