version 1.4.0_alpha
add LogView patch MatrixEdit for old Qt
This commit is contained in:
2
pip
2
pip
Submodule pip updated: f662a92380...4910631ce8
@@ -2,9 +2,9 @@ cmake_minimum_required(VERSION 3.0)
|
||||
cmake_policy(SET CMP0017 NEW) # need include() with .cmake
|
||||
project(qad)
|
||||
set(_QAD_MAJOR 1)
|
||||
set(_QAD_MINOR 3)
|
||||
set(_QAD_REVISION 2)
|
||||
set(_QAD_SUFFIX beta)
|
||||
set(_QAD_MINOR 4)
|
||||
set(_QAD_REVISION 0)
|
||||
set(_QAD_SUFFIX alpha)
|
||||
set(_QAD_COMPANY SHS)
|
||||
set(_QAD_DOMAIN org.SHS)
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../aboutwindow.cpp" line="33"/>
|
||||
<location filename="../aboutwindow.cpp" line="157"/>
|
||||
<source>About</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -43,53 +44,58 @@
|
||||
<name>EMainWindow</name>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="12"/>
|
||||
<location filename="../emainwindow.cpp" line="130"/>
|
||||
<source>Clear recent list</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="15"/>
|
||||
<location filename="../emainwindow.cpp" line="16"/>
|
||||
<location filename="../emainwindow.cpp" line="126"/>
|
||||
<location filename="../emainwindow.cpp" line="127"/>
|
||||
<source>Show all</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="17"/>
|
||||
<location filename="../emainwindow.cpp" line="18"/>
|
||||
<location filename="../emainwindow.cpp" line="128"/>
|
||||
<location filename="../emainwindow.cpp" line="129"/>
|
||||
<source>Hide all</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="136"/>
|
||||
<location filename="../emainwindow.cpp" line="152"/>
|
||||
<source>Toolbars</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="161"/>
|
||||
<location filename="../emainwindow.cpp" line="177"/>
|
||||
<source>Docks</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="379"/>
|
||||
<location filename="../emainwindow.cpp" line="395"/>
|
||||
<source>Select file to open</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="388"/>
|
||||
<location filename="../emainwindow.cpp" line="404"/>
|
||||
<source>Select files to open</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="398"/>
|
||||
<location filename="../emainwindow.cpp" line="414"/>
|
||||
<source>Save changes%1?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="398"/>
|
||||
<location filename="../emainwindow.cpp" line="414"/>
|
||||
<source> in</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="411"/>
|
||||
<location filename="../emainwindow.cpp" line="427"/>
|
||||
<source>Select file to save</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -97,9 +103,28 @@
|
||||
<context>
|
||||
<name>HistoryView</name>
|
||||
<message>
|
||||
<location filename="../historyview.cpp" line="16"/>
|
||||
<location filename="../historyview.cpp" line="17"/>
|
||||
<location filename="../historyview.cpp" line="97"/>
|
||||
<source>History cleared</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LogView</name>
|
||||
<message>
|
||||
<location filename="../logview.ui" line="92"/>
|
||||
<source>Category:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../logview.ui" line="119"/>
|
||||
<source>Clear</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../logview.cpp" line="38"/>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../aboutwindow.cpp" line="33"/>
|
||||
<location filename="../aboutwindow.cpp" line="157"/>
|
||||
<source>About</source>
|
||||
<translation>О программе</translation>
|
||||
</message>
|
||||
@@ -43,53 +44,58 @@
|
||||
<name>EMainWindow</name>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="12"/>
|
||||
<location filename="../emainwindow.cpp" line="130"/>
|
||||
<source>Clear recent list</source>
|
||||
<translation>Очистить список недавних</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="15"/>
|
||||
<location filename="../emainwindow.cpp" line="16"/>
|
||||
<location filename="../emainwindow.cpp" line="126"/>
|
||||
<location filename="../emainwindow.cpp" line="127"/>
|
||||
<source>Show all</source>
|
||||
<translation>Показать все</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="17"/>
|
||||
<location filename="../emainwindow.cpp" line="18"/>
|
||||
<location filename="../emainwindow.cpp" line="128"/>
|
||||
<location filename="../emainwindow.cpp" line="129"/>
|
||||
<source>Hide all</source>
|
||||
<translation>Скрыть все</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="136"/>
|
||||
<location filename="../emainwindow.cpp" line="152"/>
|
||||
<source>Toolbars</source>
|
||||
<translation>Панели инструментов</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="161"/>
|
||||
<location filename="../emainwindow.cpp" line="177"/>
|
||||
<source>Docks</source>
|
||||
<translation>Окна</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="379"/>
|
||||
<location filename="../emainwindow.cpp" line="395"/>
|
||||
<source>Select file to open</source>
|
||||
<translation>Выбрать файл для открытия</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="388"/>
|
||||
<location filename="../emainwindow.cpp" line="404"/>
|
||||
<source>Select files to open</source>
|
||||
<translation>Выберите файлы для открытия</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="398"/>
|
||||
<location filename="../emainwindow.cpp" line="414"/>
|
||||
<source>Save changes%1?</source>
|
||||
<translation>Сохранить изменения%1?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="398"/>
|
||||
<location filename="../emainwindow.cpp" line="414"/>
|
||||
<source> in</source>
|
||||
<translation> в</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../emainwindow.cpp" line="411"/>
|
||||
<location filename="../emainwindow.cpp" line="427"/>
|
||||
<source>Select file to save</source>
|
||||
<translation>Выберите файл для сохранения</translation>
|
||||
</message>
|
||||
@@ -97,9 +103,28 @@
|
||||
<context>
|
||||
<name>HistoryView</name>
|
||||
<message>
|
||||
<location filename="../historyview.cpp" line="16"/>
|
||||
<location filename="../historyview.cpp" line="17"/>
|
||||
<location filename="../historyview.cpp" line="97"/>
|
||||
<source>History cleared</source>
|
||||
<translation>История очищена</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>LogView</name>
|
||||
<message>
|
||||
<location filename="../logview.ui" line="92"/>
|
||||
<source>Category:</source>
|
||||
<translation>Категория:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../logview.ui" line="119"/>
|
||||
<source>Clear</source>
|
||||
<translation>Очистить</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../logview.cpp" line="38"/>
|
||||
<source>All</source>
|
||||
<translation>Все</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
183
qad/application/logview.cpp
Normal file
183
qad/application/logview.cpp
Normal file
@@ -0,0 +1,183 @@
|
||||
#include "logview.h"
|
||||
#include "ui_logview.h"
|
||||
#include "qad_types.h"
|
||||
#include "ecombobox.h"
|
||||
#include <QTextDocument>
|
||||
#include <QAbstractTextDocumentLayout>
|
||||
#include <QTextEdit>
|
||||
#include <QTextBlock>
|
||||
#include <QScrollBar>
|
||||
#include <QPixmap>
|
||||
#include <QEvent>
|
||||
|
||||
|
||||
LogView::Category::Category() {
|
||||
bold = false;
|
||||
}
|
||||
|
||||
|
||||
void LogView::Category::makeIcon(QSize size, QSize size_icon) {
|
||||
icon_image = QImage();
|
||||
if (!image.isNull())
|
||||
icon_image = image.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
QPixmap px = QPixmap::fromImage(image.scaled(size_icon, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
icon.addPixmap(px, QIcon::Active);
|
||||
icon.addPixmap(px, QIcon::Disabled);
|
||||
icon.addPixmap(px, QIcon::Normal);
|
||||
icon.addPixmap(px, QIcon::Selected);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
LogView::LogView(QWidget * parent): QWidget(parent) {
|
||||
ui = new Ui::LogView();
|
||||
ui->setupUi(this);
|
||||
ui->buttonClear->setDefaultAction(ui->actionClear);
|
||||
ui->labelIconSearch->setFixedSize(preferredIconSize(1.2, this));
|
||||
ui->comboCategory->addItem(tr("All"));
|
||||
ui->textEdit->document()->setUndoRedoEnabled(false);
|
||||
setLinesLimit(10000);
|
||||
QTextCursor tc(ui->textEdit->document());
|
||||
def_cf = tc.charFormat();
|
||||
}
|
||||
|
||||
|
||||
LogView::~LogView() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
const QTextEdit * LogView::textEdit() const {
|
||||
return ui->textEdit;
|
||||
}
|
||||
|
||||
|
||||
void LogView::setLogFont(QFont f) {
|
||||
ui->textEdit->document()->setDefaultFont(f);
|
||||
QTextCursor tc(ui->textEdit->document());
|
||||
def_cf = tc.charFormat();
|
||||
}
|
||||
|
||||
|
||||
QFont LogView::logFont() const {
|
||||
return ui->textEdit->document()->defaultFont();
|
||||
}
|
||||
|
||||
|
||||
bool LogView::isFilterVisible() const {
|
||||
return !ui->widgetToolbar->isHidden();
|
||||
}
|
||||
|
||||
|
||||
int LogView::linesLimit() const {
|
||||
return ui->textEdit->document()->maximumBlockCount();
|
||||
}
|
||||
|
||||
|
||||
void LogView::registerCategory(const QString & label, QString keyword, const QImage & icon, QColor color, bool bold) {
|
||||
if (keyword.isEmpty()) keyword = label;
|
||||
if (keyword.isEmpty()) return;
|
||||
Category & c(categories[keyword]);
|
||||
c.label = label;
|
||||
c.keyword = keyword;
|
||||
c.image = icon;
|
||||
c.color = color;
|
||||
c.bold = bold;
|
||||
c.makeIcon(iconImageSize(), preferredIconSize(1., this));
|
||||
ui->comboCategory->addItem(c.icon, label, keyword);
|
||||
}
|
||||
|
||||
|
||||
void LogView::addText(const QString & text, bool insert_newline) {
|
||||
QTextCursor tc(ui->textEdit->document());
|
||||
QStringList sl = text.split("\n");
|
||||
tc.movePosition(QTextCursor::End);
|
||||
QScrollBar * bar = ui->textEdit->verticalScrollBar();
|
||||
bool at_end = (bar->value() == bar->maximum());
|
||||
for (int i = 0; i < sl.size(); ++i) {
|
||||
tc.insertText(sl[i]);
|
||||
if ((i < sl.size() - 1) || insert_newline)
|
||||
newLine();
|
||||
}
|
||||
if (at_end)
|
||||
bar->setValue(bar->maximum());
|
||||
filter();
|
||||
}
|
||||
|
||||
|
||||
void LogView::changeEvent(QEvent * e) {
|
||||
if (e->type() == QEvent::Polish) {
|
||||
ui->labelIconSearch->setFixedSize(preferredIconSize(1.2, this));
|
||||
QSize is = iconImageSize(), is_i = preferredIconSize(1., this);
|
||||
QMutableMapIterator<QString, Category> it(categories);
|
||||
while (it.hasNext())
|
||||
it.next().value().makeIcon(is, is_i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LogView::newLine() {
|
||||
QTextCursor tc(ui->textEdit->document());
|
||||
tc.movePosition(QTextCursor::End);
|
||||
tc.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor);
|
||||
QString line = tc.selectedText();
|
||||
QImage icon;
|
||||
QMapIterator<QString, Category> it(categories);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
if (line.contains(it.key(), Qt::CaseInsensitive)) {
|
||||
QTextCharFormat cf = def_cf;
|
||||
cf.setForeground(it.value().color);
|
||||
if (it.value().bold)
|
||||
cf.setFontWeight(QFont::Bold);
|
||||
tc.setCharFormat(cf);
|
||||
icon = it.value().icon_image;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!icon.isNull()) {
|
||||
tc.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor);
|
||||
tc.insertImage(icon);
|
||||
}
|
||||
tc.movePosition(QTextCursor::End);
|
||||
tc.setCharFormat(def_cf);
|
||||
tc.insertBlock();
|
||||
}
|
||||
|
||||
|
||||
QSize LogView::iconImageSize() {
|
||||
int hei = QFontMetrics(ui->textEdit->document()->defaultFont()).height() / 1.25;
|
||||
return QSize(hei, hei);
|
||||
}
|
||||
|
||||
|
||||
void LogView::setFilterVisible(bool yes) {
|
||||
ui->widgetToolbar->setHidden(!yes);
|
||||
}
|
||||
|
||||
|
||||
void LogView::setLinesLimit(int l) {
|
||||
ui->textEdit->document()->setMaximumBlockCount(l);
|
||||
}
|
||||
|
||||
|
||||
void LogView::clear() {
|
||||
ui->textEdit->clear();
|
||||
}
|
||||
|
||||
|
||||
void LogView::filter() {
|
||||
QTextDocument * doc = ui->textEdit->document();
|
||||
int bc = doc->blockCount();
|
||||
QString fs[2] = {ui->comboCategory->currentData().toString(), ui->lineEdit->text()};
|
||||
QTextBlock bl;
|
||||
for (int i = 0; i < bc; ++i) {
|
||||
bl = doc->findBlockByNumber(i);
|
||||
bool vis = true;
|
||||
if (!fs[0].isEmpty()) vis = vis && bl.text().contains(fs[0], Qt::CaseInsensitive);
|
||||
if (!fs[1].isEmpty()) vis = vis && bl.text().contains(fs[1], Qt::CaseInsensitive);
|
||||
bl.setVisible(vis);
|
||||
}
|
||||
doc->markContentsDirty(0, bl.position() + bl.length());
|
||||
}
|
||||
94
qad/application/logview.h
Normal file
94
qad/application/logview.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
QAD - Qt ADvanced
|
||||
|
||||
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program 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.
|
||||
|
||||
This program 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef LOGVIEW_H
|
||||
#define LOGVIEW_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QIcon>
|
||||
#include <QImage>
|
||||
#include <QDebug>
|
||||
#include <QTextBlockFormat>
|
||||
#include "qad_export.h"
|
||||
|
||||
class QTextEdit;
|
||||
|
||||
namespace Ui {
|
||||
class LogView;
|
||||
}
|
||||
|
||||
class QAD_EXPORT LogView: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool filterVisible READ isFilterVisible WRITE setFilterVisible)
|
||||
Q_PROPERTY(int linesLimit READ linesLimit WRITE setLinesLimit)
|
||||
Q_PROPERTY(QFont logFont READ logFont WRITE setLogFont)
|
||||
public:
|
||||
explicit LogView(QWidget * parent = 0);
|
||||
~LogView();
|
||||
|
||||
const QTextEdit * textEdit() const;
|
||||
void setLogFont(QFont f);
|
||||
QFont logFont() const;
|
||||
|
||||
bool isFilterVisible() const;
|
||||
int linesLimit() const;
|
||||
|
||||
void registerCategory(const QString & label,
|
||||
QString keyword = QString(),
|
||||
const QImage & icon = QImage(),
|
||||
QColor color = QColor(),
|
||||
bool bold = false);
|
||||
|
||||
void addText(const QString & text, bool insert_newline = true);
|
||||
|
||||
private:
|
||||
struct Category {
|
||||
Category();
|
||||
void makeIcon(QSize size, QSize size_icon);
|
||||
QString label;
|
||||
QString keyword;
|
||||
QImage image, icon_image;
|
||||
QIcon icon;
|
||||
QColor color;
|
||||
bool bold;
|
||||
};
|
||||
|
||||
void changeEvent(QEvent * e);
|
||||
void newLine();
|
||||
QSize iconImageSize();
|
||||
|
||||
Ui::LogView * ui;
|
||||
QMap<QString, Category> categories; // by keyword
|
||||
QTextCharFormat def_cf;
|
||||
|
||||
public slots:
|
||||
void setFilterVisible(bool yes);
|
||||
void setLinesLimit(int l);
|
||||
void clear();
|
||||
|
||||
private slots:
|
||||
void filter();
|
||||
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // LOGVIEW_H
|
||||
192
qad/application/logview.ui
Normal file
192
qad/application/logview.ui
Normal file
@@ -0,0 +1,192 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LogView</class>
|
||||
<widget class="QWidget" name="LogView">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>724</width>
|
||||
<height>502</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="widgetToolbar" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="buttonClear"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelIconSearch">
|
||||
<property name="pixmap">
|
||||
<pixmap resource="qad_application.qrc">:/icons/edit-find.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Category:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="EComboBox" name="comboCategory"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<action name="actionClear">
|
||||
<property name="icon">
|
||||
<iconset resource="qad_application.qrc">
|
||||
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>CLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>clineedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>EComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>ecombobox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="qad_application.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>actionClear</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>LogView</receiver>
|
||||
<slot>clear()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>361</x>
|
||||
<y>250</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>lineEdit</sender>
|
||||
<signal>textChanged(QString)</signal>
|
||||
<receiver>LogView</receiver>
|
||||
<slot>filter()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>544</x>
|
||||
<y>138</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>728</x>
|
||||
<y>90</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>comboCategory</sender>
|
||||
<signal>currentIndexChanged(int)</signal>
|
||||
<receiver>LogView</receiver>
|
||||
<slot>filter()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>675</x>
|
||||
<y>134</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>728</x>
|
||||
<y>76</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<slots>
|
||||
<slot>clear()</slot>
|
||||
<slot>filter()</slot>
|
||||
</slots>
|
||||
</ui>
|
||||
69
qad/application/plugin/logviewplugin.cpp
Normal file
69
qad/application/plugin/logviewplugin.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include "logview.h"
|
||||
#include "logviewplugin.h"
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
|
||||
LogViewPlugin::LogViewPlugin(QObject * parent): QObject(parent) {
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
|
||||
void LogViewPlugin::initialize(QDesignerFormEditorInterface * /* core */) {
|
||||
if (m_initialized)
|
||||
return;
|
||||
|
||||
// Add extension registrations, etc. here
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
bool LogViewPlugin::isInitialized() const {
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
|
||||
QWidget * LogViewPlugin::createWidget(QWidget * parent) {
|
||||
return new LogView(parent);
|
||||
}
|
||||
|
||||
|
||||
QString LogViewPlugin::name() const {
|
||||
return QLatin1String("LogView");
|
||||
}
|
||||
|
||||
|
||||
QString LogViewPlugin::group() const {
|
||||
return QLatin1String("Display Widgets");
|
||||
}
|
||||
|
||||
|
||||
QIcon LogViewPlugin::icon() const {
|
||||
return QIcon(":/icons/logview.png");
|
||||
}
|
||||
|
||||
|
||||
QString LogViewPlugin::toolTip() const {
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
|
||||
QString LogViewPlugin::whatsThis() const {
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
|
||||
bool LogViewPlugin::isContainer() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
QString LogViewPlugin::domXml() const {
|
||||
return QLatin1String("<widget class=\"LogView\" name=\"logView\">\n</widget>\n");
|
||||
}
|
||||
|
||||
|
||||
QString LogViewPlugin::includeFile() const {
|
||||
return QLatin1String("logview.h");
|
||||
}
|
||||
|
||||
36
qad/application/plugin/logviewplugin.h
Normal file
36
qad/application/plugin/logviewplugin.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef LOGVIEWPLUGIN_H
|
||||
#define LOGVIEWPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#else
|
||||
# include <QDesignerCustomWidgetInterface>
|
||||
#endif
|
||||
|
||||
class LogViewPlugin: public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
LogViewPlugin(QObject * parent = 0);
|
||||
|
||||
bool isContainer() const;
|
||||
bool isInitialized() const;
|
||||
QIcon icon() const;
|
||||
QString domXml() const;
|
||||
QString group() const;
|
||||
QString includeFile() const;
|
||||
QString name() const;
|
||||
QString toolTip() const;
|
||||
QString whatsThis() const;
|
||||
QWidget * createWidget(QWidget * parent);
|
||||
void initialize(QDesignerFormEditorInterface * core);
|
||||
|
||||
private:
|
||||
bool m_initialized;
|
||||
|
||||
};
|
||||
|
||||
#endif // LOGVIEWPLUGIN_H
|
||||
@@ -2,12 +2,14 @@
|
||||
#include "edockwidgetplugin.h"
|
||||
#include "emainwindowplugin.h"
|
||||
#include "historyviewplugin.h"
|
||||
#include "logviewplugin.h"
|
||||
|
||||
|
||||
QADApplication::QADApplication(QObject * parent): QObject(parent) {
|
||||
//m_widgets.append(new EDockWidgetPlugin(this));
|
||||
m_widgets.append(new EMainWindowPlugin(this));
|
||||
m_widgets.append(new HistoryViewPlugin(this));
|
||||
m_widgets.append(new LogViewPlugin(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -17,5 +19,5 @@ QList<QDesignerCustomWidgetInterface * > QADApplication::customWidgets() const {
|
||||
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
Q_EXPORT_PLUGIN2(qad_graphic_plugin, QADApplication)
|
||||
Q_EXPORT_PLUGIN2(qad_application_plugin, QADApplication)
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<file>../icons/clear-history.png</file>
|
||||
<file>../icons/layer-visible-off.png</file>
|
||||
<file>../icons/layer-visible-on.png</file>
|
||||
<file>../icons/logview.png</file>
|
||||
<file>../icons/qt.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
BIN
qad/icons/logview.png
Normal file
BIN
qad/icons/logview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 809 B |
@@ -6,6 +6,9 @@
|
||||
MatrixEdit::MatrixEdit(QWidget * parent): QWidget(parent) {
|
||||
ui = new Ui::MatrixEdit();
|
||||
ui->setupUi(this);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
||||
ui->table->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
|
||||
#endif
|
||||
connect(ui->table, SIGNAL(cellChanged(int,int)), this, SIGNAL(changed()));
|
||||
ro = false;
|
||||
}
|
||||
|
||||
@@ -100,9 +100,6 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="table">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="verticalScrollMode">
|
||||
<enum>QAbstractItemView::ScrollPerPixel</enum>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user