tab icons v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 29 Sep 2018 12:58:04 +0200
branchv_0
changeset 15 547a7c5681a5
parent 14 0a6a88e4e48f
child 16 b6f790137bb8
tab icons
src/RelpipeChartMainWindow.cpp
--- a/src/RelpipeChartMainWindow.cpp	Sat Sep 29 12:48:16 2018 +0200
+++ b/src/RelpipeChartMainWindow.cpp	Sat Sep 29 12:58:04 2018 +0200
@@ -12,7 +12,8 @@
 RelpipeChartMainWindow::RelpipeChartMainWindow() {
 	widget.setupUi(this);
 
-	tabs->addTab(new QPushButton("here will be options", tabs), "Options");
+	int optionsIndex = tabs->addTab(new QPushButton("here will be options", tabs), "Options");
+	tabs->setTabIcon(optionsIndex, QIcon::fromTheme("configure"));
 
 	statusBar()->addWidget(new QLabel("Loading relations...", widget.statusbar));
 
@@ -43,8 +44,9 @@
 	QSplitter* splitter = new QSplitter(Qt::Orientation::Vertical, tabs);
 	splitter->addWidget(new QPushButton("here will be the chart", splitter));
 	splitter->addWidget(new QPushButton("here will be the table", splitter));
-	tabs->addTab(splitter, QString::fromWCharArray(name.c_str()));
-	if (tabs->count() == 2) tabs->setCurrentIndex(1); // switch to the first relation (first tab is Options tab)
+	int index = tabs->addTab(splitter, QString::fromWCharArray(name.c_str()));
+	if (tabs->count() == 2) tabs->setCurrentIndex(index); // switch to the first relation (first tab is Options tab)
+	tabs->setTabIcon(index, QIcon::fromTheme("application-vnd.oasis.opendocument.spreadsheet"));
 }
 
 void RelpipeChartMainWindow::attribute(const string_t& value) {