ImageDisplayManagerWidget.cpp 2.2 KB

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