itom  3.0.0
widgetInfoBox.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2016, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef WIDGETINFOBOX_H
24 #define WIDGETINFOBOX_H
25 
26 #include <QtGui>
27 #include <qwidget.h>
28 
29 #include "ui_widgetInfoBox.h"
30 
31 namespace ito
32 {
33 
34 class WidgetInfoBox : public QWidget
35 {
36  Q_OBJECT
37 
38 public:
39  WidgetInfoBox(QString infoText, QWidget *parent = NULL) :
40  QWidget(parent)
41  {
42  ui.setupUi(this);
43  ui.lblInfo->setText(infoText);
44  ui.btnClose->setIcon( QIcon(":/plugins/icons/pluginCloseInstance.png") );
45  ui.btnClose->setText("");
46  ui.btnClose->setIconSize( QSize(12, 12) );
47 
48  //setStyleSheet(QString("background-color: %1").arg(QColor(255, 255, 166).name()));
49  //setStyleSheet( "QWidget { background-color: blue; }" );
50  //this->setPalette( QPalette(Qt::red) );
51  setAutoFillBackground(true);
52  QPalette pal = this->palette();
53  pal.setColor(QPalette::Window, QColor(255, 255, 166));
54  this->setPalette(pal);
55  }
56 
57  ~WidgetInfoBox(){}
58 
59  void setInfoText(QString &infoText)
60  {
61  ui.lblInfo->setText(infoText);
62  }
63 
64 private:
65  Ui::WidgetInfoBox ui;
66 
67 };
68 
69 } //end namespace ito
70 
71 #endif
Definition: widgetInfoBox.h:34
Definition: apiFunctionsGraph.cpp:39