Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MS Visual Studio Community 2015
Forum Updated to NodeBB v4.3 + New Features

MS Visual Studio Community 2015

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 535 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RobSan
    wrote on last edited by
    #1

    The following code has been tested on Qt Creator 4.2.1
    file t.cpp
    #include "t.h"
    #include "ui_t.h"
    #include <QLineEdit>
    #include <QMessageBox>
    #include <QString>
    #include <QDialog>

    void T::on_pushButton_2_clicked(){
    QString i_QText = ui->lineEdit_i->text();
    QString j_QText = ui->lineEdit_j->text();
    double ij = i_QText.toDouble() + j_QText.toDouble();
    QString ij_Qtext;
    ij_Qtext.sprintf("%f", ij);
    ui->label->setText(ij_Qtext)
    ui->label_4->setText("done"); cout << "\n\t hello is printed on Window GUI";
    }
    I have ported the code to MS VS 2015,, my code looks like
    #include <QtWidgets/QLineEdit>
    #include <QtWidgets/QMessageBox>
    #include <QString>
    #include <QDialog> // on the stack

    void X::pushButton_X() {
    QString i_QText = ui.lineEdit_rows->text();
    QString j_QText = ui.lineEdit_cols->text();
    double ij = i_QText.toDouble() + j_QText.toDouble();
    QString ij_Qtext;
    ij_Qtext.sprintf("%f", ij);
    ui.label_rc->setText(ij_Qtext);
    ui.label_2->setText("Se genero Exsan");
    }
    I have no compile errors but It does not show the expected result

    am I missing any particular #include ?
    thanks for the help

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What do you mean by porting ?

      Qt Creator is just an IDE.

      What version of Qt did you install and used to build your application ?

      What do you get ? What was expected ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved