QString city_1 = settings->value("city_1").toString();mes = new QMessageBox(QMessageBox::NoIcon, tr("Описание объекта"), city_1);
QString city_1(settings->value("city_1").toString()); QMessageBox mes(QMessageBox::NoIcon, tr("Описание объекта"), city_1); mes.exec();
#include "map.h"#include <QTextCodec>map::map(QWidget *parent) : QWidget(parent){ QTextCodec *codec = QTextCodec::codecForName("CP1251"); QTextCodec::setCodecForTr(codec); QTextCodec::setCodecForCStrings(codec); QTextCodec::setCodecForLocale(codec); btn_msc = new QPushButton(tr("Москва")); settings = new QSettings("data_map.ini", QSettings::IniFormat); QString city_1 = settings->value("city_1").toString(); connect(btn_spb, SIGNAL(clicked()), SLOT(message_show()));}void map::message_show(){ mes = new QMessageBox(QMessageBox::NoIcon, tr("Описание объекта"), city_1); mes->show();}map::~map(){ }
C++ (Qt)while(!asleep()) sheep++;