0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-27 01:48:09 +03:00
LimeReport/limereport/items/lrtextitemeditor.h

98 lines
3.8 KiB
C
Raw Normal View History

2016-02-17 10:11:00 +03:00
/***************************************************************************
* This file is part of the Lime Report project *
2021-08-18 20:21:36 +03:00
* Copyright (C) 2021 by Alexander Arin *
2016-02-17 10:11:00 +03:00
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRTEXTITEMEDITOR_H
#define LRTEXTITEMEDITOR_H
#include <QWidget>
#include <QTextEdit>
#include <QCompleter>
#include "lrtextitem.h"
#include "lrpagedesignintf.h"
namespace LimeReport{
2016-02-17 10:11:00 +03:00
namespace Ui {
class TextItemEditor;
}
2017-09-21 00:44:09 +03:00
//class CompleaterTextEditor :public QTextEdit
//{
// Q_OBJECT
//public:
// CompleaterTextEditor(QWidget* parent=0);
// void setCompleter(QCompleter* value);
// QCompleter* compleater() const{ return m_compleater;}
//protected:
// virtual void keyPressEvent(QKeyEvent *e);
// virtual void focusInEvent(QFocusEvent *e);
//private:
// QString textUnderCursor() const;
//private slots:
// void insertCompletion(const QString& completion);
//private:
// QCompleter* m_compleater;
//};
2016-02-17 10:11:00 +03:00
class TextItemEditor : public QWidget
{
Q_OBJECT
public:
explicit TextItemEditor(LimeReport::TextItem* item, LimeReport::PageDesignIntf* page,
QSettings* settings=0, QWidget *parent = 0);
~TextItemEditor();
void setSettings(QSettings* value);
2019-01-29 23:18:24 +03:00
QSettings* settings();
2016-02-17 10:11:00 +03:00
protected:
void resizeEvent(QResizeEvent *);
void moveEvent(QMoveEvent *);
2017-09-21 00:44:09 +03:00
void closeEvent(QCloseEvent *event);
BandDesignIntf* findParentBand();
2016-02-17 10:11:00 +03:00
private slots:
void on_pbOk_clicked();
void on_pbCancel_clicked();
2017-09-21 00:44:09 +03:00
void slotSplitterMoved(int, int);
2016-02-17 10:11:00 +03:00
private:
void initUI();
void readSetting();
void writeSetting();
private:
Ui::TextItemEditor *ui;
LimeReport::TextItem* m_textItem;
LimeReport::PageDesignIntf* m_page;
QSettings* m_settings;
bool m_ownedSettings;
bool m_isReadingSetting;
};
} // namespace LimeReport
2016-02-17 10:11:00 +03:00
#endif // LRTEXTITEMEDITOR_H