0

I have a dialog created using Qt Designer.

How can I make Qt Designer output something more dynamic than the hardcoded "Survex Errors" I18n key in the following code it generates? (scroll to the right to see it)

For instance make it get the value of a dynamic property, or call a pure virtual function to get the key?

class Ui_cwImportTreeDataDialog
{
public:

    void setupUi(QDialog *cwImportTreeDataDialog)
    {
        ...
    }

    ...

    void retranslateUi(QDialog *cwImportTreeDataDialog)
    {
        ...
        tabWidget->setTabText(tabWidget->indexOf(SurvexErrorsWidget), QApplication::translate("cwImportTreeDataDialog", "Survex Errors", 0));
        ...
    }
}

I want to be able to control which I18n key is used from my class that extends Ui_cwImportTreeDataDialog.

Andy
  • 7,885
  • 5
  • 55
  • 61
  • 1
    Can't you just reset the tabWidget->setTabText() in the constructor of cwImportTreeDataDialog? – vpicaver Dec 15 '15 at 20:05
  • Howdy! I could, I was just looking for a way to do it that wouldn't get blown away if `retranslateUi` gets called later... – Andy Dec 15 '15 at 20:18
  • Check this one out: https://stackoverflow.com/questions/7426803/retranslateui-clears-qlabel-text – vpicaver Dec 15 '15 at 20:28
  • Ah. Well, since the program is English only, I guess no loss...but I'd hope there's a way to make it work in any language – Andy Dec 15 '15 at 20:56
  • Currently we do have Chinese translations, but they aren't integrated into the master. – vpicaver Dec 16 '15 at 02:38

0 Answers0