ImageDisplayManagerWidget.cpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #include "ImageDisplayManagerWidget.h"
  2. #include <qvariant.h>
  3. #include <qpushbutton.h>
  4. #include <qlayout.h>
  5. #include <qtooltip.h>
  6. #include <q3whatsthis.h>
  7. //Added by qt3to4:
  8. #include <Q3VBoxLayout>
  9. /*
  10. * Constructs a ImageDisplayManagerWidget as a child of 'parent', with the
  11. * name 'name' and widget flags set to 'f'.
  12. */
  13. ImageDisplayManagerWidget::ImageDisplayManagerWidget( QWidget* parent, const char* name, Qt::WFlags fl )
  14. : QWidget( parent, name, fl )
  15. {
  16. if ( !name )
  17. setName( "ImageDisplayManagerWidget" );
  18. ImageDisplayManagerWidgetLayout = new Q3VBoxLayout( this, 11, 6, "ImageDisplayManagerWidgetLayout");
  19. buttonShowAll = new QPushButton( this, "buttonShowAll" );
  20. ImageDisplayManagerWidgetLayout->addWidget( buttonShowAll );
  21. buttonHideAll = new QPushButton( this, "buttonHideAll" );
  22. ImageDisplayManagerWidgetLayout->addWidget( buttonHideAll );
  23. buttonDeleteAll = new QPushButton( this, "buttonDeleteAll" );
  24. ImageDisplayManagerWidgetLayout->addWidget( buttonDeleteAll );
  25. languageChange();
  26. resize( QSize(205, 133).expandedTo(minimumSizeHint()) );
  27. // clearWState( WState_Polished );
  28. // signals and slots connections
  29. connect( buttonShowAll, SIGNAL( clicked() ), this, SLOT( buttonShowAll_clicked() ) );
  30. connect( buttonHideAll, SIGNAL( clicked() ), this, SLOT( buttonHideAll_clicked() ) );
  31. connect( buttonDeleteAll, SIGNAL( clicked() ), this, SLOT( buttonDeleteAll_clicked() ) );
  32. }
  33. /*
  34. * Destroys the object and frees any allocated resources
  35. */
  36. ImageDisplayManagerWidget::~ImageDisplayManagerWidget()
  37. {
  38. // no need to delete child widgets, Qt does it all for us
  39. }
  40. /*
  41. * Sets the strings of the subwidgets using the current
  42. * language.
  43. */
  44. void ImageDisplayManagerWidget::languageChange()
  45. {
  46. setCaption( tr( "Image displays" ) );
  47. buttonShowAll->setText( tr( "Show all images" ) );
  48. buttonHideAll->setText( tr( "Hide all images" ) );
  49. buttonDeleteAll->setText( tr( "Release (!) all images" ) );
  50. }
  51. #include <core/imagedisplay/ImageDisplayManager.h>
  52. void ImageDisplayManagerWidget::buttonShowAll_clicked()
  53. {
  54. NICE::ImageDisplayManager::instance().showAll();
  55. }
  56. void ImageDisplayManagerWidget::buttonHideAll_clicked()
  57. {
  58. NICE::ImageDisplayManager::instance().hideAll();
  59. }
  60. void ImageDisplayManagerWidget::buttonDeleteAll_clicked()
  61. {
  62. NICE::ImageDisplayManager::instance().deleteAll();
  63. }