size of q buffer should actually be (this->rows())*pcols.