Why qt draws sub widget on super bottom not on native nsview
Unsolved
General and Desktop
-
int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget* mw = new QWidget(); mw->setFixedSize(800, 600); NSView* leftView = reinterpret_cast<NSView*>(mw->winId()); QWidget* canvas = new QWidget(mw); canvas->setGeometry(0, 0, 800, 600); canvas->setStyleSheet("background-color:red"); QWidget* tool = new QWidget(mw); tool->setGeometry(0, 400, 800, 600); tool->setStyleSheet("background-color:green"); QWidget* btn = new QWidget(tool); btn->winId(); btn->setGeometry(0, 0, 100, 100); btn->setStyleSheet("background-color:white;"); mw->show(); return a.exec(); }
why all these red green and white color are drawn on the super bottom nsview? (Inspect it with xcode view hierarchy tool)
If I set tool as native nsview and add layer, it's subview btn is drawn behinde the layer, why?NSView* tv = reinterpret_cast<NSView*>(tool->winId()); [tv setWantsLayer:TRUE];