PDA

View Full Version : QDockWidget location problem.



winkle99
31st August 2010, 22:27
Hi,

I'm stumped and really hope that someone can help. I have a QMainWindow with three dock widgets and no central widget. What I would like to do is add the ability for the user to restore the docks to a "default" position. I tried (testing) to grab the state from the config file and restoring it in the code (see below) and that didn't work. I also tried removing and re-adding the docks that didn't work. Has anyone tried this. Any suggestions? Thanks


QByteArray tmp( "\0\0\0\xff\0\0\0\x1\xfd\0\0\0\x2\0\0\0\x2\0\0\bA\0 \0\x2k\xfc\x1\0\0\0\x1\xfb\0\0\0\x14\0v\0i\0\x65\0 w\0\x65\0r\0\x44\0o\0\x63\0k\x3\0\0\x1\xbe\0\0\x3\ xa3\0\0\bA\0\0\x2k\0\0\0\x3\0\0\bA\0\0\x4\xe0\xfc\ x1\0\0\0\x2\xfb\0\0\0\x1e\0p\0r\0o\0j\0\x65\0\x63\ 0t\0\x44\0\x61\0t\0\x61\0\x44\0o\0\x63\0k\x1\0\0\0 \0\0\0\a=\0\0\0U\0\xff\xff\xff\xfb\0\0\0\x18\0t\0o \0o\0l\0\x44\0\x61\0t\0\x61\0\x44\0o\0\x63\0k\x1\0 \0\aG\0\0\0\xfa\0\0\0\xfa\0\0\0\xfa\0\0\bA\0\0\0\0 \0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\ 0\0\x2\0\0\0\x4\0\0\0\x1a\0m\0y\0M\0\x61\0i\0n\0T\ 0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff \0\0\0\0\0\0\0\0\0\0\0\x1c\0m\0y\0S\0\x65\0t\0u\0p \0T\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\x2\x18\xff\xff\ xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1e\0m\0y\0P\0l\0\x6 1\0y\0\x65\0r\0T\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\x5 \xa5\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0&\0m\0y\0P\0l\0\x61\0y\0W\0i\0\x64\0g\0\x65\0t\0T\0 o\0o\0l\0\x62\0\x61\0r\x1\0\0\a'\xff\xff\xff\xff\0 \0\0\0\0\0\0\0" );
if ( !tmp.isEmpty() && !tmp.isNull() )
{
restoreState( tmp, 1 );
}