1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Need some help making a C++ Twitter client with QT

Discussion in 'C++' started by CircuitX, Oct 16, 2009.

  1. CircuitX

    CircuitX New Member

    Joined:
    Feb 2, 2009
    Messages:
    18
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    England, UK
    Home Page:
    Hey everyone.

    I'm trying to make a twitter client (called qTwit) in C++ with QT, but i'm a total beginner when it comed to making GUI applications, so I need a bit of help.

    I have completed most of the GUI now, but I am getting a few compiler errors. (I am running Arch Linux, and my compiler is g++)

    ERRORS:
    Code:
    bash-4.0$ make
    g++ -c -pipe -march=i686 -mtune=generic -O2 -pipe -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -o qtwit.o qtwit.cpp
    qtwit.cpp: In constructor ‘qTwit::qTwit(QWidget*)’:
    qtwit.cpp:6: error: no matching function for call to ‘qTwit::setupUi(qTwit* const)’
    ui_qtwit.h:41: note: candidates are: void Ui_qTwit::setupUi(QMainWindow*)
    qtwit.cpp: At global scope:
    qtwit.cpp:4: warning: unused parameter ‘parent’
    make: *** [qtwit.o] Error 1
    
    SOURCE
    main.cpp:
    Code:
    #include <QApplication>
    #include "qtwit.h"
     
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
        qTwit *dialog = new qTwit;
     
        dialog->show();
        return app.exec();
    }
    qtwit.cpp:
    Code:
    #include <QtGui> 
    #include "qtwit.h"
    
    qTwit::qTwit(QWidget *parent)
    {
        setupUi(this);
     
        connect( pushButton_update, SIGNAL( clicked() ), this, SLOT( getStatus() ) ); 
        connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( cancel() ) ); 
    }
     
     
    void qTwit::getStatus()
    {
        QString status;
        QString user;
        QString pass;
     
        status_edit->setText( status );
        user_edit->setText( user );
        pass_edit->setText( pass );
    
    }
    
    void qTwit::cancel()
    {
        status_edit->clear();
    }
    qtwit.h:
    Code:
    #ifndef QTWIT_H
    #define QTWIT_H
     
    #include "ui_qtwit.h"
     
     
    class qTwit : public QWidget, private Ui::qTwit
    {
        Q_OBJECT
     
    public:
        qTwit(QWidget *parent = 0);
     
     
    public slots:
        void getStatus();
        void cancel();
    };
     
     
    #endif
    ui_qtwit.h:
    http://pastebin.com/f7a7d197c

    Anyway, I have gotten rid of a few errors, but the ones that remain I am really stuck on!

    If I have left any important information out, please ask me and I will add it.

    Thanks,
    Ben
     

Share This Page