
Untitled
#include <QtCore/QCoreApplication>
#include <QtGui/QApplication>
#include <QMainWindow>
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow w;
w.show();
QWidget widget(&w);
QPushButton button("About Qt", &widget);
QObject::connect(&button, SIGNAL(clicked()), qApp, SLOT(aboutQt()));
QString text;
text.append("Test case to reproduce QTBUG-18720\n");
text.append("1) Tap About Qt button\n");
text.append("2) Attempt to select the text that shows");
text.append("\n\nExpected result: Text gets highlighted correctly\n");
text.append("Actual result: text that is highlighted turns invisible");
QLabel label(text, &widget);
QVBoxLayout layout(&widget);
layout.addWidget(&label);
layout.addWidget(&button);
w.setCentralWidget(&widget);
w.show();
return a.exec();
}