summaryrefslogtreecommitdiffstats
path: root/src/designer/src/lib/shared/zoomwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/designer/src/lib/shared/zoomwidget.cpp')
-rw-r--r--src/designer/src/lib/shared/zoomwidget.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/designer/src/lib/shared/zoomwidget.cpp b/src/designer/src/lib/shared/zoomwidget.cpp
index fef509a39..9670958ce 100644
--- a/src/designer/src/lib/shared/zoomwidget.cpp
+++ b/src/designer/src/lib/shared/zoomwidget.cpp
@@ -43,9 +43,6 @@
QT_BEGIN_NAMESPACE
-using ActionList = QList<QAction *>;
-using GraphicsItemList = QList<QGraphicsItem *>;
-
enum { debugZoomWidget = 0 };
static const int menuZoomList[] = { 100, 25, 50, 75, 125, 150 , 175, 200 };
@@ -77,11 +74,10 @@ int ZoomMenu::zoomOf(const QAction *a)
void ZoomMenu::addActions(QMenu *m)
{
- const ActionList za = m_menuActions->actions();
- const ActionList::const_iterator cend = za.constEnd();
- for (ActionList::const_iterator it = za.constBegin(); it != cend; ++it) {
- m->addAction(*it);
- if (zoomOf(*it) == 100)
+ const auto za = m_menuActions->actions();
+ for (QAction *a : za) {
+ m->addAction(a);
+ if (zoomOf(a) == 100)
m->addSeparator();
}
}
@@ -93,13 +89,13 @@ int ZoomMenu::zoom() const
void ZoomMenu::setZoom(int percent)
{
- const ActionList za = m_menuActions->actions();
- const ActionList::const_iterator cend = za.constEnd();
- for (ActionList::const_iterator it = za.constBegin(); it != cend; ++it)
- if (zoomOf(*it) == percent) {
- (*it)->setChecked(true);
+ const auto za = m_menuActions->actions();
+ for (QAction *a : za) {
+ if (zoomOf(a) == percent) {
+ a->setChecked(true);
return;
}
+ }
}
void ZoomMenu::slotZoomMenu(QAction *a)
@@ -290,7 +286,7 @@ ZoomWidget::ZoomWidget(QWidget *parent) :
void ZoomWidget::setWidget(QWidget *w, Qt::WindowFlags wFlags)
{
if (debugZoomWidget)
- qDebug() << "ZoomWidget::setWidget" << w << bin << wFlags;
+ qDebug() << "ZoomWidget::setWidget" << w << Qt::bin << wFlags;
if (m_proxy) {
scene().removeItem(m_proxy);
@@ -520,7 +516,7 @@ void ZoomWidget::dump() const
{
qDebug() << "ZoomWidget::dump " << geometry() << " Viewport " << viewport()->geometry()
- << "Scroll: " << scrollPosition() << "Matrix: " << matrix() << " SceneRect: " << sceneRect();
+ << "Scroll: " << scrollPosition() << "Transform: " << transform() << " SceneRect: " << sceneRect();
if (m_proxy) {
qDebug() << "Proxy Pos: " << m_proxy->pos() << "Proxy " << m_proxy->size()
<< "\nProxy size hint"