Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frameless child-widgets only drawn inside parent/main widget #34

Open
ChrillesNet opened this issue Jun 18, 2019 · 0 comments
Open

Frameless child-widgets only drawn inside parent/main widget #34

ChrillesNet opened this issue Jun 18, 2019 · 0 comments

Comments

@ChrillesNet
Copy link

I want to be able to have a parent for my child-widget as the default (qt)-behavior.
It works as expected if I don't use the frameless widget but when I use the FramelessWindow, the child-window is only visible in front of the parent.

Here'a an example of what I mean:

// Undefine this to switch to windows frame mode
#define FRAMELESS_CHILD

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);

	// style our application with custom dark style
	a.setStyle(new DarkStyle);

	// create frameless window (and set windowState or title)
	FramelessWindow framelessWindow;
	framelessWindow.setWindowTitle("Main Window");
	framelessWindow.setWindowIcon(a.style()->standardIcon(QStyle::SP_DesktopIcon));

	// create our mainwindow instance
	MainWindow *mainWindow = new MainWindow;

	// add the mainwindow to our custom frameless window
	framelessWindow.setContent(mainWindow);
	framelessWindow.show();

#ifdef FRAMELESS_CHILD
	FramelessWindow childFramelessWindow(&framelessWindow);	// Small difference if mainWindow or framelessWindow is parent.
	childFramelessWindow.setWindowTitle("Child Window");
	framelessWindow.setContent(new QDialog);
	childFramelessWindow.show();
#else
       // Works as expected but with windows/OS frame
	QDialog* child = new QDialog(&framelessWindow);
	child->resize(200, 200);
	child->show();
#endif // FRAMELESS

	return a.exec();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant