Problem with QSizeGrip under OSX



  • I wanted to make a QRubberBand instance user resizeable after an initial selection has been made. After tinkering a bit myself with QSizeGrip myself and having no success, I asked a question over on stackoverflow. A kind person answered and then even posted a complete example project: "Implementing resize handles on QRubberband":http://stackoverflow.com/a/19067132/840992

    Part of the suggested solution:
    @Resizable_rubber_band::Resizable_rubber_band(QWidget parent) : QWidget(parent) {
    //tell QSizeGrip to resize this widget instead of top-level window
    setWindowFlags(Qt::SubWindow);
    QHBoxLayout
    layout = new QHBoxLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);
    QSizeGrip* grip1 = new QSizeGrip(this);
    QSizeGrip* grip2 = new QSizeGrip(this);
    layout->addWidget(grip1, 0, Qt::AlignLeft | Qt::AlignTop);
    layout->addWidget(grip2, 0, Qt::AlignRight | Qt::AlignBottom);
    rubberband = new QRubberBand(QRubberBand::Rectangle, this);
    rubberband->move(0, 0);
    rubberband->show();
    }

    void Resizable_rubber_band::resizeEvent(QResizeEvent *) {
    rubberband->resize(size());
    }@

    The issue is that when I run it (Qt 5.1.1 on OSX) I am still not getting the resize handles. I've searched around and haven't found anything about issues or bugs with QSizeGrip on OSX so I thought I would ask here before I waste more time on this approach. Has anyone used QSizeGrip successfully under OSX? Any glaring issues with the example?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.