bbtk::Qt Struct Reference

#include <bbtkQt.h>

List of all members.

Classes

class  BusyCursor

Public Types

typedef boost::signal< void()> Signal_type
typedef
Signal_type::slot_function_type 
Slot_function_type

Static Public Member Functions

static void LoopUntilAllWindowsClose ()
static void SetTopWindowParent (QWidget *)
static void SetAutoDestroyTopWindow (bool)
static QWidget * GetTopWindow ()
static bool TopWindowExists ()
static void IncNbWindowsAlive ()
static void DecNbWindowsAlive ()
static int GetNbWindowsAlive ()
static bool IsSomeWindowAlive ()
static void IncNbWindowsShown ()
static void DecNbWindowsShown ()
static int GetNbWindowsShown ()
static bool IsSomeWindowShown ()
static void AddSignalObserver (Slot_function_type)
static void CreateQtAppIfNeeded ()
static void DestroyQtAppIfNeeded ()

Static Private Member Functions

static void CreateTopWindowIfNeeded ()
static void DestroyTopWindowIfNeeded ()
static void SetTopWindow (QWidget *)
 Sets the creation time parent of all bbtk windows.


Detailed Description

Definition at line 77 of file bbtkQt.h.


Member Typedef Documentation

typedef boost::signal<void ()> bbtk::Qt::Signal_type

Definition at line 83 of file bbtkQt.h.

typedef Signal_type::slot_function_type bbtk::Qt::Slot_function_type

Definition at line 84 of file bbtkQt.h.


Member Function Documentation

void bbtk::Qt::AddSignalObserver ( Slot_function_type  f  )  [static]

Definition at line 224 of file bbtkQt.cxx.

References bbtk::mgQtSignal.

00225   {
00226     mgQtSignal.connect(f);
00227   }

void bbtk::Qt::CreateQtAppIfNeeded (  )  [static]

Definition at line 88 of file bbtkQt.cxx.

References bbtk::argc, bbtk::argv, bbtkDebugMessage, bbtkGlobalError, and bbtk::mgQtApp.

Referenced by bbtk::QtBlackBox::bbCreateDialogWindow().

00089   {
00090     
00091 
00092   if (QApplication::instance()==0)
00093       {
00094 
00095         if (mgQtApp != 0) 
00096           {
00097             bbtkGlobalError("Qt::CreateQtAppIfNeeded() : INTERNAL ERROR ! (QCoreApplication::instance()==0) && (mgQtApp != 0)");
00098           }
00099         bbtkDebugMessage("widget",1,"  --> Creating bbtk QApplication"<<std::endl);
00100         char* aargv = const_cast<char*>(argv);
00101         mgQtApp = new QApplication(argc,&aargv);
00102 
00103 
00104         bbtkDebugMessage("widget",9,"  --> QApplication::instance = "<<QApplication::instance()<<std::endl);
00105 
00106         /*
00107         std::cout << ">>>> mgQtApp.exec()"<<std::endl;
00108         
00109         mgQtApp->exec();
00110 
00111         std::cout << "<<<< mgQtApp.exec()"<<std::endl;
00112         */
00113       }
00114     
00115   }

Here is the caller graph for this function:

void bbtk::Qt::CreateTopWindowIfNeeded (  )  [static, private]

Definition at line 148 of file bbtkQt.cxx.

00149   {
00150     /*
00151     if (mgTopWindow!=0) return;
00152     bbtkDebugMessage("wx",1,"  --> Creating bbtk top window"<<std::endl);
00153 
00154     CreateQtAppIfNeeded();
00155 
00156     wxWindow* top = 
00157       new wxFrame(mgTopWindowParent,
00158                   -1,
00159                   _T("TOP BBTK FRAME (YOU SHOULD NOT SEE ME !!)"));
00160     top->Hide();
00161 
00162     Qt::SetTopWindow(top);
00163     */
00164   }

void bbtk::Qt::DecNbWindowsAlive (  )  [static]

Definition at line 265 of file bbtkQt.cxx.

References bbtkDebugMessage, DestroyTopWindowIfNeeded(), bbtk::mgNbWindowsAlive, and bbtk::mgQtSignal.

Referenced by bbtk::QtBlackBoxDialog::~QtBlackBoxDialog().

