source: src/UIElements/Views/Qt4/QtLogBox.hpp@ 5c8056

FragmentMolecule_checks_bonddegrees Gui_Fixes
Last change on this file since 5c8056 was ec8471, checked in by Frederik Heber <heber@…>, 10 years ago

FIX: QtLogBox is again included and working thread-safe.

  • QDebugStream is now appending text to QtLogBox in a thread-safe manner by using signal/slots. This code is taken from qt-forum.de.
  • Property mode set to 100644
File size: 796 bytes
Line 
1/*
2 * QtLogBox.hpp
3 *
4 * Created on: Jun 19, 2014
5 * Author: heber
6 */
7
8#ifndef QTLOGBOX_HPP_
9#define QTLOGBOX_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <QPlainTextEdit>
17
18#include <string>
19
20#include "UIElements/Views/Qt4/QDebugStream.hpp"
21#include "types.hpp"
22
23
24
25/** This widget displays the log and allows for clicking on the names of atoms
26 * which (un)selects them for highlighting.
27 *
28 */
29class QtLogBox : public QPlainTextEdit
30{
31 Q_OBJECT
32
33public:
34 QtLogBox(QWidget * _parent=0);
35 virtual ~QtLogBox();
36
37 virtual void mousePressEvent(QMouseEvent *e);
38
39private:
40 atomId_t getAtomIdForName(const std::string &_name) const;
41
42private:
43 //!> streambuffer to connect ostream and QTextEdit
44 QDebugStream logbuf;
45};
46
47
48#endif /* QTLOGBOX_HPP_ */
Note: See TracBrowser for help on using the repository browser.