Init commented

preferencesAboutTextFull
Ilia Ryabokon 11 years ago
parent c65efdee23
commit 4bc6f3cceb
  1. 80
      src/domain/UBGraphicsItemDelegate.cpp

@ -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 = new UBGraphicsDelegateFrame(this, QRectF(0, 0, 0, 0), mFrameWidth, mRespectRatio);
mFrame->hide(); // mFrame->hide();
mFrame->setFlag(QGraphicsItem::ItemIsSelectable, true); // mFrame->setFlag(QGraphicsItem::ItemIsSelectable, true);
mDeleteButton = new DelegateButton(":/images/close.svg", mDelegated, mFrame, Qt::TopLeftSection); // mDeleteButton = new DelegateButton(":/images/close.svg", mDelegated, mFrame, Qt::TopLeftSection);
mButtons << mDeleteButton; // mButtons << mDeleteButton;
connect(mDeleteButton, SIGNAL(clicked()), this, SLOT(remove())); // connect(mDeleteButton, SIGNAL(clicked()), this, SLOT(remove()));
if (canDuplicate()){ // if (canDuplicate()){
mDuplicateButton = new DelegateButton(":/images/duplicate.svg", mDelegated, mFrame, Qt::TopLeftSection); // mDuplicateButton = new DelegateButton(":/images/duplicate.svg", mDelegated, mFrame, Qt::TopLeftSection);
connect(mDuplicateButton, SIGNAL(clicked(bool)), this, SLOT(duplicate())); // connect(mDuplicateButton, SIGNAL(clicked(bool)), this, SLOT(duplicate()));
mButtons << mDuplicateButton; // mButtons << mDuplicateButton;
} // }
mMenuButton = new DelegateButton(":/images/menu.svg", mDelegated, mFrame, Qt::TopLeftSection); // mMenuButton = new DelegateButton(":/images/menu.svg", mDelegated, mFrame, Qt::TopLeftSection);
connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu())); // connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu()));
mButtons << mMenuButton; // mButtons << mMenuButton;
mZOrderUpButton = new DelegateButton(":/images/z_layer_up.svg", mDelegated, mFrame, Qt::BottomLeftSection); // mZOrderUpButton = new DelegateButton(":/images/z_layer_up.svg", mDelegated, mFrame, Qt::BottomLeftSection);
mZOrderUpButton->setShowProgressIndicator(true); // mZOrderUpButton->setShowProgressIndicator(true);
connect(mZOrderUpButton, SIGNAL(clicked()), this, SLOT(increaseZLevelUp())); // connect(mZOrderUpButton, SIGNAL(clicked()), this, SLOT(increaseZLevelUp()));
connect(mZOrderUpButton, SIGNAL(longClicked()), this, SLOT(increaseZlevelTop())); // connect(mZOrderUpButton, SIGNAL(longClicked()), this, SLOT(increaseZlevelTop()));
mButtons << mZOrderUpButton; // mButtons << mZOrderUpButton;
mZOrderDownButton = new DelegateButton(":/images/z_layer_down.svg", mDelegated, mFrame, Qt::BottomLeftSection); // mZOrderDownButton = new DelegateButton(":/images/z_layer_down.svg", mDelegated, mFrame, Qt::BottomLeftSection);
mZOrderDownButton->setShowProgressIndicator(true); // mZOrderDownButton->setShowProgressIndicator(true);
connect(mZOrderDownButton, SIGNAL(clicked()), this, SLOT(increaseZLevelDown())); // connect(mZOrderDownButton, SIGNAL(clicked()), this, SLOT(increaseZLevelDown()));
connect(mZOrderDownButton, SIGNAL(longClicked()), this, SLOT(increaseZlevelBottom())); // connect(mZOrderDownButton, SIGNAL(longClicked()), this, SLOT(increaseZlevelBottom()));
mButtons << mZOrderDownButton; // mButtons << mZOrderDownButton;
buildButtons(); // buildButtons();
foreach(DelegateButton* button, mButtons) // foreach(DelegateButton* button, mButtons)
{ // {
if (button->getSection() != Qt::TitleBarArea) // if (button->getSection() != Qt::TitleBarArea)
{ // {
button->hide(); // button->hide();
button->setFlag(QGraphicsItem::ItemIsSelectable, true); // 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()

Loading…
Cancel
Save