0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 00:54:39 +03:00

bandAt added

This commit is contained in:
Arin Alex 2018-08-22 20:35:59 +03:00
parent 4c5a6b0183
commit c4a24b1f3b
2 changed files with 12 additions and 6 deletions

View File

@ -482,12 +482,7 @@ QSizeF PageDesignIntf::placeSizeOnGrid(QSizeF size){
BaseDesignIntf *PageDesignIntf::addReportItem(const QString &itemType, QPointF pos, QSizeF size) BaseDesignIntf *PageDesignIntf::addReportItem(const QString &itemType, QPointF pos, QSizeF size)
{ {
BandDesignIntf *band=0; BandDesignIntf *band = bandAt(pos);
foreach(QGraphicsItem * item, items(pos)) {
band = dynamic_cast<BandDesignIntf *>(item);
if (band) break;
}
if (band) { if (band) {
BaseDesignIntf *reportItem = addReportItem(itemType, band, band); BaseDesignIntf *reportItem = addReportItem(itemType, band, band);
// QPointF insertPos = band->mapFromScene(pos); // QPointF insertPos = band->mapFromScene(pos);
@ -1733,6 +1728,16 @@ QList<BaseDesignIntf*> PageDesignIntf::reportItemsByName(const QString &name){
return result; return result;
} }
BandDesignIntf *PageDesignIntf::bandAt(QPointF pos)
{
BandDesignIntf *band=0;
foreach(QGraphicsItem * item, items(pos)) {
band = dynamic_cast<BandDesignIntf *>(item);
if (band) break;
}
return band;
}
void CommandIf::addCommand(Ptr command, bool execute) void CommandIf::addCommand(Ptr command, bool execute)
{ {
Q_UNUSED(command) Q_UNUSED(command)

View File

@ -140,6 +140,7 @@ namespace LimeReport {
BaseDesignIntf::ItemMode itemMode(){return m_itemMode;} BaseDesignIntf::ItemMode itemMode(){return m_itemMode;}
BaseDesignIntf* reportItemByName(const QString& name); BaseDesignIntf* reportItemByName(const QString& name);
QList<BaseDesignIntf *> reportItemsByName(const QString &name); QList<BaseDesignIntf *> reportItemsByName(const QString &name);
BandDesignIntf* bandAt(QPointF pos);
BaseDesignIntf* addReportItem(const QString& itemType, QPointF pos, QSizeF size); BaseDesignIntf* addReportItem(const QString& itemType, QPointF pos, QSizeF size);
BaseDesignIntf* addReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0); BaseDesignIntf* addReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0);
BaseDesignIntf* createReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0); BaseDesignIntf* createReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0);