#include <listventanas.h>
Inheritance diagram for listventanas:

Public Slots | |
| virtual void | dclicked () |
| virtual void | clicked () |
Signals | |
| void | cambiaEstadoVisible (bool) |
Public Member Functions | |
| void | setWorkspace (QWorkspace2 *w) |
| listventanas (QWidget *a=0) | |
| ~listventanas () | |
| int | meteWindow (QString, QObject *, bool compdup=TRUE) |
| int | seleccionaWindow (QString, QObject *) |
| Sirve para seleccionar una ventana listada en el Indexador. | |
| int | deSeleccionaWindow () |
| Deselecciona todas las entradas del Indexador. | |
| void | sacaWindow (QObject *) |
| void | cambiaVisible (bool) |
| void | vaciar () |
| void | vaciarCompleto () |
| int | numVentanas () |
| QObject * | ventana (int index) |
Protected Member Functions | |
| void | closeEvent (QCloseEvent *event) |
Private Attributes | |
| QListWidget1 * | m_listBox |
| QWorkspace2 * | m_pWorkspace |
| m_listBox | this variable is the listBox that contains all titles of the diferent windows. |
Definition at line 59 of file listventanas.h.
| listventanas::listventanas | ( | QWidget * | a = 0 |
) |
| a |
Definition at line 134 of file listventanas.cpp.
References _depura(), clicked(), dclicked(), and m_listBox.
00134 : QDockWidget(a) { 00135 _depura("listventanas::listventanas", 0); 00136 m_listBox = new QListWidget1(this); 00137 m_listBox->setIconSize(QSize(32, 32)); 00138 m_listBox->setContentsMargins(0, 0, 0, 0); 00139 m_listBox->setSpacing(0); 00140 m_listBox->setWindowTitle(tr("Indexador")); 00141 setWindowTitle(tr("Indexador")); 00142 setFocusPolicy(Qt::StrongFocus); 00143 setWidget(m_listBox); 00144 connect(m_listBox, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(dclicked())); 00145 connect(m_listBox, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(clicked())); 00146 _depura("END listventanas::listventanas", 0); 00147 }
| listventanas::~listventanas | ( | ) |
| void listventanas::setWorkspace | ( | QWorkspace2 * | w | ) |
| w |
Definition at line 123 of file listventanas.cpp.
References _depura(), and m_pWorkspace.
Referenced by Bulmacont::Bulmacont(), and Bulmafact::Bulmafact().
00123 { 00124 _depura("listventanas::setWorkspace", 0); 00125 m_pWorkspace = w; 00126 _depura("END listventanas::setWorkspace", 0); 00127 }
| int listventanas::meteWindow | ( | QString | nombre, | |
| QObject * | obj, | |||
| bool | compdup = TRUE | |||
| ) |
| nombre | ||
| obj | ||
| compdup |
Si la ventana ya esta en la lista.
Comprobamos ventanas duplicadas.
Definition at line 259 of file listventanas.cpp.
References _depura(), m_listBox, QListWidgetItem1::nombre(), QListWidgetItem1::object(), sacaWindow(), QListWidgetItem1::setNombre(), and QListWidgetItem1::setObject().
Referenced by EmpresaBase::meteWindow().
00259 { 00260 _depura("listventanas::meteWindow", 0, nombre); 00261 try { 00262 int i = 0; 00263 while (i < m_listBox->count()) { 00264 QListWidgetItem1 *m = (QListWidgetItem1 *)m_listBox->item(i); 00266 if (m->object() == obj) { 00267 _depura("listventanas::La ventana ya existe", 0, nombre); 00268 m->setNombre(nombre); 00269 return 0; 00270 } // end if 00271 00273 if (m->nombre() == nombre && compdup) { 00274 _depura("listventanas::hay una duplicada y la cerramos", 0); 00275 _depura("listventanas::mostramos la original", 0); 00276 ((QWidget *)m->object())->hide(); 00277 ((QWidget *)m->object())->show(); 00278 sacaWindow(obj); 00279 _depura("listventanas::Establecemos la nueva primaria", 0); 00280 throw -1; 00281 } // end if 00282 i++; 00283 } // end while 00284 if (i >= m_listBox->count()) { 00285 _depura("insercion", 0); 00286 QPixmap icon = ((QWidget *)obj)->windowIcon().pixmap(32, 32); 00287 QListWidgetItem1 *m = new QListWidgetItem1(m_listBox, icon); 00288 m->setObject(obj); 00289 m->setNombre(nombre); 00290 } // end if 00291 } catch (...) { 00292 _depura("listventanas::meteWindow ventana duplicada", 0); 00293 throw -1; 00294 } // end try 00295 _depura("END listventanas::meteWindow", 0); 00296 return 0; 00297 }
| int listventanas::seleccionaWindow | ( | QString | nombre, | |
| QObject * | obj | |||
| ) |
Sirve para seleccionar una ventana listada en el Indexador.
| nombre | ||
| obj |
Encuentra la ventana en la lista.
Definition at line 306 of file listventanas.cpp.
References _depura(), m_listBox, and QListWidgetItem1::object().
Referenced by EmpresaBase::seleccionaWindow().
00306 { 00307 _depura("listventanas::seleccionaWindow", 0); 00308 try { 00309 int i = 0; 00310 while (i < m_listBox->count()) { 00311 QListWidgetItem1 *m = (QListWidgetItem1 *)m_listBox->item(i); 00313 if (m->object() == obj) { 00314 _depura("END listventanas::seleccionaWindow", 0, "Se ha encontrado la ventana" + nombre); 00315 m_listBox->setCurrentItem(m); 00316 return 0; 00317 } // end if 00318 i++; 00319 } // end while 00320 } catch (...) { 00321 throw -1; 00322 } // end try 00323 _depura("END listventanas::seleccionaWindow", 0); 00324 return 0; 00325 }
| int listventanas::deSeleccionaWindow | ( | ) |
Deselecciona todas las entradas del Indexador.
Definition at line 332 of file listventanas.cpp.
References _depura(), and m_listBox.
Referenced by EmpresaBase::deSeleccionaWindow().
00332 { 00333 _depura("listventanas::deSeleccionaWindow", 0); 00334 try { 00335 m_listBox->clearSelection(); 00336 return 0; 00337 } catch (...) { 00338 throw -1; 00339 } // end try 00340 _depura("END listventanas::deSeleccionaWindow", 0); 00341 return 0; 00342 }
| void listventanas::sacaWindow | ( | QObject * | obj | ) |
| obj |
Buscamos la entrada correspondiente dentro del Indexador y la borramos.
Definition at line 349 of file listventanas.cpp.
References _depura(), m_listBox, QListWidgetItem1::nombre(), and QListWidgetItem1::object().
Referenced by meteWindow(), and EmpresaBase::sacaWindow().
00349 { 00350 _depura("listventanas::sacaWindow", 0); 00352 int i = 0; 00353 while (i < m_listBox->count()) { 00354 QListWidgetItem1 *m = (QListWidgetItem1 *)m_listBox->item(i); 00355 if (m->object() == obj) { 00356 _depura("listventanas::sacaWindow ventana encontrada y vamos a sacarla", 0, m->nombre()); 00357 m_listBox->takeItem(i); 00358 delete m; 00359 break; 00360 } // end if 00361 i++; 00362 } // end while 00363 _depura("END listventanas::sacaWindow", 0); 00364 }
| void listventanas::cambiaVisible | ( | bool | visible | ) |
| visible |
Definition at line 371 of file listventanas.cpp.
References _depura(), and TRUE.
Referenced by EmpresaBase::s_indexadorCambiaEstado().
00371 { 00372 _depura("listventanas::cambiaVisible", 0); 00373 if (visible == TRUE) { 00374 this->show(); 00375 } else { 00376 this->hide(); 00377 } // end if 00378 _depura("END listventanas::cambiaVisible", 0); 00379 }
| void listventanas::vaciar | ( | ) |
Definition at line 195 of file listventanas.cpp.
References _depura(), m_listBox, and QListWidgetItem1::object().
Referenced by EmpresaBase::~EmpresaBase().
00195 { 00196 _depura("listventanas::vaciar", 0); 00198 int i = 0; 00199 while (i < m_listBox->count()) { 00200 QListWidgetItem1 *m = (QListWidgetItem1 *)m_listBox->item(i); 00201 if (((QWidget *)m->object())->testAttribute(Qt::WA_DeleteOnClose)) { 00202 delete m->object(); 00203 } else { 00204 i++; 00205 } // end if 00206 } // end while 00207 _depura("END listventanas::vaciar", 0); 00208 }
| void listventanas::vaciarCompleto | ( | ) |
Definition at line 238 of file listventanas.cpp.
References _depura(), m_listBox, and QListWidgetItem1::object().
Referenced by Company::~Company(), and Empresa::~Empresa().
00238 { 00239 _depura("listventanas::vaciarCompleto", 0); 00241 int i = 0; 00242 while (i < m_listBox->count()) { 00243 QListWidgetItem1 *m = (QListWidgetItem1 *)m_listBox->item(i); 00244 delete m->object(); 00245 } // end while 00246 _depura("END listventanas::vaciarCompleto", 0); 00247 }
| int listventanas::numVentanas | ( | ) |
Definition at line 215 of file listventanas.cpp.
References _depura(), and m_listBox.
Referenced by Company::cargaConf(), Empresa::cargaConf(), Company::guardaConf(), and Empresa::guardaConf().
00215 { 00216 _depura("listventanas::numVentanas", 0); 00217 _depura("END listventanas::numVentanas", 0); 00218 return m_listBox->count(); 00219 }
| QObject * listventanas::ventana | ( | int | index | ) |
| index |
Definition at line 227 of file listventanas.cpp.
References _depura(), m_listBox, and QListWidgetItem1::object().
Referenced by Company::cargaConf(), Empresa::cargaConf(), Company::guardaConf(), and Empresa::guardaConf().
00227 { 00228 _depura("listventanas::ventana", 0); 00229 QListWidgetItem1 *m = (QListWidgetItem1 *)m_listBox->item(index); 00230 _depura("END listventanas::ventana", 0); 00231 return m->object(); 00232 }
| void listventanas::closeEvent | ( | QCloseEvent * | event | ) | [protected] |
Definition at line 385 of file listventanas.cpp.
References _depura(), cambiaEstadoVisible(), and FALSE.
00385 { 00386 _depura("listventanas::closeEvent", 0); 00387 emit(cambiaEstadoVisible(FALSE)); 00388 _depura("END listventanas::closeEvent", 0); 00389 }
| void listventanas::dclicked | ( | ) | [virtual, slot] |
Definition at line 153 of file listventanas.cpp.
References _depura(), m_listBox, and TRUE.
Referenced by listventanas().
00153 { 00154 _depura("listventanas::dclicked", 0); 00155 QWidget *widget = (QWidget *)((QListWidgetItem1 *) m_listBox->currentItem())->object(); 00156 if (widget != NULL) { 00157 if (widget->isMaximized() == TRUE) { 00158 widget->showNormal(); 00159 } else { 00160 widget->showMaximized(); 00161 } // end if 00162 } // end if 00163 _depura("END listventanas::dclicked", 0); 00164 }
| void listventanas::clicked | ( | ) | [virtual, slot] |
Definition at line 170 of file listventanas.cpp.
References _depura(), m_listBox, and m_pWorkspace.
Referenced by listventanas().
00170 { 00171 _depura("listventanas::clicked", 0); 00172 QWidget *widget = (QWidget *)((QListWidgetItem1 *) m_listBox->currentItem())->object(); 00173 if (widget != NULL) { 00174 widget->show(); 00175 widget->parentWidget()->raise(); 00176 m_pWorkspace->setActiveWindow(widget); 00177 } // end if 00178 _depura("END listventanas::clicked", 0); 00179 }
| void listventanas::cambiaEstadoVisible | ( | bool | ) | [signal] |
Definition at line 121 of file moc_listventanas.cpp.
Referenced by closeEvent().
00122 { 00123 void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; 00124 QMetaObject::activate(this, &staticMetaObject, 0, _a); 00125 }
QListWidget1* listventanas::m_listBox [private] |
Definition at line 63 of file listventanas.h.
Referenced by clicked(), dclicked(), deSeleccionaWindow(), listventanas(), meteWindow(), numVentanas(), sacaWindow(), seleccionaWindow(), vaciar(), vaciarCompleto(), ventana(), and ~listventanas().
QWorkspace2* listventanas::m_pWorkspace [private] |
1.5.1