#include#include #include int main(int argc, char *argv[]) { QApplication app(argc, argv); // create a label widget QLabel label("Example text"); // create a QFont object and set underline QFont font; font.setUnderline(true); // set font to the label label.setFont(font); // show the label widget label.show(); return app.exec(); }
#includeThis example will display a button with the text "Submit" without any underline style. Package library: Qt.#include #include int main(int argc, char *argv[]) { QApplication app(argc, argv); // create a button widget QPushButton button("Submit"); // create a QFont object and remove underline QFont font; font.setUnderline(false); // set font to the button button.setFont(font); // show the button widget button.show(); return app.exec(); }