Add mode number to vibrations table

The vibration table that opens for frequency jobs does not contain the mode number, which can be helpful for quickly identifying the mode for certain analyses. I wonder if there is a specific reason not to include such numbers in the table.

I have implemented it myself with couple of changes into avogadrolib package:

  1. Make vertical header visible in avogadro/qtplugins/vibrations/vibrationdialog.cpp:
m_ui->tableView->verticalHeader()->setVisible(true); // it was false
  1. Add number of rows to VibrationModel in avogadro/qtplugins/vibrations/vibrationmodel.cpp:
QVariant VibrationModel::headerData(int section, Qt::Orientation orientation,
                                    int role) const
{
  if (role == Qt::DisplayRole) {
    if (orientation == Qt::Horizontal) {
      switch (section) {
        case 0:
          return QString("Frequency (cm⁻¹)");
        case 1:
          return QString("Intensity (KM/mol)");
        case 2:
          return QString("Raman Intensity (Å⁴/amu)");
      }
    }
    else if (orientation == Qt::Vertical) {   // new
      return QString::number(section + 1);    // new
    }                                         // new
  }
  return QVariant();
}

The vibration table then looks like this:

Would it be possible to implement this change into avogadrolib?

Thanks for the nice project!

Javier

2 Likes

Sure. If you can submit a pul request Pull requests · OpenChemistry/avogadrolibs · GitHub I’d be happy to take a look. Seems useful.

Hi.

Thanks for the quick reply. I’ve just submitted the pull request #1952

2 Likes

Okay, I think it’s merged - should be part of the next nightly build.

Thanks for the suggestion and quick patch!

Thanks! I could see it is now in the latest nightly build for Win.

I also noticed that there is no nightly-built Linux AppImmage. Is this a known behaviour? I checked, and the build only produces 2 artifacts (for Win and Mac), while it used to produce 4 (+Linux tar.gz and AppImage). It seems the change happened in PR #1908 ( Switch Linux release builds to Qt6 ). Sorry for going off-thread with this follow-up question.

The Appimage is still created - I just need to update some scripts because it’s not created in the same way.

OK, thanks for the clarification. I’ll keep an eye out for updates.

Again, many thanks for such a useful tool