Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    
    DlgMain mainWin;
    mainWin.show();
    
    if (argc > 1)
        mainWin.init(argv[1]);
    else
        mainWin.init();

    return app.exec();
}
Ejemplo n.º 2
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    
    app.setWindowIcon(QIcon(":/images/qshapes.png"));
    
    DlgMain mainWin;
    mainWin.show();
    
    // load multiple files from command line / file manager
    for (int i = 1; i < argc; i++)
        mainWin.init (argv[1]);
    
    return app.exec(); 
}
Ejemplo n.º 3
0
	static BOOL CALLBACK dlgProc(HWND i_hwnd, UINT i_message,
								 WPARAM i_wParam, LPARAM i_lParam) {
		DlgMain *wc;
		getUserData(i_hwnd, &wc);
		if (!wc)
			switch (i_message) {
			case WM_INITDIALOG:
				wc = setUserData(i_hwnd, new DlgMain(i_hwnd));
				return wc->wmInitDialog(reinterpret_cast<HWND>(i_wParam), i_lParam);
			}
		else
			switch (i_message) {
			case WM_COMMAND:
				return wc->wmCommand(HIWORD(i_wParam), LOWORD(i_wParam),
									 reinterpret_cast<HWND>(i_lParam));
			case WM_CLOSE:
				return wc->wmClose();
			case WM_NCDESTROY:
				delete wc;
				return TRUE;
			}
		return FALSE;
	}