Esempio n. 1
0
// Called before first plot after a set term command.
void qt_init()
{
	if (qt_initialized)
		return;

	// If we are not connecting to an existing QtGnuplotWidget, start a QtGnuplotApplication
	if (qt_optionWidget.isEmpty())
		execGnuplotQt();

	// Create a QApplication without event loop for QObject's that need it, namely font handling
	// A better strategy would be to transfer the font handling to the QtGnuplotWidget, but it would require
	// some synchronization between the widget and the gnuplot process.
	int argc = 0;
	QApplication* application = new QApplication(argc, (char**)( NULL));

#ifdef Q_WS_MAC
	// Don't display this application in the MAC OS X dock
	removeDockIcon();
#endif

	// The creation of a QApplication mangled our locale settings
#ifdef HAVE_LOCALE_H
	setlocale(LC_NUMERIC, "C");
	setlocale(LC_TIME, current_locale);
#endif

	qt_out.setVersion(QDataStream::Qt_4_4);
	qt_initialized = true;
	term_interlock = (void *)qt_init;
	GP_ATEXIT(qt_atexit);
}
Esempio n. 2
0
// Called before first plot after a set term command.
void qt_init()
{
    if (qt)
		return;
    ensureOptionsCreated();

    qt = new QtGnuplotState();

	// If we are not connecting to an existing QtGnuplotWidget, start a QtGnuplotApplication
	if (qt_option->Widget.isEmpty())
		execGnuplotQt();


#ifdef Q_WS_MAC
	// Don't display this application in the MAC OS X dock
	removeDockIcon();
#endif

	// The creation of a QApplication mangled our locale settings
#ifdef HAVE_LOCALE_H
	setlocale(LC_NUMERIC, "C");
	setlocale(LC_TIME, current_locale);
#endif

	qt->out.setVersion(QDataStream::Qt_4_4);
	term_interlock = (void *)qt_init;
	gp_atexit(qt_atexit);
}