hi again,
long time ago i last answered. and again this way of sender and cast. how does it work? i tried to open a qdialog with a button click but it didn't work lik i did:
Ui::d_job uij;
uij.setupUi(&dia_job);
Ui::d_package uip;
uip.setupUi(&dia_package);
uij.tb_set_package = qobject_cast<QToolButton*>(dia_package.show());
if(uij.tb_set_package){
qDebug("clicked");
dia_package.show();
}
QDialog dia_job;
QDialog dia_package;
Ui::d_job uij;
uij.setupUi(&dia_job);
Ui::d_package uip;
uip.setupUi(&dia_package);
uij.tb_set_package = qobject_cast<QToolButton*>(dia_package.show());
if(uij.tb_set_package){
qDebug("clicked");
dia_package.show();
}
To copy to clipboard, switch view to plain text mode
qcreator says incalid use of void expression, i can guess why, but what should it look like that it works?
or found another thing
{
if ((event
->buttons
() & Qt
::LeftButton) && lastPos
!= QPoint(-1,
-1)) { if (brushInterface) {
setupPainter(painter);
const QRect rect
= brushInterface
->mouseMove
(brush, painter, lastPos,
event->pos());
update(rect);
}
lastPos = event->pos();
}
}
void PaintArea::mouseMoveEvent(QMouseEvent *event)
{
if ((event->buttons() & Qt::LeftButton) && lastPos != QPoint(-1, -1)) {
if (brushInterface) {
QPainter painter(&theImage);
setupPainter(painter);
const QRect rect = brushInterface->mouseMove(brush, painter, lastPos,
event->pos());
update(rect);
}
lastPos = event->pos();
}
}
To copy to clipboard, switch view to plain text mode
this is just an example i found, but how can i link an event with an button? i tried
if(e){
}
}
void mouseclick(QMouseEvent *e){
if(e){
}
}
To copy to clipboard, switch view to plain text mode
in the headerfile of my ui file but actually i can't use the dot-extension for the event e, why? anyone got an idea?
thx
tobi
Bookmarks