18 #include "ui_vp1customtourframewidget.h"
20 #include <QMouseEvent>
21 #include <QDragEnterEvent>
27 #include <QtWidgetsVersion>
35 Ui::VP1CustomTourFrameWidgetForm
ui;
44 : theclass(tc), camPerspective(true)
47 ui.label_snapshot->setText(
"");
49 int maxheight =
static_cast<int>(0.5+QFontMetricsF(
ui.pushButton_remove->font()).height()*1.05+2);
50 ui.pushButton_remove->setMaximumHeight(maxheight);
51 ui.pushButton_show->setMaximumHeight(maxheight);
52 ui.checkBox_frameEnabled->setMaximumHeight(maxheight);
63 ui.label_camtypeicon->setText(
"");
69 ui.label_camtypeicon->setPixmap(QPixmap( camPerspective
70 ?
":/icons/icons/perspective.png"
71 :
":/icons/icons/ortho.png") );
73 theclass->frameEnabledToggled();
95 s.restore(
m_d->
ui.doubleSpinBox_zoomToFrameTime);
96 s.restore(
m_d->
ui.doubleSpinBox_stayOnFrameTime);
98 s.restore(
m_d->
ui.doubleSpinBox_clipVolumePercentOfATLAS);
100 s.restore(
m_d->
ui.comboBox_approachMethod);
101 s.restore(
m_d->
ui.checkBox_frameEnabled);
102 QPixmap pm =
s.restore<QPixmap>();
104 m_d->
ui.label_snapshot->setPixmap(pm);
105 s.warnUnrestored(
this);
115 s.save(
m_d->
ui.doubleSpinBox_zoomToFrameTime);
116 s.save(
m_d->
ui.doubleSpinBox_stayOnFrameTime);
117 s.save(
m_d->
ui.doubleSpinBox_clipVolumePercentOfATLAS);
118 s.save(
m_d->
ui.comboBox_approachMethod);
119 s.save(
m_d->
ui.checkBox_frameEnabled);
120 #if QTWIDGETS_VERSION >= 0x050F00
121 s.save(
m_d->
ui.label_snapshot->pixmap(Qt::ReturnByValue));
123 s.save(
m_d->
ui.label_snapshot->pixmap() ? *(
m_d->
ui.label_snapshot->pixmap()) : QPixmap());
138 if (sender()==
m_d->
ui.pushButton_moveEarlier)
140 else if (sender()==
m_d->
ui.pushButton_moveLater)
142 else if (sender()==
m_d->
ui.pushButton_remove)
144 else if (sender()==
m_d->
ui.pushButton_show)
152 return m_d->
ui.checkBox_frameEnabled->isChecked();
158 return m_d->
ui.comboBox_approachMethod->currentIndex()==0;
163 return m_d->
ui.comboBox_approachMethod->currentIndex()==2;
169 return m_d->
ui.doubleSpinBox_zoomToFrameTime->value();
175 return m_d->
ui.doubleSpinBox_stayOnFrameTime->value();
181 return m_d->
ui.doubleSpinBox_clipVolumePercentOfATLAS->value();
199 m_d->
ui.pushButton_moveEarlier->setVisible(
b);
205 m_d->
ui.pushButton_moveLater->setVisible(
b);
211 if (
event->button() == Qt::LeftButton)
213 QFrame::mousePressEvent(
event);
219 if (!(
event->buttons() & Qt::LeftButton))
222 < QApplication::startDragDistance())
224 QDrag *drag =
new QDrag(
this);
225 QMimeData *mimeData =
new QMimeData;
226 mimeData->setData(
"vp1/customtourframe", QByteArray() );
227 drag->setMimeData(mimeData);
228 #if QTWIDGETS_VERSION >= 0x050F00
229 QPixmap pm =
m_d->
ui.label_snapshot->pixmap(Qt::ReturnByValue);
231 QPixmap pm =
m_d->
ui.label_snapshot->pixmap() ? *(
m_d->
ui.label_snapshot->pixmap()) : QPixmap();
234 drag->setPixmap(pm );
235 drag->exec(Qt::CopyAction | Qt::MoveAction);
241 if (
event->source()&&
event->source()!=
this &&
event->mimeData()->hasFormat(
"vp1/customtourframe"))
242 event->acceptProposedAction();
248 QByteArray
data =
event->mimeData()->data(
"vp1/customtourframe");
249 event->acceptProposedAction();
259 m_d->
ui.label_snapshot->setPixmap(pm);