Exemple #1
0
void SearchTabWidget::selected(QWidget* searchwidget) {
	if (currentIndex() <= 1)
		return;
	Search * uw = dynamic_cast<Search*>(searchwidget);
	if(uw && uw->highlighted() != 0) {
		uw->setHighlighted(0);
		setHighlight(uw->highlighted(), uw );
	}
}
Exemple #2
0
void SearchTabWidget::setHighlight(int highlight, QWidget* widget) {
	Search * uw = dynamic_cast<Search*>(widget);
	if (!uw)
        return;

    int pos = indexOf(uw);
	if(( currentIndex() != pos) && highlight > uw->highlighted() )
	{
		uw->setHighlighted(highlight);

		if (uw->highlighted() > 0) {
			// Icon on tab
			tabBar()->setTabIcon(pos, QIcon(IMG("new-element")));
		}
		if (uw->highlighted() > 1) {
			// Red tab
			tabBar()->setTabTextColor(pos, QColor(255, 0, 0));
		}
	} else if (highlight == 0) {
		tabBar()->setTabTextColor(pos, tabBar()->palette().buttonText().color());
		tabBar()->setTabIcon(pos, QIcon());
	}
}