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. Assign doubleSpinBox value to a variable in order to write them down in a txt file

Assign doubleSpinBox value to a variable in order to write them down in a txt file

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 924 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.
  • D Offline
    D Offline
    dpeponis
    wrote on last edited by
    #1

    Hello, first of all I have to admit that I'm a newbie in Qt programming. I'm trying to make a simple program to write values given by a user to a .txt file. My idea is to use doubleSpinBox to set the values and by pressing a button the value of the box will be assigned to a variable. Then, the variables will be writen using traditional C methods to a file. I'm facing a difficulty in writing the right command to do this. I use

    @var_name=ui->doubleSpinBox->value();@

    right after MainWIndow class in mainwindow.cpp file. But nothing happens. What I'm doing wrong? I know I have to use Signals and Slots in order to do this, but again I'm a newbie. Any kind of help/hint appreciated.

    Regards

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

      Hi and welcome to devnet,

      I would recommend you to first go through the tutorials and examples from Qt's documentation in order get a grasp of both signals and slots and Qt programming in general.

      For the file writing part you can use QFile so you get an all Qt solution.

      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
      0

      • Login

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