You are not logged in.

#1 2006-02-11 05:30:33

Registered: 2005-12-30
Posts: 75

c++ and qt newb help

I've been trying to learn c++ a little bit as a first language but have so far only learned the basics. Here is the code i'm trying to put into a qt app

#include <iostream>
#include <math.h> // pow
using namespace std;

int main() {
        float t, w, h;

        cout << "nPoor Man's Dyno TestnWritten by David Rebbenversion 0.1 02/08/06n";
        cout << "==========================nn";

        cout << "Enter 1/4 mile time (sec): ";
        cin >> t;
        cout << "Enter vehicle weight (pounds):";
        cin >> w;

        // HP = Weight/(ET/5.825)³

        cout << "n" << h << " HP required to do " << t << " seconds in 1/4 mile!n";
                return 0;

I've been trying to put this into qt designer and followed the first tutorial on metric conversion only trying to put my code into it instead. The tutorial doesn't really say howto do the coding on how they link it to the buttons and text fields. I guess its probably more advanced c++ code then I know. - for a preview of what I want to look like.

hopefully someone can direct me in the right direction. I searched around and they all seem to say the same thing.


#2 2006-02-11 19:53:54

Registered: 2005-07-29
Posts: 34

Re: c++ and qt newb help

Have you worked through this tutorial yet?  I walks you step by step through a simple application like yours.

From your description I'm not sure if you are getting stuck with implementing the signal->slot mechanism or how to get the designer class into your code.... but either way this tutorial should help clear things up.

Let me know if you get stuck and happy coding.



Board footer

Powered by FluxBB