Название: geometry на workspase Отправлено: EhTemka от Мая 03, 2007, 20:31 Привет!
Такая проблемка: Пытаюсь сохранить положение виджета который положен на workspase и ничего не выходит. widget->geometry() возвращает одни и те же координаты независимо от положения на workspase. Кто-нибудь знает как эти координаты вытащить? Название: Re: geometry на workspase Отправлено: pastor от Мая 07, 2007, 20:44 Вот что написали троли по этому поводу:
Цитировать I am able to reproduce this problem when using the Qt4.2.3 release but this problem is already resolved for the Qt4.3 release due to the new workspace that is introduced for this release, the QMdiArea class. Please try the latest Qt4.3 snapshots and if you still get the same problematic behavior then please get back to us. I used the mdi example that is provided with the Qt package ( located under $QTDIR/examples/mainwindows/ directory ) and it seems that the pos() method returns different values everytime the subwindow is moved withing the workspace area. Название: geometry на workspase Отправлено: EhTemka от Мая 11, 2007, 18:10 вообще у меня версия 4.1
Но я разобрался Сначала беру QPoint pos = myWidget->pos (), затем myWidget->mapFrom( workspace, pos ). Этот метод возвращает координаты, но с отрицательными значениями и без учета титульной части и бордера. Дальше дело техники |