summaryrefslogtreecommitdiff
path: root/examples/widgets/elidedlabel/testwidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/elidedlabel/testwidget.h')
-rw-r--r--examples/widgets/elidedlabel/testwidget.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/widgets/elidedlabel/testwidget.h b/examples/widgets/elidedlabel/testwidget.h
new file mode 100644
index 0000000000..3d9b42d6fb
--- /dev/null
+++ b/examples/widgets/elidedlabel/testwidget.h
@@ -0,0 +1,36 @@
+#ifndef TESTWIDGET_H
+#define TESTWIDGET_H
+
+#include <QWidget>
+#include <QStringList>
+#include <QSlider>
+#include <QComboBox>
+
+class ElidedLabel;
+
+//! [0]
+class TestWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ TestWidget(QWidget *parent = 0);
+
+protected:
+ void resizeEvent(QResizeEvent *event);
+
+private slots:
+ void switchText();
+ void onWidthChanged(int width);
+ void onHeightChanged(int height);
+
+private:
+ int sampleIndex;
+ QStringList textSamples;
+ ElidedLabel *elidedText;
+ QSlider *heightSlider;
+ QSlider *widthSlider;
+};
+//! [0]
+
+#endif // TESTWIDGET_H