PDA

View Full Version : How to Display/Paint raw image data.



vinaykusta
11th October 2011, 07:44
Hi,

I’m new to Qt.

I’m using a QTabWidget. I want to display/paint raw image data in the tab area.

Please guide me how can this be achieved. What factors/resources/widgets are to be considered to achieve this.

Thanks for all suggestion and support.

wysota
11th October 2011, 07:52
QTabWidget::setTabIcon()

vinaykusta
11th October 2011, 09:49
Hi,

QTabWidget::setTabIcon() : As per my understanding is it used to set an icon for the tab. But, I'm trying to display/paint an entire 800X600 image in the tab area below.

Please let me know how can it be achieved.

wysota
11th October 2011, 09:50
Oh, ok. Use QLabel then. Possibly inside QScrollArea.

vinaykusta
12th October 2011, 11:53
Thank you.

I'm using Qt creator.

I have used Qt designer to create create MainWindow only.

The following files are generated: main.cpp, mainwindow.cpp, mainwindow.h and mainwindow.ui. The class MainWindow inherits the class Ui_mainwindow generated from mainwindow.ui. Ui_mainwindow class is defined in the file ui_mainwindow.h which does not appear in the file explorer. I understand the ui_mainwindow.h is generated automatically from mainwindow.ui

Further in the mainwindow.cpp, ui->setupUi(this) instantiate the screen. Please let me know what has to be done if I want to create QLabel and add this to UI through cpp file.

Where should that peice of code be written. ?? Please dont mind answering my silly questions. Thanks a lot.

wysota
12th October 2011, 14:01
You can put the label directly in Designer. If you don't want to, there is a section in the docs describing how to blend Designer generated forms with your C++ code.