git-svn-id: svn://db.shs.com.ru/libs@388 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -20,7 +20,7 @@ file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
|
||||
find_qt(${QtVersions} Core Gui)
|
||||
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
|
||||
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
||||
qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets cd_utils piqt)
|
||||
qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets qad_graphic cd_utils piqt)
|
||||
message(STATUS "Building ${PROJECT_NAME}")
|
||||
|
||||
if(LIBPROJECT)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#include "cdgraphic.h"
|
||||
#include "cdutils_core.h"
|
||||
#include "cdutils_x.h"
|
||||
#include "graphic.h"
|
||||
#include "piqt.h"
|
||||
|
||||
using namespace CDUtils;
|
||||
|
||||
|
||||
CDGraphicWidget::CDGraphicWidget(QWidget * p): QWidget(p), Ui::CDGraphicWidget() {
|
||||
setupUi(this);
|
||||
graphic->setGraphicsCount(0);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
#ifndef CDGRAPHIC_H
|
||||
#define CDGRAPHIC_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_cdgraphic.h"
|
||||
#include <pistring.h>
|
||||
|
||||
namespace CDUtils {
|
||||
class CDType;
|
||||
class CDSection;
|
||||
}
|
||||
|
||||
class Graphic;
|
||||
|
||||
|
||||
class CDGraphicWidget: public QWidget, public Ui::CDGraphicWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
CDGraphicWidget(QWidget * p = 0);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
private slots:
|
||||
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // CDGRAPHIC_H
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "cdgraphics.h"
|
||||
#include "ui_cdgraphic.h"
|
||||
#include "cdutils_core.h"
|
||||
#include "cdutils_x.h"
|
||||
#include "qcd_core.h"
|
||||
@@ -46,8 +47,8 @@ GDockWidget::GDockWidget(QString title, QMainWindow * p): QDockWidget(title, p)
|
||||
menu_x = new QMenu(this);
|
||||
menu_x->setTitle(trUtf8("Remove X"));
|
||||
graphic = new CDGraphicWidget();
|
||||
graphic->graphic->viewport()->setAcceptDrops(true);
|
||||
graphic->graphic->viewport()->installEventFilter(this);
|
||||
graphic->graphic()->viewport()->setAcceptDrops(true);
|
||||
graphic->graphic()->viewport()->installEventFilter(this);
|
||||
setWidget(graphic);
|
||||
}
|
||||
|
||||
@@ -57,9 +58,9 @@ void GDockWidget::addX(const CDType & t) {
|
||||
PIDeque<int> xp = t.path();
|
||||
if (x_list.contains(xp)) return;
|
||||
x_list << xp;
|
||||
int gind = graphic->graphic->graphicsCount();
|
||||
graphic->graphic->setGraphicsCount(gind + 1);
|
||||
graphic->graphic->setGraphicName(PI2QString(t.pathString().join(".")), gind);
|
||||
int gind = graphic->graphic()->graphicsCount();
|
||||
graphic->graphic()->setGraphicsCount(gind + 1);
|
||||
graphic->graphic()->setGraphicName(PI2QString(t.pathString().join(".")), gind);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,9 +69,9 @@ void GDockWidget::drawX(const PIMap<PIString, PIVector<double> > & data) {
|
||||
PIString sp = CDCore::pathToString(x_list[i]);
|
||||
const PIVector<double> & ch(data[sp]);
|
||||
for (int j = 0; j < ch.size_s(); ++j)
|
||||
graphic->graphic->addPoint(ch[j], i, false);
|
||||
graphic->graphic()->addPoint(ch[j], i, false);
|
||||
}
|
||||
graphic->graphic->updateGraphics();
|
||||
graphic->graphic()->updateGraphics();
|
||||
}
|
||||
|
||||
|
||||
@@ -78,9 +79,9 @@ QByteArray GDockWidget::save() const {
|
||||
ChunkStream cs;
|
||||
cs.add(1, windowTitle())
|
||||
.add(2, getList(x_list))
|
||||
.add(3, graphic->graphic->save())
|
||||
.add(4, graphic->evalHistory->expression())
|
||||
.add(5, graphic->evalVisible->expression());
|
||||
.add(3, graphic->graphic()->save())
|
||||
.add(4, graphic->ui->evalHistory->expression())
|
||||
.add(5, graphic->ui->evalVisible->expression());
|
||||
return cs.data();
|
||||
}
|
||||
|
||||
@@ -92,9 +93,9 @@ void GDockWidget::load(QByteArray ba) {
|
||||
switch (cs.read()) {
|
||||
case 1: setWindowTitle(cs.getData<QString>()); break;
|
||||
case 2: x_list = setList(cs.getData<QStringList>()); break;
|
||||
case 3: graphic->graphic->load(cs.getData<QByteArray>()); break;
|
||||
case 4: graphic->evalHistory->setExpression(cs.getData<QString>()); break;
|
||||
case 5: graphic->evalVisible->setExpression(cs.getData<QString>()); break;
|
||||
case 3: graphic->graphic()->load(cs.getData<QByteArray>()); break;
|
||||
case 4: graphic->ui->evalHistory->setExpression(cs.getData<QString>()); break;
|
||||
case 5: graphic->ui->evalVisible->setExpression(cs.getData<QString>()); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@@ -132,13 +133,13 @@ bool GDockWidget::eventFilter(QObject * o, QEvent * e) {
|
||||
|
||||
|
||||
void GDockWidget::contextMenuEvent(QContextMenuEvent * e) {
|
||||
if (graphic->graphic->underMouse()) return;
|
||||
if (graphic->graphic()->underMouse()) return;
|
||||
qDeleteAll(menu_x->actions());
|
||||
menu_x->clear();
|
||||
for (int i = 0; i < graphic->graphic->graphicsCount(); ++i) {
|
||||
for (int i = 0; i < graphic->graphic()->graphicsCount(); ++i) {
|
||||
QPixmap icon(da->iconSize());
|
||||
icon.fill(graphic->graphic->graphic(i).pen.color());
|
||||
QAction * a = new QAction(QIcon(icon), graphic->graphic->graphic(i).name, this);
|
||||
icon.fill(graphic->graphic()->graphic(i).pen.color());
|
||||
QAction * a = new QAction(QIcon(icon), graphic->graphic()->graphic(i).name, this);
|
||||
a->setData(i);
|
||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(removeX()));
|
||||
menu_x->addAction(a);
|
||||
@@ -176,7 +177,7 @@ void GDockWidget::removeX() {
|
||||
int ind = a->data().toInt();
|
||||
if (ind < 0 || ind >= x_list.size_s()) return;
|
||||
x_list.remove(ind);
|
||||
graphic->graphic->removeGraphic(ind);
|
||||
graphic->graphic()->removeGraphic(ind);
|
||||
}
|
||||
|
||||
|
||||
@@ -302,7 +303,7 @@ void CDGraphics::on_buttonAdd_clicked() {
|
||||
|
||||
void CDGraphics::on_buttonClear_clicked() {
|
||||
foreach (GDockWidget * d, docks)
|
||||
d->graphic->graphic->clear();
|
||||
d->graphic->graphic()->clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <QDockWidget>
|
||||
#include <QMenu>
|
||||
#include "ui_cdgraphics.h"
|
||||
#include "cdgraphic.h"
|
||||
#include "qcd_graphic.h"
|
||||
#include <pistring.h>
|
||||
|
||||
namespace CDUtils {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "qcodeedit.h"
|
||||
#include <QFileDialog>
|
||||
#include <QScrollBar>
|
||||
#include <QImageReader>
|
||||
|
||||
using namespace CDUtils;
|
||||
|
||||
@@ -22,6 +23,7 @@ CDPultWindow::CDPultWindow(QWidget *parent) : EMainWindow(parent), Ui::CDPultWin
|
||||
setupUi(this);
|
||||
centralWidget()->hide();
|
||||
CDCore::instance()->initPult();
|
||||
def_config = codeConfig->text();
|
||||
new ConfigHighlighter(codeConfig->document());
|
||||
widgetK->setType(CDUtils::CDType::cdK);
|
||||
widgetX->setType(CDUtils::CDType::cdX);
|
||||
@@ -82,6 +84,7 @@ void CDPultWindow::apply(bool sessions) {
|
||||
dockCDKView->setVisible(checkHasK->isChecked());
|
||||
dockCDXView->setVisible(checkHasX->isChecked());
|
||||
dockCDCView->setVisible(checkHasC->isChecked());
|
||||
QMetaObject::invokeMethod(this, "changedDock", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +106,7 @@ void CDPultWindow::reset(bool full) {
|
||||
|
||||
|
||||
bool CDPultWindow::load(const QString & path) {
|
||||
qApp->setOverrideCursor(Qt::WaitCursor);
|
||||
QPIConfig conf(path, QIODevice::ReadOnly);
|
||||
QAD::File f = editFileK->value().value<QAD::File>();
|
||||
checkSyncFiles->setChecked(false);
|
||||
@@ -111,16 +115,21 @@ bool CDPultWindow::load(const QString & path) {
|
||||
editFileC->setValue(QVariant::fromValue(QAD::File(conf.getValue("file_c").value(), f.filter)));
|
||||
checkSyncFiles->setChecked(conf.getValue("sync_files"));
|
||||
lineSessionName->setText(conf.getValue("session_name"));
|
||||
last_icon = conf.getValue("icon_path", "").value();
|
||||
setAppIcon(conf.getValue("icon", QByteArray()));
|
||||
checkHasK->setChecked(conf.getValue("has_k"));
|
||||
checkHasX->setChecked(conf.getValue("has_x"));
|
||||
checkHasC->setChecked(conf.getValue("has_c"));
|
||||
checkDefaultConfig->setChecked(conf.getValue("default_config"));
|
||||
codeConfig->setText(QByteArray2QString(conf.getValue("config", QByteArray())));
|
||||
if (codeConfig->text().isEmpty())
|
||||
codeConfig->setText(def_config);
|
||||
session_gr = conf.getValue("session_gr", QByteArray());
|
||||
session_mw = conf.getValue("session_mw", QByteArray());
|
||||
setChanged(false);
|
||||
file_name = path;
|
||||
apply(true);
|
||||
qApp->restoreOverrideCursor();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -135,6 +144,8 @@ bool CDPultWindow::save(const QString & path) {
|
||||
conf.setValue("file_c", editFileC->value().value<QAD::File>().file);
|
||||
conf.setValue("sync_files", checkSyncFiles->isChecked());
|
||||
conf.setValue("session_name", lineSessionName->text());
|
||||
conf.setValue("icon_path", last_icon);
|
||||
conf.setValue("icon", appIcon());
|
||||
conf.setValue("has_k", checkHasK->isChecked());
|
||||
conf.setValue("has_x", checkHasX->isChecked());
|
||||
conf.setValue("has_c", checkHasC->isChecked());
|
||||
@@ -161,6 +172,30 @@ void CDPultWindow::savingSession(QPIConfig & conf) {
|
||||
}
|
||||
|
||||
|
||||
QByteArray CDPultWindow::appIcon() const {
|
||||
QByteArray ret;
|
||||
if (icon.isNull()) return ret;
|
||||
QBuffer buff(&ret);
|
||||
buff.open(QIODevice::WriteOnly);
|
||||
icon.save(&buff, "png");
|
||||
//qDebug() << "s" << ret.size();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void CDPultWindow::setAppIcon(QByteArray ba) {
|
||||
if (ba.isEmpty()) {
|
||||
icon = QImage();
|
||||
setWindowIcon(QIcon());
|
||||
return;
|
||||
}
|
||||
//qDebug() << "l" << ba.size();
|
||||
icon = QImage::fromData(ba);
|
||||
setWindowIcon(QIcon(QPixmap::fromImage(icon)));
|
||||
//qDebug() << QApplication::windowIcon().availableSizes();
|
||||
}
|
||||
|
||||
|
||||
void CDPultWindow::addToLog(CDViewWidget::LogIcon icon, const QString & msg) {
|
||||
QListWidgetItem * ni = new QListWidgetItem(log_icons[icon], "(" + QTime::currentTime().toString() + ") " + msg);
|
||||
bool s = listLog->verticalScrollBar()->value() == listLog->verticalScrollBar()->maximum();
|
||||
@@ -210,3 +245,14 @@ void CDPultWindow::on_buttonSessionApply_clicked() {
|
||||
void CDPultWindow::on_lineSessionName_textChanged(const QString & t) {
|
||||
setWindowTitle(QString("CD Pult - %1").arg(t));
|
||||
}
|
||||
|
||||
|
||||
void CDPultWindow::on_buttonIcon_clicked() {
|
||||
QList<QByteArray> ifl = QImageReader::supportedImageFormats();
|
||||
QStringList sfl; foreach (QByteArray s, ifl) sfl << ("*." + QString(s).toLower());
|
||||
QString f = QFileDialog::getOpenFileName(this, tr("Select icon"), last_icon, tr("Images") + " (" + sfl.join(" ") + ")");
|
||||
if (f.isEmpty()) return;
|
||||
last_icon = f;
|
||||
icon = QImage(last_icon);
|
||||
setWindowIcon(QIcon(QPixmap::fromImage(icon)));
|
||||
}
|
||||
|
||||
@@ -30,9 +30,14 @@ private:
|
||||
void loadingSession(QPIConfig & conf);
|
||||
void savingSession(QPIConfig & conf);
|
||||
|
||||
QByteArray appIcon() const;
|
||||
void setAppIcon(QByteArray ba);
|
||||
|
||||
Ribbon * ribbon;
|
||||
QMap<CDViewWidget::LogIcon, QIcon> log_icons;
|
||||
QByteArray session_gr, session_mw;
|
||||
QString def_config, last_icon;
|
||||
QImage icon;
|
||||
|
||||
private slots:
|
||||
void addToLog(CDViewWidget::LogIcon icon, const QString & msg);
|
||||
@@ -40,6 +45,7 @@ private slots:
|
||||
void on_buttonSessionApply_clicked();
|
||||
|
||||
void on_lineSessionName_textChanged(const QString & t);
|
||||
void on_buttonIcon_clicked();
|
||||
};
|
||||
|
||||
#endif // CDPULTWINDOW_H
|
||||
|
||||
@@ -46,12 +46,6 @@
|
||||
<addaction name="menuOpen_recent"/>
|
||||
<addaction name="actionSave"/>
|
||||
<addaction name="actionSaveAs"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCalculate_K"/>
|
||||
<addaction name="actionSend_K"/>
|
||||
<addaction name="actionReceive_K"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionParse"/>
|
||||
</widget>
|
||||
<addaction name="menuMain"/>
|
||||
</widget>
|
||||
@@ -150,43 +144,6 @@
|
||||
</attribute>
|
||||
<widget class="QWidget" name="dockWidgetContents_4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonSessionLoad">
|
||||
<property name="text">
|
||||
<string>Load ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/application/qad_application.qrc">
|
||||
<normaloff>:/icons/document-open-recent.png</normaloff>:/icons/document-open-recent.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonSessionSave">
|
||||
<property name="text">
|
||||
<string>Save ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/application/qad_application.qrc">
|
||||
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonSessionSaveAs">
|
||||
<property name="text">
|
||||
<string>Save as ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/application/qad_application.qrc">
|
||||
<normaloff>:/icons/document-save-as.png</normaloff>:/icons/document-save-as.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonSessionApply">
|
||||
<property name="text">
|
||||
@@ -214,7 +171,22 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="CLineEdit" name="lineSessionName"/>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="CLineEdit" name="lineSessionName"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonIcon">
|
||||
<property name="toolTip">
|
||||
<string>Select icon</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/blockview/qad_blockview.qrc">
|
||||
<normaloff>:/icons/view-preview.png</normaloff>:/icons/view-preview.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
@@ -387,61 +359,9 @@ device.cd = eth://udp:${ip.pult}:27002:${ip.app}:27001 #s
|
||||
<string>Ctrl+Shift+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSend_K">
|
||||
<property name="icon">
|
||||
<iconset resource="cdpult.qrc">
|
||||
<normaloff>:/icons/db-export.png</normaloff>:/icons/db-export.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Send K</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+D</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReceive_K">
|
||||
<property name="icon">
|
||||
<iconset resource="cdpult.qrc">
|
||||
<normaloff>:/icons/db-import.png</normaloff>:/icons/db-import.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Receive K</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+R</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionParse">
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/widgets/qad_widgets.qrc">
|
||||
<normaloff>:/icons/tools-wizard.png</normaloff>:/icons/tools-wizard.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Parse...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Shift+P</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCalculate_K">
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/graphic/qpicalculator/qpicalculator.qrc">
|
||||
<normaloff>:/icons/Apps-accessories-calculator-icon.png</normaloff>:/icons/Apps-accessories-calculator-icon.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Calculate K</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Return</string>
|
||||
</property>
|
||||
</action>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="actionSave"/>
|
||||
<addaction name="actionSaveAs"/>
|
||||
<addaction name="actionSend_K"/>
|
||||
<addaction name="actionReceive_K"/>
|
||||
<addaction name="actionParse"/>
|
||||
<addaction name="actionCalculate_K"/>
|
||||
<addaction name="menuMain"/>
|
||||
<addaction name="menuOpen_recent"/>
|
||||
<addaction name="separator"/>
|
||||
@@ -464,6 +384,8 @@ device.cd = eth://udp:${ip.pult}:27002:${ip.app}:27001 #s
|
||||
<addaction name="separator"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
@@ -509,7 +431,6 @@ device.cd = eth://udp:${ip.pult}:27002:${ip.app}:27001 #s
|
||||
<resources>
|
||||
<include location="../../qad/application/qad_application.qrc"/>
|
||||
<include location="../../qad/blockview/qad_blockview.qrc"/>
|
||||
<include location="../../qad/graphic/qpicalculator/qpicalculator.qrc"/>
|
||||
<include location="../../qad/widgets/qad_widgets.qrc"/>
|
||||
<include location="cdpult.qrc"/>
|
||||
</resources>
|
||||
@@ -594,54 +515,6 @@ device.cd = eth://udp:${ip.pult}:27002:${ip.app}:27001 #s
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonSessionLoad</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>CDPultWindow</receiver>
|
||||
<slot>openFile()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>589</x>
|
||||
<y>68</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>803</x>
|
||||
<y>62</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonSessionSave</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>CDPultWindow</receiver>
|
||||
<slot>saveFile()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>671</x>
|
||||
<y>70</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>806</x>
|
||||
<y>48</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonSessionSaveAs</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>CDPultWindow</receiver>
|
||||
<slot>saveAsFile()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>754</x>
|
||||
<y>66</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>805</x>
|
||||
<y>106</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>checkDefaultConfig</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
|
||||
@@ -29,30 +29,19 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="buttonSave">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonSend">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
<string>Send</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/application/qad_application.qrc">
|
||||
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||
<iconset resource="cdpult.qrc">
|
||||
<normaloff>:/icons/flame.png</normaloff>:/icons/flame.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="buttonLoad">
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/application/qad_application.qrc">
|
||||
<normaloff>:/icons/document-open.png</normaloff>:/icons/document-open.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonReceive">
|
||||
<property name="text">
|
||||
<string>Receive</string>
|
||||
@@ -63,7 +52,61 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<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>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonLoad">
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/application/qad_application.qrc">
|
||||
<normaloff>:/icons/document-open.png</normaloff>:/icons/document-open.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonSave">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qad/application/qad_application.qrc">
|
||||
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</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>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonParse">
|
||||
<property name="text">
|
||||
<string>Update description ...</string>
|
||||
@@ -74,16 +117,21 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="buttonSend">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="cdpult.qrc">
|
||||
<normaloff>:/icons/flame.png</normaloff>:/icons/flame.png</iconset>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>1</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
||||
30
qcd_utils/qcd_graphic.cpp
Normal file
30
qcd_utils/qcd_graphic.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "qcd_graphic.h"
|
||||
#include "ui_qcd_graphic.h"
|
||||
#include "cdutils_core.h"
|
||||
#include "cdutils_x.h"
|
||||
#include "graphic.h"
|
||||
#include "piqt.h"
|
||||
|
||||
using namespace CDUtils;
|
||||
|
||||
|
||||
CDGraphicWidget::CDGraphicWidget(QWidget * p): QWidget(p) {
|
||||
ui = new Ui::CDGraphicWidget();
|
||||
ui->setupUi(this);
|
||||
ui->graphic->setGraphicsCount(0);
|
||||
}
|
||||
|
||||
|
||||
Graphic * CDGraphicWidget::graphic() const {
|
||||
return ui->graphic;
|
||||
}
|
||||
|
||||
|
||||
void CDGraphicWidget::setConfigVisible(bool on) {
|
||||
ui->widgetConfig->setVisible(on);
|
||||
}
|
||||
|
||||
|
||||
bool CDGraphicWidget::isConfigVisible() const {
|
||||
return ui->widgetConfig->isVisible();
|
||||
}
|
||||
40
qcd_utils/qcd_graphic.h
Normal file
40
qcd_utils/qcd_graphic.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef QCD_GRAPHIC_H
|
||||
#define QCD_GRAPHIC_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <pistring.h>
|
||||
|
||||
namespace CDUtils {
|
||||
class CDType;
|
||||
class CDSection;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class CDGraphicWidget;
|
||||
}
|
||||
|
||||
class Graphic;
|
||||
|
||||
|
||||
class CDGraphicWidget: public QWidget {
|
||||
Q_OBJECT
|
||||
friend class CDGraphics;
|
||||
friend class GDockWidget;
|
||||
public:
|
||||
CDGraphicWidget(QWidget * p = 0);
|
||||
|
||||
Graphic * graphic() const;
|
||||
void setConfigVisible(bool on);
|
||||
bool isConfigVisible() const;
|
||||
|
||||
private:
|
||||
Ui::CDGraphicWidget * ui;
|
||||
|
||||
private slots:
|
||||
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // QCD_GRAPHIC_H
|
||||
Reference in New Issue
Block a user