C++ (Qt)#include <QtGui>#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)#include <QtWidgets/QtWidgets>#endif int main(int argc, char **argv){ QApplication app(argc, argv); QWidget w; QLabel l("test", &w); l.setTextInteractionFlags(Qt::TextSelectableByMouse); QTextEdit te("another test", &w); QVBoxLayout layout(&w); layout.addWidget(&l); layout.addWidget(&te); w.show(); return app.exec();}