Commit 4bc6f3cc authored by Ilia Ryabokon's avatar Ilia Ryabokon

Init commented

parent c65efdee
...@@ -179,51 +179,51 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec ...@@ -179,51 +179,51 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec
void UBGraphicsItemDelegate::init() void UBGraphicsItemDelegate::init()
{ {
if (mToolBarUsed) // if (mToolBarUsed)
mToolBarItem = new UBGraphicsToolBarItem(mDelegated); // mToolBarItem = new UBGraphicsToolBarItem(mDelegated);
// mFrame = new UBGraphicsDelegateFrame(this, QRectF(0, 0, 0, 0), mFrameWidth, mRespectRatio);
// mFrame->hide();
// mFrame->setFlag(QGraphicsItem::ItemIsSelectable, true);
// mDeleteButton = new DelegateButton(":/images/close.svg", mDelegated, mFrame, Qt::TopLeftSection);
// mButtons << mDeleteButton;
// connect(mDeleteButton, SIGNAL(clicked()), this, SLOT(remove()));
// if (canDuplicate()){
// mDuplicateButton = new DelegateButton(":/images/duplicate.svg", mDelegated, mFrame, Qt::TopLeftSection);
// connect(mDuplicateButton, SIGNAL(clicked(bool)), this, SLOT(duplicate()));
// mButtons << mDuplicateButton;
// }
// mMenuButton = new DelegateButton(":/images/menu.svg", mDelegated, mFrame, Qt::TopLeftSection);
// connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu()));
// mButtons << mMenuButton;
mFrame = new UBGraphicsDelegateFrame(this, QRectF(0, 0, 0, 0), mFrameWidth, mRespectRatio); // mZOrderUpButton = new DelegateButton(":/images/z_layer_up.svg", mDelegated, mFrame, Qt::BottomLeftSection);
mFrame->hide(); // mZOrderUpButton->setShowProgressIndicator(true);
mFrame->setFlag(QGraphicsItem::ItemIsSelectable, true); // connect(mZOrderUpButton, SIGNAL(clicked()), this, SLOT(increaseZLevelUp()));
// connect(mZOrderUpButton, SIGNAL(longClicked()), this, SLOT(increaseZlevelTop()));
mDeleteButton = new DelegateButton(":/images/close.svg", mDelegated, mFrame, Qt::TopLeftSection); // mButtons << mZOrderUpButton;
mButtons << mDeleteButton;
connect(mDeleteButton, SIGNAL(clicked()), this, SLOT(remove()));
if (canDuplicate()){
mDuplicateButton = new DelegateButton(":/images/duplicate.svg", mDelegated, mFrame, Qt::TopLeftSection);
connect(mDuplicateButton, SIGNAL(clicked(bool)), this, SLOT(duplicate()));
mButtons << mDuplicateButton;
}
mMenuButton = new DelegateButton(":/images/menu.svg", mDelegated, mFrame, Qt::TopLeftSection);
connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu()));
mButtons << mMenuButton;
mZOrderUpButton = new DelegateButton(":/images/z_layer_up.svg", mDelegated, mFrame, Qt::BottomLeftSection);
mZOrderUpButton->setShowProgressIndicator(true);
connect(mZOrderUpButton, SIGNAL(clicked()), this, SLOT(increaseZLevelUp()));
connect(mZOrderUpButton, SIGNAL(longClicked()), this, SLOT(increaseZlevelTop()));
mButtons << mZOrderUpButton;
mZOrderDownButton = new DelegateButton(":/images/z_layer_down.svg", mDelegated, mFrame, Qt::BottomLeftSection);
mZOrderDownButton->setShowProgressIndicator(true);
connect(mZOrderDownButton, SIGNAL(clicked()), this, SLOT(increaseZLevelDown()));
connect(mZOrderDownButton, SIGNAL(longClicked()), this, SLOT(increaseZlevelBottom()));
mButtons << mZOrderDownButton;
buildButtons();
foreach(DelegateButton* button, mButtons) // mZOrderDownButton = new DelegateButton(":/images/z_layer_down.svg", mDelegated, mFrame, Qt::BottomLeftSection);
{ // mZOrderDownButton->setShowProgressIndicator(true);
if (button->getSection() != Qt::TitleBarArea) // connect(mZOrderDownButton, SIGNAL(clicked()), this, SLOT(increaseZLevelDown()));
{ // connect(mZOrderDownButton, SIGNAL(longClicked()), this, SLOT(increaseZlevelBottom()));
button->hide(); // mButtons << mZOrderDownButton;
button->setFlag(QGraphicsItem::ItemIsSelectable, true);
} // buildButtons();
}
// foreach(DelegateButton* button, mButtons)
// {
// if (button->getSection() != Qt::TitleBarArea)
// {
// button->hide();
// button->setFlag(QGraphicsItem::ItemIsSelectable, true);
// }
// }
//Wrapper function. Use it to set correct data() to QGraphicsItem as well // //Wrapper function. Use it to set correct data() to QGraphicsItem as well
setFlippable(false); // setFlippable(false);
setRotatable(false); // setRotatable(false);
} }
void UBGraphicsItemDelegate::createControls() void UBGraphicsItemDelegate::createControls()
......
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