# Path: objbrowser/qtpy/QtCore.py

# 
# Path: objbrowser/qtpy/QtWidgets.py

# 
# Path: objbrowser/version.py
# DEBUGGING = False
# 
# PROGRAM_NAME = 'objbrowser'


import sys, logging, traceback
from objbrowser.qtpy import QtCore, QtWidgets
from objbrowser.version import DEBUGGING, PROGRAM_NAME
        from IPython.core.getipython import get_ipython
        from IPython import version_info
                from IPython.lib.guisupport import is_event_loop_running_qt4, start_event_loop_qt4
    try:
    except ImportError:
        return False
    else:
        return get_ipython() is not None


def qapp_exists():
    """ Returns true if a QApplicaiotn is already running
    """
    return QtWidgets.QApplication.instance() is not None


def get_qapp(*args, **kwargs):
    """ Gets the global Qt application object. Creates one if it doesn't exist.
    """
    qApp = QtWidgets.QApplication.instance()
    if qApp:
        logger.debug("Returning existing QApplication")
        return qApp
    else:
        logger.debug("Creating new QApplication")
        return QtWidgets.QApplication(*args, **kwargs)
        
        
def get_qsettings():
    """ Creates a QSettings object for this application.    
        We do not set the application and organization in the QApplication object to 
        prevent side-effects.
    """

# Path: objbrowser/qtpy/QtCore.py

# 
# Path: objbrowser/qtpy/QtWidgets.py

# 
# Path: objbrowser/version.py
# DEBUGGING = False
# 
# PROGRAM_NAME = 'objbrowser'


# Path: objbrowser/app.py
import sys, logging, traceback
from objbrowser.qtpy import QtCore, QtWidgets
from objbrowser.version import DEBUGGING, PROGRAM_NAME
        from IPython.core.getipython import get_ipython
        from IPython import version_info
                from IPython.lib.guisupport import is_event_loop_running_qt4, start_event_loop_qt4

    try:
    except ImportError:
        return False
    else:
        return get_ipython() is not None


def qapp_exists():
    """ Returns true if a QApplicaiotn is already running
    """
    return QtWidgets.QApplication.instance() is not None


def get_qapp(*args, **kwargs):
    """ Gets the global Qt application object. Creates one if it doesn't exist.
    """
    qApp = QtWidgets.QApplication.instance()
    if qApp:
        logger.debug("Returning existing QApplication")
        return qApp
    else:
        logger.debug("Creating new QApplication")
        return QtWidgets.QApplication(*args, **kwargs)
        
        
def get_qsettings():
    """ Creates a QSettings object for this application.    
        We do not set the application and organization in the QApplication object to 
        prevent side-effects.
    """

    return QtCore.QSettings("titusjan.nl", PROGRAM_NAME)