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

dockmanager savesate only save the layout of first dock area #40

Open
BarryArch opened this issue Apr 7, 2024 · 1 comment
Open

dockmanager savesate only save the layout of first dock area #40

BarryArch opened this issue Apr 7, 2024 · 1 comment

Comments

@BarryArch
Copy link

I want to save the dock layout to a file and reload it when reopen.
the code of save dock layout :

    QFile file("VisualLayout.ini");
	if (file.open(QIODevice::WriteOnly))
	{
		QDataStream out(&file);
		out << _dockMan->saveState();
		file.close();
	}

and the code of load the config file:

 QFile file("VisualLayout.ini");
	if (file.open(QIODevice::ReadOnly))
	{
		QByteArray ba;
		QDataStream in(&file);
		in >> ba;
		file.close();
        
		if (_dockMan->restoreState(ba))
		{
			qDebug() << QString("good");
		}
		else
		{
			qDebug() << QString("failed");
		}
	}

but it just reload the 1st dock area layout, and totally ignored other dock area.

@imikejackson
Copy link

Not sure which is the official repo, but https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System is staying up to date. @BarryArch you may find better luck with that other repo.

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

2 participants