18 #include "ui_vp12dexaminerviewerform.h"
29 Ui::VP12DExaminerViewerForm *
ui;
57 ui =
new Ui::VP12DExaminerViewerForm;
62 while (
ui->stackedWidget_views->count())
63 ui->stackedWidget_views->removeWidget(
ui->stackedWidget_views->currentWidget());
71 ui->pushButton_zoomplus->hide();
72 ui->pushButton_zoomminus->hide();
79 connectButtonsToView(theclass->view());
81 std::cout<<
"VP12DExaminerViewer::Imp::init2 WARNING: Current View is NULL"<<std::endl;
83 theclass->setPickMode();
101 m_d->
ui->widget_viewchangebuttons->hide();
108 QWidget *
parent, Qt::WindowFlags
f)
112 std::cout<<
"VP12DExaminerViewer ERROR: Using multimode constructor with empty list of requested views!"<<std::endl;
121 QVBoxLayout *layout =
new QVBoxLayout;
122 layout->setSpacing(0);
123 layout->setContentsMargins(0, 0, 0, 0);
124 QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
125 sizePolicy.setHorizontalStretch(0);
126 sizePolicy.setVerticalStretch(0);
127 m_d->
ui->widget_viewchangebuttons->setLayout(layout);
132 for (
int i = 0;
i<views.count();++
i) {
140 m_d->
ui->stackedWidget_views->insertWidget(
m_d->
ui->stackedWidget_views->count(),
view);
142 QPushButton* button =
new QPushButton(
m_d->
ui->widget_viewchangebuttons);
143 button->setToolTip(views.at(
i).first);
144 button->setSizePolicy(sizePolicy);
145 button->setMinimumSize(QSize(30, 30));
146 button->setMaximumSize(QSize(30, 30));
147 button->setFocusPolicy(Qt::NoFocus);
148 button->setIcon(QIcon(views.at(
i).second));
149 button->setIconSize(QSize(30, 30));
150 button->setCheckable(
false);
151 layout->addWidget(button);
157 QSpacerItem * spacerItem =
new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
158 layout->addItem(spacerItem);
161 m_d->
ui->stackedWidget_views->setCurrentWidget(firstview);
163 std::cout<<
"VP12DExaminerViewer WARNING: View is NULL"<<std::endl;
173 connect(
ui->pushButton_sethome,SIGNAL(clicked()),
view,SLOT(setHome()));
174 connect(
ui->pushButton_home,SIGNAL(clicked()),
view,SLOT(viewHome()));
175 connect(
ui->pushButton_viewall,SIGNAL(clicked()),
view,SLOT(fitViewToContents()));
182 disconnect(ui->pushButton_sethome,SIGNAL(clicked()),
view,SLOT(setHome()));
183 disconnect(ui->pushButton_home,SIGNAL(clicked()),
view,SLOT(viewHome()));
184 disconnect(ui->pushButton_viewall,SIGNAL(clicked()),
view,SLOT(fitViewToContents()));
185 disconnect(ui->pushButton_print,SIGNAL(clicked()),
view,SLOT(
print()));
213 if (singleviewmode) {
214 theclass->view()->setMode(
m);
217 for(
it = multiviews_viewid2view.begin();
it!=
itE; ++
it) {
218 it.value()->setMode(
m);
226 m_d->
ui->pushButton_pick->setChecked(
true);
227 m_d->
ui->pushButton_changeview->setChecked(
false);
234 m_d->
ui->pushButton_pick->setChecked(
false);
235 m_d->
ui->pushButton_changeview->setChecked(
true);
249 return QStringList();
264 return QList<QPair<QString,QString> >();
287 if (
it.value()==currentview)
305 if (!oldview||!newview)
307 if (oldview==newview)
313 m_d->
ui->stackedWidget_views->setCurrentWidget(newview);
322 QPushButton * button =
static_cast<QPushButton*
>(sender());