How could I hide the main window's standard buttons...?
Unsolved
QML and Qt Quick
-
Hi and welcome to devnet,
You can take a look at the Window flags example. It shows how you can modify various aspects of your widgets including these buttons.
-
-
Call:
setWindowFlags(Qt::WindowTitleHint);
in your main window.
-
Hi SGaist :
I changed my main.cpp to this:#include <QApplication> #include <QQmlApplicationEngine> #include <QMainWindow> int main(int argc, char *argv[]) { QApplication app(argc, argv); QQmlApplicationEngine engine; QMainWindow qm; qm.setWindowFlags(Qt::WindowTitleHint); qm.resize(250, 220); qm.show(); //engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); }
This is works fine, but now , how could I open my "main.qml" file as main window ...?
(engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); opens the file in another window )
Thanks.
-
Hi, use the following:
// in main int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); } // in main.qml [...] Window { visible: true flags: Qt.WindowTitleHint [...]
-
Sorry, my bad, I've managed to miss it was for QtQuick. @Devopia53's solution is what you are looking for.