void CTWenUGCtrlEx::AppendRow_ButtonAdd(void)
{
	int nRow = CUGCtrl::GetNumberRows();

	if(nRow > 0)
	{
		CUGCell cell;
		GetCell(0, nRow-1, &cell);

		if(cell.GetBitmap()==GetBitmap(m_nIndexBMP_Add))//如果有增加行
		{
			return;
		}
	}

	if(AppendRow() != UG_SUCCESS) return;

	int nCol = GetNumberCols();

	JoinCells(1, nRow, nCol-1, nRow);

	if(nCol>1)
	{
		QuickSetBackColor(1, nRow, RGB(240,240,240));
		QuickSetBorder(1, nRow, UG_BDR_RAISED|UG_BDR_LTHIN|UG_BDR_RTHIN|UG_BDR_TTHIN|UG_BDR_BTHIN); 
	}

	QuickSetBitmap(0, nRow, m_nIndexBMP_Add);
}
	AddressesModelManager::AddressesModelManager (BaseSettingsManager *bsm, int defaultPort, QObject *parent)
	: QObject { parent }
	, Model_ { new QStandardItemModel { this } }
	, BSM_ { bsm }
	{
		Model_->setHorizontalHeaderLabels ({ tr ("Host"), tr ("Port") });
		Model_->horizontalHeaderItem (0)->setData (DataSources::DataFieldType::Enum,
				DataSources::DataSourceRole::FieldType);
		Model_->horizontalHeaderItem (1)->setData (DataSources::DataFieldType::Integer,
				DataSources::DataSourceRole::FieldType);

		const auto confManager = new QNetworkConfigurationManager { this };
		connect (confManager,
				SIGNAL (configurationAdded (QNetworkConfiguration)),
				this,
				SLOT (updateAvailInterfaces ()));
		connect (confManager,
				SIGNAL (configurationRemoved (QNetworkConfiguration)),
				this,
				SLOT (updateAvailInterfaces ()));
		connect (confManager,
				SIGNAL (configurationChanged (QNetworkConfiguration)),
				this,
				SLOT (updateAvailInterfaces ()));

		updateAvailInterfaces ();

		const auto& addrs = BSM_->Property ("ListenAddresses",
				QVariant::fromValue (GetLocalAddresses (defaultPort))).value<AddrList_t> ();
		qDebug () << Q_FUNC_INFO << addrs;
		for (const auto& addr : addrs)
			AppendRow (addr);
	}
	void EventsSettingsManager::addRequested (const QString&, const QVariantList& datas)
	{
		AppendRow (datas.value (0).toString (), datas.value (1).value<QColor> ());

		saveSettings ();
		RebuildEnabledEvents ();
		RebuildAddableEvents ();
	}
	void AddressesModelManager::addRequested (const QString&, const QVariantList& data)
	{
		const auto port = data.value (1).toInt ();
		if (port < 1024 || port > 65535)
			return;

		AppendRow ({ data.value (0).toString (), QString::number (port) });
		SaveSettings ();
	}
void
GMFilterMBoxTable::SetFilter
	(
	GMFilter* filter
	)
{
	itsFilter	= filter;
	if (filter == NULL)
		{
		RemoveAllRows();
		}
	else if (GetRowCount() == 0)
		{
		AppendRow(GetApertureHeight());
		}
	AdjustButtons();
	TableRefresh();
}
示例#6
0
Row & Row :: AppendCSV( const string & csv ) {
	Row r( csv );
	AppendRow( r );
	return *this;
}