git-svn-id: svn://db.shs.com.ru/libs@238 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -165,7 +165,10 @@ void Form::on_pushButton_4_clicked() {
|
||||
|
||||
|
||||
void Form::on_pushButton_6_clicked() {
|
||||
ui->treeView->buildFromHeader(QFileDialog::getOpenFileName(this, trUtf8("Select *.h file with K description"), "k_description.h", "C/C++ header files(*.h *.hpp);;All files(*)"));
|
||||
QString fn = QFileDialog::getOpenFileName(this, trUtf8("Select *.h file with K description"), "k_description.h", "C/C++ header files(*.h *.hpp);;All files(*)");
|
||||
if (fn.isEmpty()) return;
|
||||
if (mode_dlg.exec() == QDialog::Rejected) return;
|
||||
ui->treeView->buildFromHeader(fn, mode_dlg.mode());
|
||||
/*piCout << K.root()["Radar_WaveFreqTune"];
|
||||
piCout << K.root()["11.NVA_PulseGenFineTune"];
|
||||
piCout << K.root()[".NVA.NVA_PulseGenFineTune"];
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define FORM_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <qcd_modedialog.h>
|
||||
|
||||
namespace Ui {
|
||||
class Form;
|
||||
@@ -22,7 +23,9 @@ private slots:
|
||||
void on_buttonCalc_clicked();
|
||||
|
||||
private:
|
||||
Ui::Form *ui;
|
||||
Ui::Form * ui;
|
||||
QCDModeDialog mode_dlg;
|
||||
|
||||
};
|
||||
|
||||
#endif // FORM_H
|
||||
|
||||
@@ -80,11 +80,11 @@ void CDKView::clearK() {
|
||||
}
|
||||
|
||||
|
||||
void CDKView::buildFromHeader(const QString &kdescription) {
|
||||
void CDKView::buildFromHeader(const QString &kdescription, int mode) {
|
||||
if (kdescription.isEmpty()) return;
|
||||
PIString kdesc_file = Q2PIString(QDir::current().relativeFilePath(kdescription));
|
||||
PIFile f(kdesc_file, PIIODevice::ReadOnly);
|
||||
K.update(&f);
|
||||
K.update(&f, mode);
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public slots:
|
||||
void saveK();
|
||||
void loadK();
|
||||
void clearK();
|
||||
void buildFromHeader(const QString & kdescription);
|
||||
void buildFromHeader(const QString & kdescription, int mode = 2);
|
||||
void calculateK();
|
||||
|
||||
private slots:
|
||||
|
||||
46
qcd_utils/qcd_modedialog.cpp
Normal file
46
qcd_utils/qcd_modedialog.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "qcd_modedialog.h"
|
||||
#include "ui_qcd_modedialog.h"
|
||||
|
||||
|
||||
QCDModeDialog::QCDModeDialog(QWidget * parent): QDialog(parent) {
|
||||
ui = new Ui::QCDModeDialog();
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
|
||||
QCDModeDialog::~QCDModeDialog() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
CDUtils::UpdateModeFlags QCDModeDialog::mode() const {
|
||||
CDUtils::UpdateModeFlags ret = 0;
|
||||
if (ui->checkSaveIndex->isChecked()) ret |= CDUtils::SaveByIndex;
|
||||
if (ui->checkSaveName->isChecked()) ret |= CDUtils::SaveByName;
|
||||
if (ui->checkMerge->isChecked()) ret |= CDUtils::Merge;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void QCDModeDialog::changeEvent(QEvent *e) {
|
||||
QDialog::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void QCDModeDialog::on_checkSaveIndex_clicked(bool checked) {
|
||||
if (!checked) return;
|
||||
ui->checkSaveName->setChecked(false);
|
||||
}
|
||||
|
||||
|
||||
void QCDModeDialog::on_checkSaveName_clicked(bool checked) {
|
||||
if (!checked) return;
|
||||
ui->checkSaveIndex->setChecked(false);
|
||||
}
|
||||
31
qcd_utils/qcd_modedialog.h
Normal file
31
qcd_utils/qcd_modedialog.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef QCD_MODEDIALOG_H
|
||||
#define QCD_MODEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <cdutils_types.h>
|
||||
|
||||
namespace Ui {
|
||||
class QCDModeDialog;
|
||||
}
|
||||
|
||||
class QCDModeDialog: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QCDModeDialog(QWidget * parent = 0);
|
||||
~QCDModeDialog();
|
||||
|
||||
CDUtils::UpdateModeFlags mode() const;
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
Ui::QCDModeDialog * ui;
|
||||
|
||||
private slots:
|
||||
void on_checkSaveIndex_clicked(bool checked);
|
||||
void on_checkSaveName_clicked(bool checked);
|
||||
|
||||
};
|
||||
|
||||
#endif // QCD_MODEDIALOG_H
|
||||
85
qcd_utils/qcd_modedialog.ui
Normal file
85
qcd_utils/qcd_modedialog.ui
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QCDModeDialog</class>
|
||||
<widget class="QDialog" name="QCDModeDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>251</width>
|
||||
<height>152</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Update description mode</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkSaveIndex">
|
||||
<property name="text">
|
||||
<string>Save by index</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkSaveName">
|
||||
<property name="text">
|
||||
<string>Save by name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkMerge">
|
||||
<property name="text">
|
||||
<string>Merge</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>QCDModeDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>106</x>
|
||||
<y>131</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>101</x>
|
||||
<y>146</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>QCDModeDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>182</x>
|
||||
<y>127</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>169</x>
|
||||
<y>146</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user