2016-02-17 10:18:19 +03:00
|
|
|
#include "lrcontentpropitem.h"
|
|
|
|
#include "lrtextitem.h"
|
|
|
|
#include "editors/lrbuttonlineeditor.h"
|
|
|
|
#include "items/lrtextitemeditor.h"
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
namespace{
|
|
|
|
LimeReport::ObjectPropItem * createContentPropItem(
|
|
|
|
QObject *object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly)
|
|
|
|
{
|
|
|
|
return new LimeReport::ContentPropItem(object, objects, name, displayName, data, parent, readonly);
|
|
|
|
}
|
2016-10-18 15:00:26 +03:00
|
|
|
bool VARIABLE_IS_NOT_USED registredContentProp = LimeReport::ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("content","LimeReport::TextItem"),QObject::tr("content"),createContentPropItem);
|
2016-02-17 10:18:19 +03:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
namespace LimeReport {
|
|
|
|
|
|
|
|
QWidget *ContentPropItem::createProperyEditor(QWidget *parent) const
|
|
|
|
{
|
|
|
|
return new ContentEditor(object(), object()->objectName()+"."+displayName(), parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContentEditor::editButtonClicked()
|
|
|
|
{
|
|
|
|
QDialog* dialog = new QDialog(QApplication::activeWindow());
|
|
|
|
dialog->setLayout(new QVBoxLayout());
|
|
|
|
dialog->layout()->setContentsMargins(1,1,1,1);
|
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
dialog->setWindowTitle(propertyName());
|
|
|
|
QWidget* editor = dynamic_cast<BaseDesignIntf*>(m_object)->defaultEditor();
|
|
|
|
dialog->layout()->addWidget(editor);
|
2019-01-19 00:04:01 +03:00
|
|
|
dialog->resize(editor->size());
|
2016-02-17 10:18:19 +03:00
|
|
|
connect(editor,SIGNAL(destroyed()),dialog,SLOT(close()));
|
|
|
|
connect(editor,SIGNAL(destroyed()),this,SIGNAL(editingFinished()));
|
|
|
|
dialog->exec();
|
|
|
|
}
|
|
|
|
|
|
|
|
} //namespace LimeReport
|