Hi everyone,
I have QMenu - LegendPositionSubMenu where I can choose the position of the legend on my plot, there are 4 QActions inside QActiongroup: right, left,top,bottom.
I want to save the position in Qsettings, for this I wrote writeSettings():
void CLegendMenu::writeSettings()
{
settings.beginGroup("legendSettings");
//add the value of CurrentPosition
settings.setValue("position", CurrentPosition);
settings.endGroup();
}
void CLegendMenu::writeSettings()
{
QSettings settings;
settings.beginGroup("legendSettings");
//add the value of CurrentPosition
settings.setValue("position", CurrentPosition);
settings.endGroup();
}
To copy to clipboard, switch view to plain text mode
Current position is of the enum type Position.
and I read it:
void CLegendMenu::readSettings()
{
//read the currentPosition
settings.beginGroup("legendSettings");
if (settings.value("position")== 0)
{
}
else if (settings.value("position")== 1)
{
}
settings.endGroup();
}
etc....
void CLegendMenu::readSettings()
{
//read the currentPosition
QSettings settings;
settings.beginGroup("legendSettings");
if (settings.value("position")== 0)
{
}
else if (settings.value("position")== 1)
{
}
settings.endGroup();
}
etc....
To copy to clipboard, switch view to plain text mode
I am stucked here, because I want check action inside the menu according to the CurrentPosition value, so it can emit signal trigged(action) and for this I have already working connection.
Thank you
I don't know how to perform it
Bookmarks