mirror of https://github.com/KLayout/klayout.git
Merge remote-tracking branch 'origin/master' into master-mac-qt6
This commit is contained in:
commit
bcd0f30b4e
|
|
@ -4,6 +4,7 @@ recursive-include src/edt/edt *.cc *.h
|
|||
recursive-include src/gsi/gsi *.cc *.h
|
||||
recursive-include src/img/img *.cc *.h
|
||||
recursive-include src/laybasic/laybasic *.cc *.h
|
||||
recursive-include src/layview/layview *.cc *.h
|
||||
recursive-include src/lib/lib *.cc *.h
|
||||
recursive-include src/lym/lym *.cc *.h
|
||||
recursive-include src/pya/pya *.cc *.h
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ equals(HAVE_RUBY, "1") {
|
|||
|
||||
}
|
||||
|
||||
LANG_DEPENDS =
|
||||
LANG_DEPENDS =
|
||||
MAIN_DEPENDS =
|
||||
|
||||
equals(HAVE_RUBY, "1") {
|
||||
|
|
@ -64,7 +64,6 @@ db.depends += gsi
|
|||
rdb.depends += db
|
||||
lib.depends += db
|
||||
|
||||
buddies.depends += plugins lym $$LANG_DEPENDS
|
||||
lym.depends += gsi $$LANG_DEPENDS
|
||||
|
||||
laybasic.depends += rdb
|
||||
|
|
@ -74,10 +73,10 @@ ant.depends += layview
|
|||
img.depends += layview
|
||||
edt.depends += layview
|
||||
|
||||
plugins.depends += lib rdb db ant
|
||||
plugins.depends += lib
|
||||
|
||||
equals(HAVE_PYTHON, "1") {
|
||||
pymod.depends += layview ant img edt lym
|
||||
pymod.depends += layview lib ant img edt lym
|
||||
}
|
||||
|
||||
equals(HAVE_RUBY, "1") {
|
||||
|
|
@ -107,12 +106,17 @@ equals(HAVE_RUBY, "1") {
|
|||
|
||||
layui.depends += laybasic
|
||||
layview.depends += layui
|
||||
lay.depends += ant img edt layui
|
||||
lay.depends += ant img edt layui lym
|
||||
|
||||
plugins.depends += lay
|
||||
|
||||
klayout_main.depends += plugins $$MAIN_DEPENDS
|
||||
|
||||
} else {
|
||||
|
||||
plugins.depends += layview ant img edt
|
||||
|
||||
}
|
||||
|
||||
unit_tests.depends += plugins $$MAIN_DEPENDS $$LANG_DEPENDS
|
||||
buddies.depends += plugins lym $$LANG_DEPENDS
|
||||
unit_tests.depends += plugins lym $$MAIN_DEPENDS $$LANG_DEPENDS
|
||||
|
|
|
|||
|
|
@ -192,11 +192,6 @@ win32 {
|
|||
LIBS += -lexecinfo
|
||||
}
|
||||
|
||||
# Note: this accounts for UI-generated headers placed into the output folders in
|
||||
# shadow builds:
|
||||
INCLUDEPATH += $$DESTDIR/laybasic/laybasic
|
||||
DEPENDPATH += $$DESTDIR/laybasic/laybasic
|
||||
|
||||
INCLUDEPATH += $$QTBASIC_INC
|
||||
DEPENDPATH += $$QTBASIC_INC
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
#include "dbStream.h"
|
||||
#include "tlClassRegistry.h"
|
||||
|
||||
#include "ui_SaveLayoutOptionsDialog.h"
|
||||
#include "ui_SaveLayoutAsOptionsDialog.h"
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QPushButton>
|
||||
|
||||
|
|
@ -76,17 +79,19 @@ static tl::OutputStream::OutputStreamMode index_to_om (unsigned int i)
|
|||
// SaveLayoutOptionsDialog implementation
|
||||
|
||||
SaveLayoutOptionsDialog::SaveLayoutOptionsDialog (QWidget *parent, const std::string &title)
|
||||
: QDialog (parent), Ui::SaveLayoutOptionsDialog (),
|
||||
: QDialog (parent),
|
||||
m_technology_index (-1)
|
||||
{
|
||||
mp_ui = new Ui::SaveLayoutOptionsDialog ();
|
||||
|
||||
setObjectName (QString::fromUtf8 ("save_layout_options_dialog"));
|
||||
|
||||
Ui::SaveLayoutOptionsDialog::setupUi (this);
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
setWindowTitle (tl::to_qstring (title));
|
||||
|
||||
while (options_tab->count () > 0) {
|
||||
options_tab->removeTab (0);
|
||||
while (mp_ui->options_tab->count () > 0) {
|
||||
mp_ui->options_tab->removeTab (0);
|
||||
}
|
||||
|
||||
bool any_option = false;
|
||||
|
|
@ -98,11 +103,11 @@ SaveLayoutOptionsDialog::SaveLayoutOptionsDialog (QWidget *parent, const std::st
|
|||
// obtain the config page from the plugin which we identify by format name
|
||||
const StreamWriterPluginDeclaration *decl = StreamWriterPluginDeclaration::plugin_for_format (fmt->format_name ());
|
||||
|
||||
QScrollArea *page_host = new QScrollArea (options_tab);
|
||||
QScrollArea *page_host = new QScrollArea (mp_ui->options_tab);
|
||||
page_host->setFrameStyle (QFrame::NoFrame);
|
||||
page_host->setWidgetResizable (true);
|
||||
|
||||
page = decl ? decl->format_specific_options_page (options_tab) : 0;
|
||||
page = decl ? decl->format_specific_options_page (mp_ui->options_tab) : 0;
|
||||
if (page) {
|
||||
page_host->setWidget (page);
|
||||
} else {
|
||||
|
|
@ -120,7 +125,7 @@ SaveLayoutOptionsDialog::SaveLayoutOptionsDialog (QWidget *parent, const std::st
|
|||
}
|
||||
|
||||
if (page_host) {
|
||||
options_tab->addTab (page_host, tl::to_qstring (fmt->format_desc ()));
|
||||
mp_ui->options_tab->addTab (page_host, tl::to_qstring (fmt->format_desc ()));
|
||||
m_pages.push_back (std::make_pair (page, fmt->format_name ()));
|
||||
any_option = true;
|
||||
}
|
||||
|
|
@ -128,12 +133,12 @@ SaveLayoutOptionsDialog::SaveLayoutOptionsDialog (QWidget *parent, const std::st
|
|||
}
|
||||
|
||||
if (! any_option) {
|
||||
options_tab->hide ();
|
||||
mp_ui->options_tab->hide ();
|
||||
}
|
||||
|
||||
connect (buttonBox, SIGNAL (accepted ()), this, SLOT (ok_button_pressed ()));
|
||||
connect (buttonBox, SIGNAL (clicked (QAbstractButton *)), this, SLOT (button_pressed (QAbstractButton *)));
|
||||
connect (tech_cbx, SIGNAL (currentIndexChanged (int)), this, SLOT (current_tech_changed (int)));
|
||||
connect (mp_ui->buttonBox, SIGNAL (accepted ()), this, SLOT (ok_button_pressed ()));
|
||||
connect (mp_ui->buttonBox, SIGNAL (clicked (QAbstractButton *)), this, SLOT (button_pressed (QAbstractButton *)));
|
||||
connect (mp_ui->tech_cbx, SIGNAL (currentIndexChanged (int)), this, SLOT (current_tech_changed (int)));
|
||||
}
|
||||
|
||||
SaveLayoutOptionsDialog::~SaveLayoutOptionsDialog ()
|
||||
|
|
@ -144,7 +149,7 @@ SaveLayoutOptionsDialog::~SaveLayoutOptionsDialog ()
|
|||
void
|
||||
SaveLayoutOptionsDialog::button_pressed (QAbstractButton *button)
|
||||
{
|
||||
if (button == buttonBox->button (QDialogButtonBox::Reset)) {
|
||||
if (button == mp_ui->buttonBox->button (QDialogButtonBox::Reset)) {
|
||||
reset_button_pressed ();
|
||||
}
|
||||
}
|
||||
|
|
@ -239,8 +244,8 @@ SaveLayoutOptionsDialog::edit_global_options (lay::Dispatcher *config_root, db::
|
|||
std::string technology;
|
||||
config_root->config_get (cfg_initial_technology, technology);
|
||||
|
||||
tech_cbx->blockSignals (true);
|
||||
tech_cbx->clear ();
|
||||
mp_ui->tech_cbx->blockSignals (true);
|
||||
mp_ui->tech_cbx->clear ();
|
||||
|
||||
unsigned int i = 0;
|
||||
m_technology_index = -1;
|
||||
|
|
@ -256,16 +261,16 @@ SaveLayoutOptionsDialog::edit_global_options (lay::Dispatcher *config_root, db::
|
|||
m_opt_array.push_back (t->save_layout_options ());
|
||||
m_tech_array.push_back (t.operator-> ());
|
||||
|
||||
tech_cbx->addItem (tl::to_qstring (d));
|
||||
mp_ui->tech_cbx->addItem (tl::to_qstring (d));
|
||||
if (t->name () == technology) {
|
||||
tech_cbx->setCurrentIndex (i);
|
||||
mp_ui->tech_cbx->setCurrentIndex (i);
|
||||
m_technology_index = i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tech_cbx->blockSignals (false);
|
||||
tech_cbx->show ();
|
||||
mp_ui->tech_cbx->blockSignals (false);
|
||||
mp_ui->tech_cbx->show ();
|
||||
|
||||
if (get_options_internal ()) {
|
||||
|
||||
|
|
@ -289,7 +294,7 @@ SaveLayoutOptionsDialog::edit_global_options (lay::Dispatcher *config_root, db::
|
|||
bool
|
||||
SaveLayoutOptionsDialog::get_options (db::SaveLayoutOptions &options)
|
||||
{
|
||||
tech_cbx->hide ();
|
||||
mp_ui->tech_cbx->hide ();
|
||||
|
||||
m_opt_array.clear ();
|
||||
m_opt_array.push_back (options);
|
||||
|
|
@ -322,22 +327,24 @@ SaveLayoutOptionsDialog::get_options_internal ()
|
|||
// SaveLayoutAsOptionsDialog implementation
|
||||
|
||||
SaveLayoutAsOptionsDialog::SaveLayoutAsOptionsDialog (QWidget *parent, const std::string &title)
|
||||
: QDialog (parent), Ui::SaveLayoutAsOptionsDialog (), mp_tech (0)
|
||||
: QDialog (parent), mp_tech (0)
|
||||
{
|
||||
mp_ui = new Ui::SaveLayoutAsOptionsDialog ();
|
||||
|
||||
setObjectName (QString::fromUtf8 ("save_layout_options_dialog"));
|
||||
|
||||
Ui::SaveLayoutAsOptionsDialog::setupUi (this);
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
setWindowTitle (tl::to_qstring (title));
|
||||
|
||||
QWidget *empty_widget = new QWidget (options_stack);
|
||||
int empty_widget_index = options_stack->addWidget (empty_widget);
|
||||
QWidget *empty_widget = new QWidget (mp_ui->options_stack);
|
||||
int empty_widget_index = mp_ui->options_stack->addWidget (empty_widget);
|
||||
|
||||
for (tl::Registrar<db::StreamFormatDeclaration>::iterator fmt = tl::Registrar<db::StreamFormatDeclaration>::begin (); fmt != tl::Registrar<db::StreamFormatDeclaration>::end (); ++fmt) {
|
||||
|
||||
if (fmt->can_write ()) {
|
||||
|
||||
fmt_cbx->addItem (tl::to_qstring (fmt->format_title ()));
|
||||
mp_ui->fmt_cbx->addItem (tl::to_qstring (fmt->format_title ()));
|
||||
|
||||
// obtain the config page from the plugin which we identify by format name
|
||||
const StreamWriterPluginDeclaration *decl = plugin_for_format (fmt->format_name ());
|
||||
|
|
@ -367,10 +374,10 @@ SaveLayoutAsOptionsDialog::SaveLayoutAsOptionsDialog (QWidget *parent, const std
|
|||
|
||||
} else {
|
||||
|
||||
StreamWriterOptionsPage *page = decl->format_specific_options_page (options_stack);
|
||||
StreamWriterOptionsPage *page = decl->format_specific_options_page (mp_ui->options_stack);
|
||||
|
||||
m_pages.push_back (std::make_pair (page, fmt->format_name ()));
|
||||
m_tab_positions.push_back (page ? options_stack->addWidget (page) : empty_widget_index);
|
||||
m_tab_positions.push_back (page ? mp_ui->options_stack->addWidget (page) : empty_widget_index);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -385,8 +392,8 @@ SaveLayoutAsOptionsDialog::SaveLayoutAsOptionsDialog (QWidget *parent, const std
|
|||
|
||||
}
|
||||
|
||||
connect (buttonBox, SIGNAL (accepted ()), this, SLOT (ok_button_pressed ()));
|
||||
connect (fmt_cbx, SIGNAL (activated (int)), this, SLOT (fmt_cbx_changed (int)));
|
||||
connect (mp_ui->buttonBox, SIGNAL (accepted ()), this, SLOT (ok_button_pressed ()));
|
||||
connect (mp_ui->fmt_cbx, SIGNAL (activated (int)), this, SLOT (fmt_cbx_changed (int)));
|
||||
}
|
||||
|
||||
SaveLayoutAsOptionsDialog::~SaveLayoutAsOptionsDialog ()
|
||||
|
|
@ -400,7 +407,7 @@ SaveLayoutAsOptionsDialog::ok_button_pressed ()
|
|||
BEGIN_PROTECTED
|
||||
|
||||
// get the name of the currently selected format
|
||||
int index = fmt_cbx->currentIndex ();
|
||||
int index = mp_ui->fmt_cbx->currentIndex ();
|
||||
std::string fmt_name;
|
||||
for (tl::Registrar<db::StreamFormatDeclaration>::iterator fmt = tl::Registrar<db::StreamFormatDeclaration>::begin (); fmt != tl::Registrar<db::StreamFormatDeclaration>::end () && index >= 0; ++fmt) {
|
||||
if (fmt->can_write ()) {
|
||||
|
|
@ -419,7 +426,7 @@ SaveLayoutAsOptionsDialog::ok_button_pressed ()
|
|||
if (page->first) {
|
||||
std::unique_ptr<db::FormatSpecificWriterOptions> options (decl->create_specific_options ());
|
||||
if (options.get ()) {
|
||||
page->first->commit (options.get (), mp_tech, tl::OutputStream::output_mode_from_filename (m_filename, index_to_om (compression->currentIndex ())) != tl::OutputStream::OM_Plain);
|
||||
page->first->commit (options.get (), mp_tech, tl::OutputStream::output_mode_from_filename (m_filename, index_to_om (mp_ui->compression->currentIndex ())) != tl::OutputStream::OM_Plain);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -428,8 +435,8 @@ SaveLayoutAsOptionsDialog::ok_button_pressed ()
|
|||
}
|
||||
|
||||
double x = 0.0;
|
||||
tl::from_string_ext (tl::to_string (dbu_le->text ()), x);
|
||||
tl::from_string_ext (tl::to_string (sf_le->text ()), x);
|
||||
tl::from_string_ext (tl::to_string (mp_ui->dbu_le->text ()), x);
|
||||
tl::from_string_ext (tl::to_string (mp_ui->sf_le->text ()), x);
|
||||
|
||||
accept ();
|
||||
|
||||
|
|
@ -449,19 +456,19 @@ SaveLayoutAsOptionsDialog::get_options (lay::LayoutViewBase *view, unsigned int
|
|||
const db::Layout &layout = cv->layout ();
|
||||
|
||||
m_filename = fn;
|
||||
filename_lbl->setText (tl::to_qstring (fn));
|
||||
compression->setCurrentIndex (om_to_index (om));
|
||||
mp_ui->filename_lbl->setText (tl::to_qstring (fn));
|
||||
mp_ui->compression->setCurrentIndex (om_to_index (om));
|
||||
|
||||
dbu_le->setText (tl::to_qstring (tl::to_string (options.dbu ())));
|
||||
mp_ui->dbu_le->setText (tl::to_qstring (tl::to_string (options.dbu ())));
|
||||
|
||||
fmt_cbx->setCurrentIndex (0);
|
||||
mp_ui->fmt_cbx->setCurrentIndex (0);
|
||||
fmt_cbx_changed (0);
|
||||
|
||||
unsigned int i = 0;
|
||||
for (tl::Registrar<db::StreamFormatDeclaration>::iterator fmt = tl::Registrar<db::StreamFormatDeclaration>::begin (); fmt != tl::Registrar<db::StreamFormatDeclaration>::end (); ++fmt) {
|
||||
if (fmt->can_write ()) {
|
||||
if (fmt->format_name () == options.format ()) {
|
||||
fmt_cbx->setCurrentIndex (i);
|
||||
mp_ui->fmt_cbx->setCurrentIndex (i);
|
||||
fmt_cbx_changed (i);
|
||||
break;
|
||||
}
|
||||
|
|
@ -495,9 +502,9 @@ SaveLayoutAsOptionsDialog::get_options (lay::LayoutViewBase *view, unsigned int
|
|||
|
||||
if (exec ()) {
|
||||
|
||||
om = index_to_om (compression->currentIndex ());
|
||||
om = index_to_om (mp_ui->compression->currentIndex ());
|
||||
|
||||
int index = fmt_cbx->currentIndex ();
|
||||
int index = mp_ui->fmt_cbx->currentIndex ();
|
||||
for (tl::Registrar<db::StreamFormatDeclaration>::iterator fmt = tl::Registrar<db::StreamFormatDeclaration>::begin (); fmt != tl::Registrar<db::StreamFormatDeclaration>::end () && index >= 0; ++fmt) {
|
||||
if (fmt->can_write ()) {
|
||||
if (index-- == 0) {
|
||||
|
|
@ -507,19 +514,19 @@ SaveLayoutAsOptionsDialog::get_options (lay::LayoutViewBase *view, unsigned int
|
|||
}
|
||||
|
||||
double dbu = 0.0;
|
||||
tl::from_string_ext (tl::to_string (dbu_le->text ()), dbu);
|
||||
tl::from_string_ext (tl::to_string (mp_ui->dbu_le->text ()), dbu);
|
||||
|
||||
double sf = 1.0;
|
||||
tl::from_string_ext (tl::to_string (sf_le->text ()), sf);
|
||||
tl::from_string_ext (tl::to_string (mp_ui->sf_le->text ()), sf);
|
||||
|
||||
options.set_dbu (dbu);
|
||||
options.set_scale_factor (sf);
|
||||
|
||||
options.set_dont_write_empty_cells (no_empty_cells_cb->isChecked ());
|
||||
options.set_keep_instances (keep_instances_cb->isChecked ());
|
||||
options.set_write_context_info (store_context_cb->isChecked ());
|
||||
options.set_dont_write_empty_cells (mp_ui->no_empty_cells_cb->isChecked ());
|
||||
options.set_keep_instances (mp_ui->keep_instances_cb->isChecked ());
|
||||
options.set_write_context_info (mp_ui->store_context_cb->isChecked ());
|
||||
|
||||
if (no_hidden_cells_cb->isChecked ()) {
|
||||
if (mp_ui->no_hidden_cells_cb->isChecked ()) {
|
||||
options.clear_cells ();
|
||||
for (db::Layout::const_iterator c = layout.begin (); c != layout.end (); ++c) {
|
||||
if (! view->is_cell_hidden (c->cell_index (), cv_index)) {
|
||||
|
|
@ -530,16 +537,16 @@ SaveLayoutAsOptionsDialog::get_options (lay::LayoutViewBase *view, unsigned int
|
|||
options.select_all_cells ();
|
||||
}
|
||||
|
||||
if (layersel_cbx->currentIndex () == 0 /*all*/) {
|
||||
if (mp_ui->layersel_cbx->currentIndex () == 0 /*all*/) {
|
||||
options.select_all_layers ();
|
||||
} else if (layersel_cbx->currentIndex () == 1 /*shown layers*/) {
|
||||
} else if (mp_ui->layersel_cbx->currentIndex () == 1 /*shown layers*/) {
|
||||
options.deselect_all_layers ();
|
||||
for (LayerPropertiesConstIterator layer = view->begin_layers (); layer != view->end_layers (); ++layer) {
|
||||
if (layer->cellview_index () == int (cv_index)) {
|
||||
options.add_layer (layer->layer_index ());
|
||||
}
|
||||
}
|
||||
} else if (layersel_cbx->currentIndex () == 2 /*visible layers*/) {
|
||||
} else if (mp_ui->layersel_cbx->currentIndex () == 2 /*visible layers*/) {
|
||||
options.deselect_all_layers ();
|
||||
for (LayerPropertiesConstIterator layer = view->begin_layers (); layer != view->end_layers (); ++layer) {
|
||||
if (layer->cellview_index () == int (cv_index) && layer->visible (true)) {
|
||||
|
|
@ -559,7 +566,7 @@ SaveLayoutAsOptionsDialog::get_options (lay::LayoutViewBase *view, unsigned int
|
|||
|
||||
if (specific_options.get ()) {
|
||||
if (page->first) {
|
||||
page->first->commit (specific_options.get (), mp_tech, tl::OutputStream::output_mode_from_filename (m_filename, index_to_om (compression->currentIndex ())) != tl::OutputStream::OM_Plain);
|
||||
page->first->commit (specific_options.get (), mp_tech, tl::OutputStream::output_mode_from_filename (m_filename, index_to_om (mp_ui->compression->currentIndex ())) != tl::OutputStream::OM_Plain);
|
||||
}
|
||||
options.set_options (specific_options.release ());
|
||||
}
|
||||
|
|
@ -579,7 +586,7 @@ void
|
|||
SaveLayoutAsOptionsDialog::fmt_cbx_changed (int index)
|
||||
{
|
||||
if (index >= 0 && index < int (m_tab_positions.size ())) {
|
||||
options_stack->setCurrentIndex (m_tab_positions[index]);
|
||||
mp_ui->options_stack->setCurrentIndex (m_tab_positions[index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,16 +26,16 @@
|
|||
#define HDR_laySaveLayoutOptionsDialog
|
||||
|
||||
#include "layuiCommon.h"
|
||||
#include "ui_SaveLayoutOptionsDialog.h"
|
||||
#include "ui_SaveLayoutAsOptionsDialog.h"
|
||||
#include "dbStream.h"
|
||||
#include "dbSaveLayoutOptions.h"
|
||||
#include "layStream.h"
|
||||
#include "tlStream.h"
|
||||
|
||||
#include <string>
|
||||
#include <QDialog>
|
||||
|
||||
class QScrollArea;
|
||||
class QAbstractButton;
|
||||
class QWidget;
|
||||
|
||||
namespace db
|
||||
|
|
@ -44,13 +44,19 @@ namespace db
|
|||
class Technologies;
|
||||
}
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class SaveLayoutAsOptionsDialog;
|
||||
class SaveLayoutOptionsDialog;
|
||||
};
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
class LayoutViewBase;
|
||||
|
||||
class LAYUI_PUBLIC SaveLayoutAsOptionsDialog
|
||||
: public QDialog, private Ui::SaveLayoutAsOptionsDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -65,6 +71,7 @@ public slots:
|
|||
void fmt_cbx_changed (int);
|
||||
|
||||
private:
|
||||
Ui::SaveLayoutAsOptionsDialog *mp_ui;
|
||||
std::vector< std::pair<StreamWriterOptionsPage *, std::string> > m_pages;
|
||||
std::vector<int> m_tab_positions;
|
||||
std::string m_filename;
|
||||
|
|
@ -73,7 +80,7 @@ private:
|
|||
};
|
||||
|
||||
class LAYUI_PUBLIC SaveLayoutOptionsDialog
|
||||
: public QDialog, private Ui::SaveLayoutOptionsDialog
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -91,6 +98,7 @@ public slots:
|
|||
void current_tech_changed (int index);
|
||||
|
||||
private:
|
||||
Ui::SaveLayoutOptionsDialog *mp_ui;
|
||||
std::vector< std::pair<StreamWriterOptionsPage *, std::string> > m_pages;
|
||||
int m_technology_index;
|
||||
std::vector<db::SaveLayoutOptions> m_opt_array;
|
||||
|
|
|
|||
|
|
@ -26,29 +26,34 @@
|
|||
#include "layCellView.h"
|
||||
#include "layLayoutViewBase.h"
|
||||
|
||||
#include "ui_SelectCellViewForm.h"
|
||||
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
SelectCellViewForm::SelectCellViewForm (QWidget *parent, lay::LayoutViewBase *view, const std::string &title, bool single)
|
||||
: QDialog (parent), Ui::SelectCellViewForm ()
|
||||
: QDialog (parent)
|
||||
{
|
||||
mp_ui = new Ui::SelectCellViewForm ();
|
||||
|
||||
setObjectName (QString::fromUtf8 ("select_cv"));
|
||||
|
||||
Ui::SelectCellViewForm::setupUi (this);
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
if (single) {
|
||||
cvs_lb->setSelectionMode (QAbstractItemView::SingleSelection);
|
||||
mp_ui->cvs_lb->setSelectionMode (QAbstractItemView::SingleSelection);
|
||||
}
|
||||
|
||||
// signals and slots connections
|
||||
connect( ok_button, SIGNAL( clicked() ), this, SLOT( accept() ) );
|
||||
connect( cancel_button, SIGNAL( clicked() ), this, SLOT( reject() ) );
|
||||
connect( select_all_pb, SIGNAL( clicked() ), this, SLOT( select_all() ) );
|
||||
connect (mp_ui->ok_button, SIGNAL( clicked() ), this, SLOT( accept() ));
|
||||
connect (mp_ui->cancel_button, SIGNAL( clicked() ), this, SLOT( reject() ));
|
||||
connect (mp_ui->select_all_pb, SIGNAL( clicked() ), this, SLOT( select_all() ));
|
||||
|
||||
if (single) {
|
||||
select_all_pb->hide ();
|
||||
mp_ui->select_all_pb->hide ();
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < view->cellviews (); ++i) {
|
||||
|
|
@ -61,19 +66,19 @@ SelectCellViewForm::SelectCellViewForm (QWidget *parent, lay::LayoutViewBase *vi
|
|||
void
|
||||
SelectCellViewForm::set_selection (int sel)
|
||||
{
|
||||
for (int i = 0; i < int (cvs_lb->count ()); ++i) {
|
||||
cvs_lb->item (i)->setSelected (false);
|
||||
for (int i = 0; i < int (mp_ui->cvs_lb->count ()); ++i) {
|
||||
mp_ui->cvs_lb->item (i)->setSelected (false);
|
||||
}
|
||||
if (sel >= 0 && sel < int (cvs_lb->count ())) {
|
||||
cvs_lb->setCurrentItem (cvs_lb->item (sel));
|
||||
cvs_lb->item (sel)->setSelected (true);
|
||||
if (sel >= 0 && sel < int (mp_ui->cvs_lb->count ())) {
|
||||
mp_ui->cvs_lb->setCurrentItem (mp_ui->cvs_lb->item (sel));
|
||||
mp_ui->cvs_lb->item (sel)->setSelected (true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SelectCellViewForm::set_title (const std::string &title)
|
||||
{
|
||||
title_lbl->setText (tl::to_qstring (title));
|
||||
mp_ui->title_lbl->setText (tl::to_qstring (title));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -85,16 +90,16 @@ SelectCellViewForm::set_caption (const std::string &caption)
|
|||
void
|
||||
SelectCellViewForm::tell_cellview (const lay::CellView &cv)
|
||||
{
|
||||
cvs_lb->addItem (tl::to_qstring (cv->name ()));
|
||||
cvs_lb->setCurrentItem (0);
|
||||
cvs_lb->item (0)->setSelected (true);
|
||||
mp_ui->cvs_lb->addItem (tl::to_qstring (cv->name ()));
|
||||
mp_ui->cvs_lb->setCurrentItem (0);
|
||||
mp_ui->cvs_lb->item (0)->setSelected (true);
|
||||
}
|
||||
|
||||
bool
|
||||
SelectCellViewForm::all_selected () const
|
||||
{
|
||||
for (int i = 0; i < int (cvs_lb->count ()); ++i) {
|
||||
if (! cvs_lb->item (i)->isSelected ()) {
|
||||
for (int i = 0; i < int (mp_ui->cvs_lb->count ()); ++i) {
|
||||
if (! mp_ui->cvs_lb->item (i)->isSelected ()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -106,8 +111,8 @@ SelectCellViewForm::selected_cellviews () const
|
|||
{
|
||||
std::vector <int> res;
|
||||
|
||||
for (int i = 0; i < int (cvs_lb->count ()); ++i) {
|
||||
if (cvs_lb->item (i)->isSelected ()) {
|
||||
for (int i = 0; i < int (mp_ui->cvs_lb->count ()); ++i) {
|
||||
if (mp_ui->cvs_lb->item (i)->isSelected ()) {
|
||||
res.push_back (i);
|
||||
}
|
||||
}
|
||||
|
|
@ -118,8 +123,8 @@ SelectCellViewForm::selected_cellviews () const
|
|||
int
|
||||
SelectCellViewForm::selected_cellview () const
|
||||
{
|
||||
for (int i = 0; i < int (cvs_lb->count ()); ++i) {
|
||||
if (cvs_lb->item (i)->isSelected ()) {
|
||||
for (int i = 0; i < int (mp_ui->cvs_lb->count ()); ++i) {
|
||||
if (mp_ui->cvs_lb->item (i)->isSelected ()) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
@ -129,8 +134,8 @@ SelectCellViewForm::selected_cellview () const
|
|||
void
|
||||
SelectCellViewForm::select_all ()
|
||||
{
|
||||
cvs_lb->clearSelection (); // without this, not all items may be selected in "selectAll"
|
||||
cvs_lb->selectAll ();
|
||||
mp_ui->cvs_lb->clearSelection (); // without this, not all items may be selected in "selectAll"
|
||||
mp_ui->cvs_lb->selectAll ();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,10 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#include "ui_SelectCellViewForm.h"
|
||||
namespace Ui
|
||||
{
|
||||
class SelectCellViewForm;
|
||||
}
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
|
@ -41,7 +44,7 @@ class CellView;
|
|||
class LayoutViewBase;
|
||||
|
||||
class LAYUI_PUBLIC SelectCellViewForm
|
||||
: public QDialog, private Ui::SelectCellViewForm
|
||||
: public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -85,6 +88,9 @@ public:
|
|||
|
||||
public slots:
|
||||
virtual void select_all ();
|
||||
|
||||
private:
|
||||
Ui::SelectCellViewForm *mp_ui;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -920,7 +920,7 @@ TEST(8)
|
|||
try {
|
||||
v = e.parse ("1==1?log('a'):log(2)").execute ();
|
||||
EXPECT_EQ (v.to_string (), std::string ("abc"));
|
||||
} catch (tl::EvalError) {
|
||||
} catch (tl::EvalError &) {
|
||||
t = true;
|
||||
}
|
||||
EXPECT_EQ (t, true);
|
||||
|
|
@ -928,7 +928,7 @@ TEST(8)
|
|||
try {
|
||||
v = e.parse ("1==2||log('a')").execute ();
|
||||
EXPECT_EQ (v.to_string (), std::string ("1"));
|
||||
} catch (tl::EvalError) {
|
||||
} catch (tl::EvalError &) {
|
||||
t = true;
|
||||
}
|
||||
EXPECT_EQ (t, true);
|
||||
|
|
@ -940,7 +940,7 @@ TEST(8)
|
|||
try {
|
||||
v = e.parse ("1==1&&log('a')").execute ();
|
||||
EXPECT_EQ (v.to_string (), std::string ("false"));
|
||||
} catch (tl::EvalError) {
|
||||
} catch (tl::EvalError &) {
|
||||
t = true;
|
||||
}
|
||||
EXPECT_EQ (t, true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue