Palestinians lined up outside polls in tents and donated buildings to vote in the first elections held in part of Gaza in more than two decades.