mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-26 09:28:11 +03:00
Create horizontal layout action added to context menu
This commit is contained in:
parent
ed8c4669dc
commit
609393169c
@ -1194,11 +1194,12 @@ void BaseDesignIntf::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
|||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction* copyAction = menu.addAction(QIcon(":/report/images/copy.png"), tr("Copy"));
|
QAction* copyAction = menu.addAction(QIcon(":/report/images/copy.png"), tr("Copy"));
|
||||||
copyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
|
copyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
|
||||||
QAction* cutAction = menu.addAction(QIcon(":/report//images/cut"), tr("Cut"));
|
QAction* cutAction = menu.addAction(QIcon(":/report/images/cut"), tr("Cut"));
|
||||||
cutAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X));
|
cutAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X));
|
||||||
QAction* pasteAction = menu.addAction(QIcon(":/report/images/paste.png"), tr("Paste"));
|
QAction* pasteAction = menu.addAction(QIcon(":/report/images/paste.png"), tr("Paste"));
|
||||||
pasteAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_V));
|
pasteAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_V));
|
||||||
pasteAction->setEnabled(false);
|
pasteAction->setEnabled(false);
|
||||||
|
|
||||||
QClipboard *clipboard = QApplication::clipboard();
|
QClipboard *clipboard = QApplication::clipboard();
|
||||||
ItemsReaderIntf::Ptr reader = StringXMLreader::create(clipboard->text());
|
ItemsReaderIntf::Ptr reader = StringXMLreader::create(clipboard->text());
|
||||||
if (reader->first() && reader->itemType() == "Object"){
|
if (reader->first() && reader->itemType() == "Object"){
|
||||||
@ -1207,6 +1208,10 @@ void BaseDesignIntf::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
|||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
QAction* brinToTopAction = menu.addAction(QIcon(":/report//images/bringToTop"), tr("Bring to top"));
|
QAction* brinToTopAction = menu.addAction(QIcon(":/report//images/bringToTop"), tr("Bring to top"));
|
||||||
QAction* sendToBackAction = menu.addAction(QIcon(":/report//images/sendToBack"), tr("Send to back"));
|
QAction* sendToBackAction = menu.addAction(QIcon(":/report//images/sendToBack"), tr("Send to back"));
|
||||||
|
QAction* createHLayout = 0;
|
||||||
|
if( page->selectedItems().count()>1){
|
||||||
|
createHLayout = menu.addAction(QIcon(":/report/images/hlayout"), tr("Create Horizontal Layout"));
|
||||||
|
}
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
QAction* noBordersAction = menu.addAction(QIcon(":/report//images/noLines"), tr("No borders"));
|
QAction* noBordersAction = menu.addAction(QIcon(":/report//images/noLines"), tr("No borders"));
|
||||||
QAction* allBordersAction = menu.addAction(QIcon(":/report//images/allLines"), tr("All borders"));
|
QAction* allBordersAction = menu.addAction(QIcon(":/report//images/allLines"), tr("All borders"));
|
||||||
@ -1230,6 +1235,8 @@ void BaseDesignIntf::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
|||||||
page->setBorders(BaseDesignIntf::NoLine);
|
page->setBorders(BaseDesignIntf::NoLine);
|
||||||
if (a == allBordersAction)
|
if (a == allBordersAction)
|
||||||
page->setBorders(BaseDesignIntf::AllLines);
|
page->setBorders(BaseDesignIntf::AllLines);
|
||||||
|
if (a == createHLayout)
|
||||||
|
page->addHLayout();
|
||||||
processPopUpAction(a);
|
processPopUpAction(a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user