1. C++ / Говнокод #3415

    +158

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    for (int i = 0; i < m_pTableWidget->rowCount(); i++) {
            m_pFilterList->addFilter(m_pTableWidget->item(i, 0)->text(), 
                                     (qobject_cast<QComboBox*>(m_pTableWidget->cellWidget(i, 1)))->currentText(),
                                     (qobject_cast<QComboBox*>(m_pTableWidget->cellWidget(i, 2)))->itemData((qobject_cast<QComboBox*>(m_pTableWidget->cellWidget(i, 2)))->currentIndex()).toString(),
                                     m_pTableWidget->item(i, 3)->text(),
                                     (qobject_cast<QComboBox*>(m_pTableWidget->cellWidget(i, 4)))->itemData((qobject_cast<QComboBox*>(m_pTableWidget->cellWidget(i, 4)))->currentIndex()).toString(),
                                     ((qobject_cast<QComboBox*>(m_pTableWidget->cellWidget(i, 2)))->currentText().contains("конца") ? "'%" : (qobject_cast<QComboBox*>(m_pTableWidget->cellWidget(i, 2)))->currentText().contains("любой") ? "'%" : "'"),
                                     ((qobject_cast<QComboBox*>(m_pTableWidget->cellWidget(i, 2)))->currentText().contains("начала") ? "%'" : (qobject_cast<QComboBox*>(m_pTableWidget->cellWidget(i, 2)))->currentText().contains("любой") ? "'%" : "'")
                                     );
        }

    Вот так вот брутально выглядит код "в одну строчку"

    Запостил: JC_NVKZ, 08 Июня 2010

    Комментарии (1) RSS

    Добавить комментарий