Difference between revisions of "Adding a New Resolution to the Player"
From GiderosMobile
(Created page with "In the mainwindow.ui, player folder: https://github.com/gideros/gideros/blob/master/player/mainwindow.ui Add a new addaction and action: <addaction name="action750x1334"/>...") |
|||
| Line 1: | Line 1: | ||
| − | In the mainwindow.ui, player folder: | + | In the mainwindow.ui, player folder: https://github.com/gideros/gideros/blob/master/player/mainwindow.ui |
| − | https://github.com/gideros/gideros/blob/master/player/mainwindow.ui | ||
Add a new addaction and action: | Add a new addaction and action: | ||
| Line 15: | Line 14: | ||
</action> | </action> | ||
| − | In the mainwindow.cpp: | + | In the mainwindow.cpp: https://github.com/gideros/gideros/blob/master/player/mainwindow.cpp |
| − | https://github.com/gideros/gideros/blob/master/player/mainwindow.cpp | ||
Constructor, these snippets: | Constructor, these snippets: | ||
| Line 25: | Line 23: | ||
ui.action750x1334->setChecked(true); | ui.action750x1334->setChecked(true); | ||
break; | break; | ||
| − | |||
| − | |||
In closeEvent: | In closeEvent: | ||
else if (resolutionGroup_->checkedAction() == ui.action750x1334) | else if (resolutionGroup_->checkedAction() == ui.action750x1334) | ||
settings.setValue("resolution", 750); | settings.setValue("resolution", 750); | ||
| − | |||
| − | |||
In hardwareWidth: | In hardwareWidth: | ||
else if (resolutionGroup_->checkedAction() == ui.action750x1334) | else if (resolutionGroup_->checkedAction() == ui.action750x1334) | ||
return 750; | return 750; | ||
| − | |||
| − | |||
And in the hardwareHeight: | And in the hardwareHeight: | ||
| Line 44: | Line 36: | ||
return 1334; | return 1334; | ||
| − | Thanks to marcelojunior (http://giderosmobile.com/forum/discussion/comment/38649#Comment_38649) for tutorial | + | |
| + | Thanks to marcelojunior (http://giderosmobile.com/forum/discussion/comment/38649#Comment_38649) for the tutorial. | ||
Latest revision as of 20:01, 24 January 2026
In the mainwindow.ui, player folder: https://github.com/gideros/gideros/blob/master/player/mainwindow.ui
Add a new addaction and action:
<addaction name="action750x1334"/>
<action name="action750x1334"> <property name="checkable"> <bool>true</bool> </property> <property name="text"> <string>750x1334 (iPhone 6)</string> </property> </action>
In the mainwindow.cpp: https://github.com/gideros/gideros/blob/master/player/mainwindow.cpp
Constructor, these snippets:
connect(ui.action750x1334, SIGNAL(triggered()), this, SLOT(actionResolution())); resolutionGroup_->addAction(ui.action750x1334); case 750: ui.action750x1334->setChecked(true); break;
In closeEvent:
else if (resolutionGroup_->checkedAction() == ui.action750x1334)
settings.setValue("resolution", 750);
In hardwareWidth:
else if (resolutionGroup_->checkedAction() == ui.action750x1334) return 750;
And in the hardwareHeight:
else if (resolutionGroup_->checkedAction() == ui.action750x1334) return 1334;
Thanks to marcelojunior (http://giderosmobile.com/forum/discussion/comment/38649#Comment_38649) for the tutorial.