void PlantsWindow::set_color() { QString color_str = toQString(selected_plant().get_color_str()); QColor init_color(color_str); QColor color = color_dialog->getColor(init_color, this); selected_plant().set_color_str(fromQString(color.name())); emit timeline_need_update(); }
void AddPlotDialog::add() { QString name = nameInput->text(); Plot& plot = plots.add_plot("", fromQString(name)); plot.set_rect(physInput->get_rect()); int nb_hor = horInput->text().toInt(); int nb_ver = verInput->text().toInt(); plot.create_subplots(nb_hor, nb_ver); emit list_updated(); hide(); }
void PlantsWindow::update_notes(int current_plant_index, int previous_plant_index) { //We save the note content of the previous plant if (previous_plant_index >= 0) { QString text = notes_widget->toPlainText(); plants_model->get_plants().index(previous_plant_index).set_note(fromQString(text)); } //and get the notes for the new plant if (current_plant_index >= 0) { QString text = toQString(plants_model->get_plants().index(current_plant_index).get_note()); notes_widget->setPlainText(text); } }
void PlotsWindow::update_notes(int current_plot_index, int previous_plot_index) { //We save the note content of the previous plot if (previous_plot_index >= 0) { QString text = notes_widget->toPlainText(); plots.index(previous_plot_index).set_note(fromQString(text)); } //and get the notes for the new plot if (current_plot_index >= 0) { QString text = toQString(plots.index(current_plot_index).get_note()); notes_widget->setPlainText(text); notes_widget->setDisabled(false); } else { notes_widget->setDisabled(true); } }
void AddVarDialog::add_elem(QString name) { int plant_index = plants_widget->index(); plants.index(plant_index).add_var("", fromQString(name)); }
void AddPlantDialog::add_elem(QString name) { plants.add_plant("", fromQString(name)); }