...<sender>pushButton</sender> <signal>clicked()</signal>
HelpBrowser* helpbrowser = new HelpBrowser("doc", "./help/index.html");
...#include "proga1_helpbrowser.h"class MainWindow : public QMainWindow, Ui::MainWindow { Q_OBJECTpublic: HelpBrowser *helpbrowser; bool english; // english - true, russian - false int iS, oS, oM, oH; QTranslator* translator; QFile* file; QTextEdit * textInput; QDockWidget *dockWidget; MainWindow(QMainWindow* p = 0) : QMainWindow(p) { english = false;...
...void MainWindow::helpBrowser(){ this->setWindowModality(Qt::NonModal); if (english) { helpbrowser = new HelpBrowser("C:\\Pr1", "log.txt"); } else helpbrowser = new HelpBrowser("C:\\Pr1", "eng.ts");...
{QString textrep = textInput->toPlainText();textrep.replace("1", " 1 in the Morze code is .---- \r\n");textrep.replace("2", " 2 in the Morze code is ..--- \r\n");textrep.replace("3", " 3 in the Morze code is ...-- \r\n");textrep.replace("4", " 4 in the Morze code is ....- \r\n");textrep.replace("5", " 5 in the Morze code is ..... \r\n");textrep.replace("6", " 6 in the Morze code is -.... \r\n");textrep.replace("7", " 7 in the Morze code is --... \r\n");textrep.replace("8", " 8 in the Morze code is ---.. \r\n");textrep.replace("9", " 9 in the Morze code is ----. \r\n");textrep.replace("0", " 0 in the Morze code is ----- \r\n");textOutput->setPlainText(textrep);}
" 2 in the Morze code is ..--- \r\n"
" in the Morze code is "
textrep.replace("1", tr(" 1 in the Morze code is .---- \r\n"));
QString str2 = tr(" in the Morze code is ");textrep.replace("1", " 1" << str2 << ".---- \r\n");
C:/Pr2/proga2.cpp:12: error: no match for 'operator<<' in '" 1" << str2'
C++ (Qt)textrep.replace("1", " 1" + str2 + ".---- \r\n");
void MainWindow::logFile(){ QDesktopServices::openUrl(QUrl::fromLocalFile(QApplication::applicationDirPath()+"./log.txt"));}
C++ (Qt)void MainWindow::logFile(){ QDesktopServices::openUrl(QUrl::fromLocalFile(QApplication::applicationDirPath()+"/log.txt"));}
#include <QApplication>#include <QTPlugin>#include <QTGui>#include <QTranslator>#include <QtCore> Q_IMPORT_PLUGIN(qjpeg) Q_IMPORT_PLUGIN(qgif) Q_IMPORT_PLUGIN(qkrcodecs)#include "proga1.h" int main (int argc, char **argv) { QApplication app(argc, argv); MainWindow w; QTranslator *translator = new QTranslator; qApp->removeTranslator(translator); translator->load("./eng.qm", "."); qApp->installTranslator(translator); retranslateUi(w); w.show(); return app.exec(); }
C:/Pr1/main.cpp:53: error: 'retranslateUi' was not declared in this scope
... MainWindow w ; QTranslator *translator = new QTranslator; translator->load("eng.qm", "C:\\Pr1"); qApp->installTranslator(translator); w.myRetranslateUi();
... void logFile(); void closeEvent(QCloseEvent *event); void myRetranslateUi();
...void MainWindow::myRetranslateUi(){ retranslateUi(this);}