LogMessageDelegate.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package ArmarX::
17 * @author Mirko Waechter ( mirko.waechter at kit dot edu)
18 * @date 2012
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
25 #include <QItemDelegate>
26 #include <QStyledItemDelegate>
27 #include <QLabel>
28 
29 
30 
31 namespace armarx
32 {
33  class LogMessageDelegate : public QStyledItemDelegate
34  {
35  Q_OBJECT
36  public:
37  explicit LogMessageDelegate(QObject* parent = 0);
38  ~LogMessageDelegate() override;
39 
40  // void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
41  // QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
42  QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
43  void setEditorData(QWidget* editor, const QModelIndex& index) const override;
44  void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
45  signals:
46  void resizeRow(int row);
47  public slots:
48  void commitAndCloseEditor();
49  private:
50  QLabel* _lineEdit;
51  };
52 }
53 
armarx::LogMessageDelegate::commitAndCloseEditor
void commitAndCloseEditor()
Definition: LogMessageDelegate.cpp:129
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::LogMessageDelegate::updateEditorGeometry
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition: LogMessageDelegate.cpp:120
armarx::LogMessageDelegate::setEditorData
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Definition: LogMessageDelegate.cpp:113
armarx::LogMessageDelegate::createEditor
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition: LogMessageDelegate.cpp:92
armarx::LogMessageDelegate
Definition: LogMessageDelegate.h:33
armarx::LogMessageDelegate::~LogMessageDelegate
~LogMessageDelegate() override
Definition: LogMessageDelegate.cpp:44
armarx::LogMessageDelegate::resizeRow
void resizeRow(int row)
option
#define option(type, fn)
armarx::LogMessageDelegate::LogMessageDelegate
LogMessageDelegate(QObject *parent=0)
Definition: LogMessageDelegate.cpp:37
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28