当前位置: 首页>>代码示例>>C++>>正文


C++ PageItem_Table::bottomBorder方法代码示例

本文整理汇总了C++中PageItem_Table::bottomBorder方法的典型用法代码示例。如果您正苦于以下问题:C++ PageItem_Table::bottomBorder方法的具体用法?C++ PageItem_Table::bottomBorder怎么用?C++ PageItem_Table::bottomBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PageItem_Table的用法示例。


在下文中一共展示了PageItem_Table::bottomBorder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: on_sideSelector_selectionChanged

void PropertiesPalette_Table::on_sideSelector_selectionChanged()
{
	if (!m_item || !m_item->isTable())
		return;

	/*
	 * Figure out the selection state. Either
	 *
	 * 1) Some sides are selected and they all have the same border, or
	 * 2) Some sides are selected but they have different borders, or
	 * 3) No sides are selected.
	 */
	State borderState = Unset;
	m_currentBorder = TableBorder();
	TableSideSelector::Sides selectedSides = sideSelector->selection();
	PageItem_Table* table = m_item->asTable();

	if (selectedSides & TableSideSelector::Left)
	{
		if (borderState == Unset && !table->leftBorder().isNull())
		{
			m_currentBorder = table->leftBorder();
			borderState = Set;
		}
		else if (m_currentBorder != table->leftBorder())
			borderState = TriState;
	}

	if (selectedSides & TableSideSelector::Right)
	{
		if (borderState == Unset && !table->rightBorder().isNull())
		{
			m_currentBorder = table->rightBorder();
			borderState = Set;
		}
		else if (m_currentBorder != table->rightBorder())
			borderState = TriState;
	}

	if (selectedSides & TableSideSelector::Top)
	{
		if (borderState == Unset && !table->topBorder().isNull())
		{
			m_currentBorder = table->topBorder();
			borderState = Set;
		}
		else if (m_currentBorder != table->topBorder())
			borderState = TriState;
	}

	if (selectedSides & TableSideSelector::Bottom)
	{
		if (borderState == Unset && !table->bottomBorder().isNull())
		{
			m_currentBorder = table->bottomBorder();
			borderState = Set;
		}
		else if (m_currentBorder != table->bottomBorder())
			borderState = TriState;
	}

	if (borderState == Set)
	{
		/// Some sides selected and they have same border.
		addBorderLineButton->setEnabled(true);
		removeBorderLineButton->setEnabled(true);
		borderLineList->setEnabled(true);
	}
	else if (borderState == TriState)
	{
		/// Some sides selected but they have different border.
		m_currentBorder = TableBorder();
		addBorderLineButton->setEnabled(true);
		removeBorderLineButton->setEnabled(true);
		borderLineList->setEnabled(true);
	}
	else
	{
		/// No sides selected.
		m_currentBorder = TableBorder();
		addBorderLineButton->setEnabled(false);
		removeBorderLineButton->setEnabled(false);
		borderLineList->setEnabled(false);
	}

	updateBorderLineList();
}
开发者ID:,项目名称:,代码行数:87,代码来源:


注:本文中的PageItem_Table::bottomBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。