summaryrefslogtreecommitdiffstats
path: root/examples/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets')
-rw-r--r--examples/widgets/graphicsview/chip/view.cpp18
-rw-r--r--examples/widgets/graphicsview/chip/view.h6
-rw-r--r--examples/widgets/tools/plugandpaint/app/app.pro6
-rw-r--r--examples/widgets/tools/treemodelcompleter/mainwindow.cpp5
-rw-r--r--examples/widgets/widgets/windowflags/previewwindow.cpp2
5 files changed, 27 insertions, 10 deletions
diff --git a/examples/widgets/graphicsview/chip/view.cpp b/examples/widgets/graphicsview/chip/view.cpp
index 3b1718bdbd..3229054614 100644
--- a/examples/widgets/graphicsview/chip/view.cpp
+++ b/examples/widgets/graphicsview/chip/view.cpp
@@ -69,9 +69,9 @@ void GraphicsView::wheelEvent(QWheelEvent *e)
{
if (e->modifiers() & Qt::ControlModifier) {
if (e->angleDelta().y() > 0)
- view->zoomIn(6);
+ view->zoomInBy(6);
else
- view->zoomOut(6);
+ view->zoomOutBy(6);
e->accept();
} else {
QGraphicsView::wheelEvent(e);
@@ -274,12 +274,22 @@ void View::print()
#endif
}
-void View::zoomIn(int level)
+void View::zoomIn()
+{
+ zoomSlider->setValue(zoomSlider->value() + 1);
+}
+
+void View::zoomOut()
+{
+ zoomSlider->setValue(zoomSlider->value() - 1);
+}
+
+void View::zoomInBy(int level)
{
zoomSlider->setValue(zoomSlider->value() + level);
}
-void View::zoomOut(int level)
+void View::zoomOutBy(int level)
{
zoomSlider->setValue(zoomSlider->value() - level);
}
diff --git a/examples/widgets/graphicsview/chip/view.h b/examples/widgets/graphicsview/chip/view.h
index ea7bd414f5..cb5be6282b 100644
--- a/examples/widgets/graphicsview/chip/view.h
+++ b/examples/widgets/graphicsview/chip/view.h
@@ -86,8 +86,10 @@ public:
QGraphicsView *view() const;
public slots:
- void zoomIn(int level = 1);
- void zoomOut(int level = 1);
+ void zoomIn();
+ void zoomOut();
+ void zoomInBy(int level);
+ void zoomOutBy(int level);
private slots:
void resetView();
diff --git a/examples/widgets/tools/plugandpaint/app/app.pro b/examples/widgets/tools/plugandpaint/app/app.pro
index 558d359e7d..e5ff02ecf2 100644
--- a/examples/widgets/tools/plugandpaint/app/app.pro
+++ b/examples/widgets/tools/plugandpaint/app/app.pro
@@ -18,7 +18,11 @@ LIBS = -L../plugins
macx-xcode {
LIBS += -lpnp_basictools$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})
} else {
- LIBS += -lpnp_basictools
+ android {
+ LIBS += -lpnp_basictools_$${QT_ARCH}
+ } else {
+ LIBS += -lpnp_basictools
+ }
if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
index 302ccc436c..91cdaee229 100644
--- a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
+++ b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
@@ -206,7 +206,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString &fileName)
QRegularExpression re("^\\s+");
while (!file.atEnd()) {
- const QString line = QString::fromUtf8(file.readLine()).trimmed();
+ const QString line = QString::fromUtf8(file.readLine());
const QString trimmedLine = line.trimmed();
if (trimmedLine.isEmpty())
continue;
@@ -218,7 +218,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString &fileName)
level = 0;
} else {
const int capLen = match.capturedLength();
- level = line.startsWith(QLatin1Char('\t')) ? capLen / 4 : capLen;
+ level = capLen / 4;
}
if (level + 1 >= parents.size())
@@ -267,4 +267,3 @@ void MainWindow::updateContentsLabel(const QString &sep)
{
contentsLabel->setText(tr("Type path from model above with items at each level separated by a '%1'").arg(sep));
}
-
diff --git a/examples/widgets/widgets/windowflags/previewwindow.cpp b/examples/widgets/widgets/windowflags/previewwindow.cpp
index d7ebed7b3c..c05e486c1d 100644
--- a/examples/widgets/widgets/windowflags/previewwindow.cpp
+++ b/examples/widgets/widgets/windowflags/previewwindow.cpp
@@ -124,6 +124,8 @@ void PreviewWindow::setWindowFlags(Qt::WindowFlags flags)
text += "\n| Qt::WindowShadeButtonHint";
if (flags & Qt::WindowStaysOnTopHint)
text += "\n| Qt::WindowStaysOnTopHint";
+ if (flags & Qt::WindowStaysOnBottomHint)
+ text += "\n| Qt::WindowStaysOnBottomHint";
if (flags & Qt::CustomizeWindowHint)
text += "\n| Qt::CustomizeWindowHint";