Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Learning Qt4
#1
Is anyone interested in me doing a serious tutorial on how to create a functional application in Qt4 from the ground up? Vote on the poll, if there's enough interest then I'll document my current project as I work on it. Current project that I'm working on is a fairly simple Omegle (omegle.com) chat client. The tutorial would obviously demonstrate UI development, signals, slots, and networking using Qt, code in c++.


---

Qt4 is a widget based framework from nokia, mostly to do with GUI's but they have other APIs too for networking and stuff like that.

Here's a simple Hello World app:

main.cpp
Code:
#include <QApplication>
#include "include/MainWindow.h"

int main(int argc, char* argv[])
{
    QApplication app(argc, argv);
    MainWindow mainWin;
    mainWin.show();

    return app.exec();
}
include/MainWindow.h:
Code:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLabel>


class MainWindow : public QMainWindow
{
    public:
        MainWindow();
    protected:
        void closeEvent(QCloseEvent *event);
    private slots:
    private:
        QLabel *container;
};

#endif // MAINWINDOW_H
src/MainWindow.cpp:
Code:
#include "../include/MainWindow.h"

MainWindow::MainWindow()
{
    container = new QLabel(this);
    container->setText("Hello World!");
    setCentralWidget(container);
}

void MainWindow::closeEvent(QCloseEvent *event)
{

}

Messages In This Thread
Learning Qt4 - by Leaky - Jun 22 2011, 11:53 PM
RE: Learning Qt4 - by MindHACKer - Oct 15 2011, 08:36 PM
RE: Learning Qt4 - by Leaky - Oct 18 2011, 12:07 AM
RE: Learning Qt4 - by rAnSaCk - Oct 18 2011, 12:06 PM
RE: Learning Qt4 - by Leaky - Oct 18 2011, 08:03 PM
RE: Learning Qt4 - by naive - Oct 18 2011, 09:55 PM
RE: Learning Qt4 - by MindHACKer - Oct 25 2011, 10:01 PM
RE: Learning Qt4 - by Leaky - Oct 25 2011, 11:01 PM

Users browsing this thread: 1 Guest(s)