Results 1 to 2 of 2

Thread: arithmetic operations in QT

  1. #1
    Join Date
    Dec 2016
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default arithmetic operations in QT

    I am new to QT, learning through some small programs. I am trying to do arithmetic operations, it is not happening. I am having multiple files. All variables are declared and defined in main.cpp file. In other files I using it with the keyword extern. Even simple arithmetic operations like a = a+1 or a++ is not working. I noticed this issue with a floating point variable first. Now no arithmetic operations are working. I tried by declaring these variables as local to the function and global to the file. still no change. How to tackle this issue? what is the reason for this?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: arithmetic operations in QT

    You need to go back to your C++ books and learn about variables and scoping. Your problem has nothing to do with Qt and everything to do with basic C++.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Define a QRegExp containing arithmetic operators
    By aaditya190 in forum Newbie
    Replies: 1
    Last Post: 4th December 2013, 12:38
  2. In which thread are TCP IO-Operations done?
    By P@u1 in forum Qt Programming
    Replies: 9
    Last Post: 21st June 2011, 14:02
  3. File operations
    By MTK358 in forum Newbie
    Replies: 3
    Last Post: 13th September 2010, 00:04
  4. Bit operations
    By Lykurg in forum General Programming
    Replies: 1
    Last Post: 8th April 2010, 12:11
  5. Graphics operations - Qt 4.1
    By hoborg in forum Newbie
    Replies: 1
    Last Post: 18th February 2006, 15:09

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.