#include "maindialog.h"int main(int argc, char* argv[]){ QApplication app(argc, argv); // QTextCodec * myTextCodec = QTextCodec::codecForName("KOI8-R"); // QTextCodec::setCodecForCStrings (myTextCodec); MainFrame win; win.show(); app.exec();}
class MainFrame : public QDialog, private Ui::MainDialog{ Q_OBJECTpublic: MainFrame(QWidget *parent = 0);public slots:// нажали на кнопку void load_pressed();};MainFrame::MainFrame(QWidget *parent): QDialog(parent){ setupUi(this); connect(Load_butn, SIGNAL(clicked()),this, SLOT(load_pressed()));}void MainFrame::load_pressed(){ QTextCodec * myTextCodec = QTextCodec::codecForName("KOI8-R"); QTextCodec::setCodecForCStrings (myTextCodec); delete myTextCodec;}
delete myTextCodec;