
Originally Posted by
harmodrew
because the matrix of buttons is indexed with two integers...
int x,y;
// in the slot:
int x, y;
x = tmp.at(0).toInt();
y = tmp.at(1).toInt();
int x,y;
QString id = QString("%1-%2").arg(x).arg(y);
// in the slot:
int x, y;
QStringList tmp = id.split("-");
x = tmp.at(0).toInt();
y = tmp.at(1).toInt();
To copy to clipboard, switch view to plain text mode
or you create a local
QHash<
QString (id
), QPair<
int (x
),
int (y
) > > mapping;
QHash< QString (id), QPair< int (x), int (y) > > mapping;
To copy to clipboard, switch view to plain text mode
I have the problem of choosing the value that has to be assigned to a button depending on the selected tool...
but you can surely access that information from your slot! there must be a pointer in your class, beside how would you do it when creating the connection, if you have there access you also have it in your slot.
Bookmarks