Greetings to everyone.
I have noticed a bug in FET 5.16.0, under Windows 7 O.S. I haven't tested it under other O.S.'s.
When working with dual screen, i.e. one extra screen is connected to the main computer, and when choosing the "A teacher's not available time" in the "Teachers" tab under the "Time" tab I had moved the pop up window in the second display.
I chose the teacher that I wanted to work with, and the new window that I specify the free time of the teacher was kept in the main display.
I finished my work, without re-moving all windows to the main display.
After a while, and when I had only one display, I tried to chose again the "A teacher's not available time" but the pop up window did not appeared.
I connected the second display, chose again the "A teacher's not available time" and the window appeared in the second display.
edit:
I forgot to add that the window in which the free time for a teacher is specified, which I had it in the main display, could be opened from choosing "ALL" (under the "Time" tab) and selecting the desired teacher.
Thus, I imagine that there might be a bug in the handling of multiple screens. Maybe some preferences of the FET do not refresh when changing from dual screen to single screen display.
edit:
I changed the title of the thread because I confirmed the bug under MAC OS.
Moreover, under MAC OS the bug applies also to the main window and the reset of the settings can be done from the "task bar". Cannot remember if the same happens under Windows 7.
Moreover, the "Reset settings" solution applies to both O.S.'s and recovers the FET's windows to the primary display.
Quote from: kdrosos on January 15, 2012, 11:54:55 AM
Thus, I imagine that there might be a bug in the handling of multiple screens. Maybe some preferences of the FET do not refresh when changing from dual screen to single screen display.
Thank you for the bug report.
Indeed, this is a possible bug for multiple displays. I did not care at all for this, as I never used two screens.
Let me show you the C++ for Qt code I use:
These are the save/restore functions:
void saveFETDialogGeometry(QWidget* widget, const QString& alternativeName)
{
QSettings settings(COMPANY, PROGRAM);
QString name=QString(widget->metaObject()->className());
if(!alternativeName.isEmpty())
name=alternativeName;
QRect rect=widget->geometry();
settings.setValue(name+QString("/geometry"), rect);
}
void restoreFETDialogGeometry(QWidget* widget, const QString& alternativeName)
{
QSettings settings(COMPANY, PROGRAM);
QString name=QString(widget->metaObject()->className());
if(!alternativeName.isEmpty())
name=alternativeName;
if(settings.contains(name+QString("/geometry"))){
QRect rect=settings.value(name+QString("/geometry")).toRect();
if(rect.isValid())
widget->setGeometry(rect);
}
}
And this is how I use them:
BuildingsForm::BuildingsForm(QWidget* parent): QDialog(parent)
{
setupUi(this);
...
restoreFETDialogGeometry(this);
//restore splitter state
QSettings settings(COMPANY, PROGRAM);
if(settings.contains(this->metaObject()->className()+QString("/splitter-state")))
splitter->restoreState(settings.value(this->metaObject()->className()+QString("/splitter-state")).toByteArray());
...
}
BuildingsForm::~BuildingsForm()
{
saveFETDialogGeometry(this);
//save splitter state
QSettings settings(COMPANY, PROGRAM);
settings.setValue(this->metaObject()->className()+QString("/splitter-state"), splitter->saveState());
}
I don't know how it would be best, I am waiting for suggestions.
My personal opinion is that current state is good, because you can disable a screen, then re-enable it, and settings will be stored (for windows in the second screen). And if you want to use only the main screen, you can always restore FET default settings (see the Settings menu.)Maybe someone could test if this bug is solved in the new Qt 4.8.0 (the official FET-5.16.0 for Windows has Qt 4.7.4 dll's).
Edit: Maybe a solution would be in restoring geometry, to test if the geometry would be on an invalid screen, and correct this (add a better test than "if(rect.isValid())" in function "restoreFETDialogGeometry(...)").
I added this in the TODO.
The Qt functions seem not to provide an easy fix. Maybe other programmers can help with ideas.
Changed the thread' s title and edited the first post.
At the moment, I cannot contribute to the solution of the problem due to really heavy life schedule.
P.S. In the first post added the text
I changed the title of the thread because I confirmed the bug under MAC OS.
Moreover, under MAC OS the bug applies also to the main window and the reset of the settings can be done from the "task bar". Cannot remember if the same happens under Windows 7.
Moreover, the "Reset settings" solution applies to both O.S.'s and recovers the FET's windows to the primary display.
Please see http://qt.nokia.com/products/changes/changes-4.8.2 , especially bug fix: "- Hang on to the correct screen index in QWidget"
Please confirm if the problem is solved in Qt 4.8.2 (if you can compile with this Qt).