Overlaying the Qt form window on the Qml window
-
Hi,
I have overlaid the Qt form window on the Qml window. When I trigger the application, both the windows were displayed on the screen simultaneously, in such a way that, form window overlaid on the Qml window.
But when I implement the signal slot connection between the form window and Qml window, both the windows were not displaying on the screen simultaneously, Qml window is displayed and form window is minimized and the icon is displaying on the taskbar. When I click on the icon, form window is getting overlaid on the Qml window.
When there is no signal slot connection, both the windows were displayed simultaneously.(Signal in Qml window and slot in form window) And also when I trigger any components in Qml window, the overlaid form window is getting minimized.
Everytime when I trigger the application, both windows has to open simultaneously and none of the window has to be minimized, when I trigger any components.
Provide some inputs to sort out this issue. Thanks in advance.
-
Hi,
I have overlaid the Qt form window on the Qml window. When I trigger the application, both the windows were displayed on the screen simultaneously, in such a way that, form window overlaid on the Qml window.
But when I implement the signal slot connection between the form window and Qml window, both the windows were not displaying on the screen simultaneously, Qml window is displayed and form window is minimized and the icon is displaying on the taskbar. When I click on the icon, form window is getting overlaid on the Qml window.
When there is no signal slot connection, both the windows were displayed simultaneously.(Signal in Qml window and slot in form window) And also when I trigger any components in Qml window, the overlaid form window is getting minimized.
Everytime when I trigger the application, both windows has to open simultaneously and none of the window has to be minimized, when I trigger any components.
Provide some inputs to sort out this issue. Thanks in advance.
@Aravinth-Ravi
Sample program would be helpful to quickly help. -
@Aravinth-Ravi
Sample program would be helpful to quickly help.Hi @dheerendra ,
This is my sample code, for your reference,
int main(int argc, char *argv[])
{
#if defined(Q_OS_WIN)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endifQGuiApplication app(argc, argv); QApplication a(argc, argv); QScreen *screen = QGuiApplication::primaryScreen(); MainWindow w; int ScreenGeometry_width = screen->geometry().width(); int ScreenGeometry_height = screen->geometry().height(); w.move(100,100); w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint); w.resize(ScreenGeometry_width-120,ScreenGeometry_height-120); w.show(); QQmlApplicationEngine engine1; QQmlComponent component(&engine1, QUrl(QLatin1String("qrc:/main.qml"))); QObject *mainPage = component.create(); QObject* item1 = mainPage->findChild<QObject *>("button2"); QObject::connect(item1, SIGNAL(clickedButton1(QString)), &w, SLOT(onButtonClicked1(QString))); return app.exec();
}
-
Hi @dheerendra ,
This is my sample code, for your reference,
int main(int argc, char *argv[])
{
#if defined(Q_OS_WIN)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endifQGuiApplication app(argc, argv); QApplication a(argc, argv); QScreen *screen = QGuiApplication::primaryScreen(); MainWindow w; int ScreenGeometry_width = screen->geometry().width(); int ScreenGeometry_height = screen->geometry().height(); w.move(100,100); w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint); w.resize(ScreenGeometry_width-120,ScreenGeometry_height-120); w.show(); QQmlApplicationEngine engine1; QQmlComponent component(&engine1, QUrl(QLatin1String("qrc:/main.qml"))); QObject *mainPage = component.create(); QObject* item1 = mainPage->findChild<QObject *>("button2"); QObject::connect(item1, SIGNAL(clickedButton1(QString)), &w, SLOT(onButtonClicked1(QString))); return app.exec();
}
@Aravinth-Ravi
It helps if you give compilable sample code. -
@Aravinth-Ravi
It helps if you give compilable sample code.Is it possible to load a raw file in qml ? I did'nt find any examples to load a raw file in Qml window.
-
Is it possible to load a raw file in qml ? I did'nt find any examples to load a raw file in Qml window.
@Aravinth-Ravi
Raw file means ? Please clarify. -
@Aravinth-Ravi
Raw file means ? Please clarify.I have to load image file of .raw format in Qml window.
-
This post is deleted!
-
@Aravinth-Ravi
It helps if you give compilable sample code.I have attached the code in the below mentioned link,
[https://panaceamedicaltechnologies.sharepoint.com/:u:/g/EQhVtXjM-nVBlvVJh7pb6nsB7btUOnsTr9f6Tm-rqTFMSQ?e=KoUV2W](link url)