PDA

View Full Version : QT3/QT4 Interaction Issue



JediSpam
31st January 2012, 23:19
I currently have a QT 3.3.6 application (yeah i know old) that needs to have the capability of opening up a QT 4.7 application. The issue is the QT 4.7 application is minimize to the QSystemTrayIcon when I'm tryign to do so. Currently the QT3 application can open up the QT4 application but there is no GUI and it's just a gray box. Any ideas?

wysota
31st January 2012, 23:48
Can you show us some relevant code?

JediSpam
1st February 2012, 21:05
This is essentially my main code (example from system tray)


#include <QtGui>

#include "window.h"

int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(systray);

QApplication app(argc, argv);

if (!QSystemTrayIcon::isSystemTrayAvailable()) {
QMessageBox::critical(0, QObject::tr("Systray"),
QObject::tr("I couldn't detect any system tray "
"on this system."));
return 1;
}
QApplication::setQuitOnLastWindowClosed(false);

Window window;
window.show();
return app.exec();
}


My QT 3.3 code simply should open the QT 4.7 application with the double click of a button. I don't know what to do there but currently I am calling a windows' show window function.



HWND hwnd;
ShowWindow(hwnd, SW_SHOW);


The problem is QT is currently hiding the GUI and windows is showing it when it's not there.

wysota
2nd February 2012, 00:02
I don't see any code related to opening a Qt4 application in what you posted.

JediSpam
2nd February 2012, 15:32
that's the problem. How can I open a QT4 application within a QT3 application? I don't think it's possible to send a signal. I need a way to open it as well as let Qt4 know that it needs to show its GUI.

wysota
2nd February 2012, 16:52
If the application is not started then you don't have anyone to send signals to. Use QProcess to start a new process. If what you expect is to show contents of a window of a Qt4 application inside a Qt3 application then it is not so easy and you have to use platform dependent solutions (like XEmbed on X11 or COM/ActiveX on Windows).