0
Je suis en train de retourner un pointeur de QMessageBox d'une fonction à une autre, mais je; m face à l'erreur ci-dessous:Face à l'erreur en retournant la boîte de dialogue QT:
error: 'QMessageBox::QMessageBox(const QMessageBox&)' is private Q_DISABLE_COPY(QMessageBox)
Code:
QMessageBox BoxDraw()
{
QMessageBox *msgBox;
bool retValue=false;
msgBox->setWindowTitle("");
QString qstr = QString::fromStdString(MY_String);
QString qyes = QString::fromStdString(MY_String_YES);
QString qno = QString::fromStdString(MY_String_NO);
msgBox->setText(qstr);
msgBox->setParent(0);
msgBox->setWindowFlags(Qt::Window);
msgBox->setWindowFlags(Qt::BypassWindowManagerHint);
return *msgBox;
}
appel d'une autre fonction comme:
*global variable*
QMessageBox *diagBox = NULL;
func A()
{
diagBox = BoxDraw();
}
Merci Manni, c'était très utile. Encore un doute: i ont effectivement mis en œuvre boîte de dialogue GTK comme indiqué ci-dessous: GtkWidget * dialog = gtk_message_dialog_new (GTK_WINDOW (webkitBrowserWindow), drapeaux, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "% s", message_data-> str. str); Maintenant, je veux que "GTK_BUTTONS_OK" soit remplacé par une variable str qui stocke "ok", de sorte que je puisse changer la langue. plz suggérer. – SirKappe