The :: operator is the scope resolution operator. It qualifies the scope of an expression. In your case, it qualifies the expression class impl with the scope widget, meaning the class impl that belongs to widget. Consider the following example which defines two impl classes at different scopes :
// global impl
class impl;
class widget
{
    // widget's impl
    class impl;
};
class widget::impl
{
    // Define widget's impl
};
class impl
{
    // Define global impl
};
The scope resolution operator allows you to clearly declare which class you are defining.