The answer would be high speed night trains. London - Rome takes a bit over 15h by train today. However that includes waiting for connections and a lot of stops on stations. So a direct train would be siginificantly faster probably more like 12-13h. That would mean you could go into a train station in London at 20:00 and end up in Rome at 8:00 for example.
Stockholm - Barcelona is a much longer journey. 2250km instead of 1400km for Rome - London. So a very long nigh train or a connection in Hamburg or Paris. with a night train going from there to Barcelona or Stockholm respectivly.