QuoteLineItems and OpportunityLineItems are not directly related. Look at this ERD for Product and Schedule Objects from the SOAP API Developer Guide. You can grab the idea of how these object connected from there.
I assume you want to copy custom fields over to QuoteLineItems, because otherwise you could utilize the Standard Quote Syncing feature.
Now that the picture is clear, you can copy any OpportunityLineItems data to QuoteLineItems. Basically one opportunity can have many OpportunityLineItems. And it can have many Quotes which, in turn, can have many QuoteLineItems each. So to be able to link them, i.e. establish a kind of 1-to-1 connection between OpportunityLineItem and QuoteLineItem, you need work with the compaund key "ProductId + Quantity" fields which is present in the both entities. Such a key would allow uniquely identify line items and relate with each other.
So a pseudo code for this solution would look like:
Opportunity opp = getOpportunity();
List<Quote> quotes = opp.Quotes;
Quote qt = quotes[0]; // this is just an example, you can choose any quote depending on your requirements.
Map<String,QuoteLineItem> qliByProductAndQuantity = new Map<String,QuoteLineItem>();
for (QuoteLineItem qli : qt.QuoteLineItems)
{
qliByProductAndQuantity.put(qli.ProductId+''+qli.Quantity, qli);
}
// Finally copy over the data
List<OpportunityLineItem> qlis = new List<OpportunityLineItem>();
for (OpportunityLineItem oli : opp.OpportunityLineItems)
{
QuoteLineItem qli = qliByProductAndQuantity.get(opp.ProductId+''+opp.Quantity);
qli.Custom_Field__c = opp.Custom_Field__c;
qlis.add(qli);
}
update qlis;