示例#1
0
	void SeparateTabBar::tabInserted (int index)
	{
		QTabBar::tabInserted (index);

		int length = 0;
		for (int i = 0; i < count (); ++i)
			length += tabRect (i).width ();

		if (length + 30 > width () && IsLastTab_)
		{
			IsLastTab_ = false;
			removeTab (count () - 1);
			emit showAddTabButton (true);
		}
		
		if (index != count () - 1 && (IsLastTab_))
			emit tabWasInserted (index);
	}
示例#2
0
	void SeparateTabBar::tabInserted (int index)
	{
		QTabBar::tabInserted (index);
		emit tabWasInserted (index);
	}