Selven
8th April 2012, 13:26
Hi,
I have a problem with screen index on my Fedora 16.
i'm trying to detect what is the resolution of the current screen, so i do :
QDesktopWidget monEcran;
cout << "nbre: " << monEcran.screenCount()<<endl;
int screenIndex = monEcran.screenNumber(this);
LargeurFen=monEcran.screenGeometry(screenIndex ).width();
hauteurFen=monEcran.screenGeometry(screenIndex ).height();
nbre is the number of screens, and it shows 2 screens. So my second screen is okay.
But the screenindex value is always 0, when i start my program on the first screen, it returns 0, and on the second screen, it returns 0 too...
I don't understand... But if i put manually screenIndex to 1, LargeurFen and hauterFen have the good values, it's the resolution of the second ecran...
I also tryied to do it with a new project, with the basic windows and it's the same issue.
Thanks advance for your help,
ps : sorry for my bad english xD
I have a problem with screen index on my Fedora 16.
i'm trying to detect what is the resolution of the current screen, so i do :
QDesktopWidget monEcran;
cout << "nbre: " << monEcran.screenCount()<<endl;
int screenIndex = monEcran.screenNumber(this);
LargeurFen=monEcran.screenGeometry(screenIndex ).width();
hauteurFen=monEcran.screenGeometry(screenIndex ).height();
nbre is the number of screens, and it shows 2 screens. So my second screen is okay.
But the screenindex value is always 0, when i start my program on the first screen, it returns 0, and on the second screen, it returns 0 too...
I don't understand... But if i put manually screenIndex to 1, LargeurFen and hauterFen have the good values, it's the resolution of the second ecran...
I also tryied to do it with a new project, with the basic windows and it's the same issue.
Thanks advance for your help,
ps : sorry for my bad english xD