How to create an Image viewer for Qt Simulator ???



  • How to create an Image viewer for Qt Simulator ???



  • [quote author="Prajnaranjan Das" date="1292222511"]How to create an Image viewer for Qt Simulator ???[/quote]

    Where are you facing the difficulty.



  • I don't know how to create it ....I want it to add in my Qt Simulator but not getting any idea,how to do.....Please help me



  • Try look this example

    "http://doc.qt.nokia.com/4.7/demos-declarative-photoviewer.html":http://doc.qt.nokia.com/4.7/demos-declarative-photoviewer.html
    [quote author="Prajnaranjan Das" date="1292222511"]How to create an Image viewer for Qt Simulator ???[/quote]



  • I don't know anything about QML ...Is QML necessary for doing projects in Qt.....If so Please tell me how to start with QML and what is the tool we use for QML ????



  • Hey sorry,but I dont want to use QML....Without using QML is it Possible to design with the help of Qt ..I want it to add my Qt Simulator...



  • Oh, but Qt Simulator can work without use qml and qt mobility?

    [quote author="Prajnaranjan Das" date="1292233625"]Hey sorry,but I dont want to use QML....Without using QML is it Possible to design with the help of Qt ..I want it to add my Qt Simulator...[/quote]



  • @
    Multimedia::Multimedia(QWidget *parent):
    QWidget(parent)

    {

    QLabel *lbl = new QLabel;
    QPixmap pixmap(QPixmap::fromImage(QImage(":/images/photos/nokia2.bmp")));
    lbl->setPixmap(pixmap);
    lbl->setAlignment(Qt::AlignCenter);
    
    videoButton = new QPushButton(tr("&VIDEO"));
    videoButton->setStyleSheet("* { background-color:#0F3D3D}");
    
    photoButton = new QPushButton(tr("&PHOTO"));
    photoButton->setStyleSheet("*{background-color:#1A6666}");
    
    radioButton = new QPushButton(tr("&RADIO"));
    radioButton->setStyleSheet("*{background-color:#248F8F}");
    
    newsButton = new QPushButton(tr("&NEWS"));
    newsButton->setStyleSheet("*{background-color:#2EB8B8}");
    
    connect(videoButton,SIGNAL(clicked()),this,SLOT(openVideo()));
    connect(photoButton,SIGNAL(clicked()),this,SLOT(openPhoto()));
    connect(radioButton,SIGNAL(clicked()),this,SLOT(openRadio()));
    connect(newsButton,SIGNAL(clicked()),this,SLOT(openNews()));
    
    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(lbl,0,0);
    layout->addWidget(videoButton,1,0);
    layout->addWidget(photoButton,2,0);
    layout->addWidget(radioButton,3,0);
    layout->addWidget(newsButton,4,0);
    layout->addStretch();
    setLayout(layout);
    

    }

    void Multimedia::openVideo()
    {

    TabDialog *tab = new TabDialog("E://install.ini", this);
    tab->show();
    }

    void Multimedia::openPhoto()
    {

    }
    void Multimedia::openRadio()
    {

    }
    void Multimedia::openNews()
    {

    }
    @

    Can you please tell me how I can view images by clicking the photo pushButton ?????

    [edit: code highlighted / Denis Kormalev]



  • Prajnaranjan Das, please use @ tags for code.



  • I dont know how to use @ tags....Please tell me how to use that ?????



  • Also Please tell me how I can view Images from my mobile if I clicks a pushButton ....I want it to use in Qt Simulator ????


  • Moderators

    Prajnaranjan Das: Please read the documentation that was pointed out to you. They do explain how to do things the Qt way. There further are lots of boks available (a list is "here":http://developer.qt.nokia.com/wiki/Books_and_Links_for_learning_C_and_advanced_topics).

    We are glad to help with specific questions, but we will not write your application for you.



  • Get the Qt sources, go to directory examples/widgets/imageviewer. I think that's basically what you want.



  • Actually that example is used for viewing in window but here I want to build a mobile application, in which It should automatically search and show the images from my mobile device...But for this I'm not getting any idea ......So for this can you please help me ????


  • Moderators

    Prajnaranjan Das: If you do not want to program the image viewer yourself you can always go to Ovi store and buy one.

    If you want to program the application yourself you can take the image viewer example that was pointed out to you and start from there. You will need to modify it a bit of course, but I am sure you will be able to figure it out with some documentation and books. Again I and most others here are willing to answer specific questions, but we can not do your work for you.



  • I don't understand if you want buy an app, or if you are a newbie and not know Qt.
    User have post a possible solution, example of photo viewer like in Qt for desktop or Qml for mobile, you have to look that and choice the best way.
    Before please read some documentation about Qt (maybe "here":http://qt.nokia.com/developer/books/) and C++.

    [quote author="Prajnaranjan Das" date="1292388345"]Actually that example is used for viewing in window but here I want to build a mobile application, in which It should automatically search and show the images from my mobile device...But for this I'm not getting any idea ......So for this can you please help me ????[/quote]



  • You can use QImage and a QWidget subclass create one. It should be very easy. Override the paintEvent in the QWidget subclass to draw the image. To automatically search for images, you should need to implement a recursive function for scanning the file system and finding image files. You should use QFile and related classes. Hope this helps.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.