qt5base-lts/examples/widgets/elidedlabel/testwidget.h
2011-06-01 15:55:15 +02:00

37 lines
631 B
C++

#ifndef TESTWIDGET_H
#define TESTWIDGET_H
#include <QtWidgets/QWidget>
#include <QtCore/QStringList>
#include <QtWidgets/QSlider>
#include <QtWidgets/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