[Qt-creator] how to show an image in graphics view
john smith
mkinsightdeveloper at gmail.com
Fri May 13 14:52:24 CEST 2011
Hello,
It is the first time that I am using classes, I am not keen on using Qt
documentation and I am trying to make my first application. well I am using
a toolbar and a graphics view, and I want to push the button of the toolbar
and show the image in the graphics view. But I have a problem in how to
handle the classes. So far I have written the following code but I do not
know what to type on the highlighted area. Is there anyone who could help
me?
Thanks in advance
////////////// main.cpp ////////////////
#include "open_image.h"
#include <QtGui/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
open_image w;
w.show();
return a.exec();
}
////////// open_image.cpp ///////////
#include "open_image.h"
open_image::open_image(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
setupUi(this);
QObject::connect(action_Open_File, SIGNAL(triggered()), this,
SLOT(doThingA()));
}
open_image::~open_image()
{
}
void open_image::doThingA(void)
{
graphicsView->
}
//////////////// open_image.h //////////////////
#ifndef OPEN_IMAGE_H
#define OPEN_IMAGE_H
#include <QtGui/QMainWindow>
#include "ui_open_image.h"
class open_image : public QMainWindow, private Ui::open_imageClass
{
Q_OBJECT
public:
open_image(QWidget *parent = 0, Qt::WFlags flags = 0);
~open_image();
private:
Ui::open_imageClass ui;
private slots:
void doThingA(void);
};
#endif // OPEN_IMAGE_H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20110513/47f4c44d/attachment.html
More information about the Qt-creator-old
mailing list