Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- // Shows text:
- sudo Xorg &
- clang++-3.8 -g --std=c++11 -fPIC -Wall
- -I /usr/include/x86_64-linux-gnu/qt5/
- test1.cpp
- -l Qt5Core
- -l Qt5Gui
- -l Qt5Widgets
- -o test1 &&
- sudo DISPLAY=:0 HOME=/tmp ./test1
- sudo killall Xorg
- // Does not show text:
- clang++-3.8 -g --std=c++11 -fPIC -Wall
- -I /usr/include/x86_64-linux-gnu/qt5/
- test1.cpp
- -l Qt5Core
- -l Qt5Gui
- -l Qt5Widgets
- -o test1 &&
- sudo HOME=/tmp ./test1 --platform eglfs
- */
- #include <QtWidgets/QApplication>
- #include <QtWidgets/QOpenGLWidget>
- #include <QtWidgets/QLabel>
- #include <QtWidgets/QTextEdit>
- #include <QtWidgets/QPushButton>
- int main(int argc, char *argv[]) {
- QApplication* app = new QApplication(argc, argv);
- QOpenGLWidget root_widget;
- root_widget.setAutoFillBackground(true);
- root_widget.show();
- QTextEdit text_box1(&root_widget);
- text_box1.setPlainText("INITIAL TEXT");
- text_box1.setGeometry(0, 0, 500, 50);
- text_box1.show();
- QPushButton button1(&root_widget);
- button1.setGeometry(0, 60, 500, 50);
- button1.setText("Test1");
- button1.show();
- return app->exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement