4321Fermer4323
deleted2Le 28/02/2020 à 17:12
J'en ai pas besoin, la question était purement réthorique ^^

    QString source       = ui->ComboSource->currentText();
    QGridLayout* glayout = static_cast<QGridLayout*>(ui->BoxDestinations->layout());
    int column           = 0;
    int row              = 0;

    for (int i = 0; i < this->destcount; i++, column++) {
        QBoxLayout* blayout = static_cast<QBoxLayout*>(glayout->itemAtPosition(row, column));
        QString dest        = static_cast<QLabel*>(blayout->itemAt(1)->widget())->text();
        if (source == dest) {
            QCheckBox* checkbox = static_cast<QCheckBox*>(blayout->itemAt(0)->widget());
Ce qui est lamentable, quand on écrit des horreurs, c'est que ça marche quand même. Il serait normal que le programme s'auto-kill, ou que ça brique le PC.
Bon, ne vous inquiétez pas, je vais revoir un peu mes structures de données, sinon je n'en dormirai pas de la nuit. grin



Question bonus, dans la déclaration d'un constructeur je veux faire ça : truc::truc() : a(new A), b(new B(a))C'est garanti que a soit alloué avant b ? J'ai besoin de a pour construire b...