00266   { 
00267     mgNbWindowsAlive--; 
00268     bbtkDebugMessage("wx",2,"* Number of windows alive = "<<mgNbWindowsAlive
00269                      <<std::endl);
00270 
00271     DestroyTopWindowIfNeeded();
00272      // BBTKWXSIG
00273     mgQtSignal();
00274     // \BBTKWXSIG
00275   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Qt::DecNbWindowsShown (  )  [static]

Definition at line 291 of file bbtkQt.cxx.

References bbtkDebugMessage, DestroyTopWindowIfNeeded(), bbtk::mgNbWindowsShown, and bbtk::mgQtSignal.

00292   { 
00293     mgNbWindowsShown--; 
00294     bbtkDebugMessage("wx",2,"* Number of windows shown = "<<mgNbWindowsShown
00295                      <<std::endl);
00296 
00297     DestroyTopWindowIfNeeded();
00298 
00299     // BBTKWXSIG
00300     mgQtSignal();
00301     // \BBTKWXSIG
00302   }

Here is the call graph for this function:

void bbtk::Qt::DestroyQtAppIfNeeded (  )  [static]

Definition at line 119 of file bbtkQt.cxx.

00120   {
00121     /*
00122     if (mgQtApp!= 0) 
00123       {
00124         bbtkDebugMessage("wx",1,"  --> Destructing bbtk QApplication"<<std::endl);
00125         //delete mgQtApp;
00126         //      mgQtApp = 0;
00127         // Uninit wx
00128         //      wxUninitialize();
00129       }
00130     */
00131   }

void bbtk::Qt::DestroyTopWindowIfNeeded (  )  [static, private]

Definition at line 168 of file bbtkQt.cxx.

Referenced by DecNbWindowsAlive(), and DecNbWindowsShown().

00169   {
00170     /*
00171     if ( (mgNbWindowsAlive==0) && 
00172          (mgAutoDestroyTopWindow) )
00173       {
00174         bbtkDebugMessage("wx",1,"  --> Destructing bbtk top window"<<std::endl);
00175         mgTopWindow->Close();
00176         mgTopWindow = 0;
00177         
00178         DestroyQtAppIfNeeded();
00179       }
00180     */
00181   } 

Here is the caller graph for this function:

int bbtk::Qt::GetNbWindowsAlive (  )  [static]

Definition at line 307 of file bbtkQt.cxx.

References bbtk::mgNbWindowsAlive.

00308   { 
00309     return mgNbWindowsAlive; 
00310   }

int bbtk::Qt::GetNbWindowsShown (  )  [static]

Definition at line 322 of file bbtkQt.cxx.

References bbtk::mgNbWindowsShown.

00323   { 
00324     return mgNbWindowsShown; 
00325   }

QWidget * bbtk::Qt::GetTopWindow (  )  [static]

Returns the creation time parent of all bbtk windows (window can be reparented after creation)

Definition at line 204 of file bbtkQt.cxx.

00205   { 
00206     /*
00207     Qt::CreateTopWindowIfNeeded();
00208     return mgTopWindow; 
00209     */
00210     return 0;
00211   }

void bbtk::Qt::IncNbWindowsAlive (  )  [static]

Definition at line 253 of file bbtkQt.cxx.

References bbtkDebugMessage, bbtk::mgNbWindowsAlive, and bbtk::mgQtSignal.

Referenced by bbtk::QtBlackBoxDialog::QtBlackBoxDialog().

00254   { 
00255     mgNbWindowsAlive++; 
00256     bbtkDebugMessage("wx",2,"* Number of windows alive = "<<mgNbWindowsAlive
00257                      <<std::endl);
00258     // BBTKWXSIG
00259     mgQtSignal();
00260     // \BBTKWXSIG
00261   }

Here is the caller graph for this function:

void bbtk::Qt::IncNbWindowsShown (  )  [static]

Definition at line 279 of file bbtkQt.cxx.

References bbtkDebugMessage, bbtk::mgNbWindowsShown, and bbtk::mgQtSignal.

00280   { 
00281     mgNbWindowsShown++; 
00282     bbtkDebugMessage("wx",2,"* Number of windows shown = "<<mgNbWindowsShown
00283                      <<std::endl);
00284     // BBTKWXSIG
00285     mgQtSignal();
00286     // \BBTKWXSIG
00287   }

bool bbtk::Qt::IsSomeWindowAlive (  )  [static]

Definition at line 314 of file bbtkQt.cxx.

References bbtk::mgNbWindowsAlive.

00315   { 
00316     return (mgNbWindowsAlive>0);
00317   }

bool bbtk::Qt::IsSomeWindowShown (  )  [static]

Definition at line 329 of file bbtkQt.cxx.

References bbtk::mgNbWindowsShown.

00330   { 
00331     return (mgNbWindowsShown>0);
00332   }

void bbtk::Qt::LoopUntilAllWindowsClose (  )  [static]

Definition at line 185 of file bbtkQt.cxx.

00186   {
00187     /*
00188     int i = 0;
00189     while (mgTopWindow != 0)
00190       {
00191         if (i % 100 == 0) 
00192           {
00193             bbtkDebugMessage("wx",2,"Qt::Loop "<<i << std::endl);
00194           }
00195         i++;
00196         wxMilliSleep(10);
00197 
00198       }
00199     */
00200   }

void bbtk::Qt::SetAutoDestroyTopWindow ( bool  b  )  [static]

Definition at line 232 of file bbtkQt.cxx.

00233   {
00234     // mgAutoDestroyTopWindow = b;
00235   }

void bbtk::Qt::SetTopWindow ( QWidget *  w  )  [static, private]

Sets the creation time parent of all bbtk windows.

Definition at line 239 of file bbtkQt.cxx.

00240   {
00241     /*
00242     if ( mgTopWindow ) 
00243       {
00244         bbtkGlobalError("wx::SetTopWindow : top window already set !");
00245       } 
00246     mgTopWindow = w;
00247     */
00248   }

void bbtk::Qt::SetTopWindowParent ( QWidget *  w  )  [static]

Definition at line 135 of file bbtkQt.cxx.

00136   {
00137     /*
00138     if (mgTopWindowParent != 0)
00139       {
00140         bbtkGlobalError("Qt::SetTopWindowParent : top window parent != 0");
00141       }
00142     mgTopWindowParent = w;
00143     */
00144   }

bool bbtk::Qt::TopWindowExists (  )  [static]

Definition at line 215 of file bbtkQt.cxx.

00216   {
00217     //return (mgTopWindow!=0);
00218     return true;
00219   }


The documentation for this struct was generated from the following files:

Generated on Thu May 31 14:15:00 2012 for BBTK by  doxygen 1.5.7.1