Ejemplo n.º 1
0
LargePhotoView::LargePhotoView(QString path, QWidget *parent, ThumbnailView *listArea) : QWidget(parent) {
    layout = new QGridLayout(this);
    this->listArea = listArea;

    fullscreen = false;

    photoWidget = new LargePhotoWidget(path,this);
    layout->addWidget(photoWidget,1,0);

    toolbar = new QToolBar("",this);
    layout->addWidget(toolbar,2,0);
    setLayout(layout);

    QString shortCut("O");
    QAction *action = toolbar->addAction(QIcon::fromTheme("folder"),getShortcutLabel("Open in file manager",shortCut),
                                         this,SLOT(openInFileManager()));
    action->setShortcut(QKeySequence(shortCut));
    shortCut = QString("E");
    action = toolbar->addAction(QIcon::fromTheme("image-x-generic"),getShortcutLabel("Edit photo in other application",shortCut),
                                this,SLOT(editPhoto()));
    action->setShortcut(QKeySequence(shortCut));
    toolbar->addSeparator();
    shortCut = QString("Ctrl+Shift+R");
    action = toolbar->addAction(QIcon::fromTheme("object-rotate-left"),getShortcutLabel("Rotate anti-clockwise",shortCut),
                                this,SLOT(rotatePhotoAntiClockwise()));
    action->setShortcut(QKeySequence(shortCut));
    shortCut = QString("Ctrl+R");
    action = toolbar->addAction(QIcon::fromTheme("object-rotate-right"),getShortcutLabel("Rotate clockwise",shortCut),
                                this,SLOT(rotatePhotoClockwise()));
    action->setShortcut(QKeySequence(shortCut));

    toolbar->addSeparator();

    shortCut = QString("Escape");
    action = toolbar->addAction(QIcon::fromTheme("go-up"),getShortcutLabel("Back to event",shortCut),
                                this,SLOT(backAction()));
    action->setShortcut(QKeySequence(shortCut));

    shortCut = QString("Left");
    action = toolbar->addAction(QIcon::fromTheme("go-previous"),getShortcutLabel("Previous photo",shortCut),
                                this,SLOT(prevPhoto()));
    action->setShortcut(QKeySequence(shortCut));

    shortCut = QString("Right");
    action = toolbar->addAction(QIcon::fromTheme("go-next"),getShortcutLabel("Next photo",shortCut),
                                this,SLOT(nextPhoto()));
    action->setShortcut(QKeySequence(shortCut));

    toolbar->addSeparator();

    shortCut = QString("F11");
    action = toolbar->addAction(QIcon::fromTheme("view-fullscreen"),getShortcutLabel("Toggle Fullscreen",shortCut),this,SLOT(toggleFullscreen()));
    action->setShortcut(QKeySequence(shortCut));

    connect(photoWidget,SIGNAL(doubleClicked()),this,SLOT(toggleFullscreen()));

    setFocus();
}
Ejemplo n.º 2
0
PhotoView::PhotoView (QWidget * parent )
    : QWidget ( parent )
{

    QString iniFile = QCoreApplication::applicationDirPath() + "/FlickrViewer.ini";
    QSettings settings(iniFile, QSettings::IniFormat);
    int slideDuration = settings.value("slideshow/slideDuration").toInt();

    photoPath = QCoreApplication::applicationDirPath() + "/photos/";

    photoDirectory = QDir(photoPath);

    //timer used to change photos
    timer = new QTimer ( this );
    connect ( timer, SIGNAL ( timeout() ), this, SLOT ( nextPhoto() ) );
    timer->start ( slideDuration );

    opacity = 1.0;
    nextPhoto();
}
Ejemplo n.º 3
0
Photos::Photos(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Photos)
{
    ui->setupUi(this);

    position = 0;
    original_x = 40;
    original_y = 18;
    image_width = 380;
    image_height = 200;
    transform_flag = 0;
    widget_width = QWidget::width();
    widget_height = QWidget::height();

    mouse_flag = 0;
    static_height = 50;
    static_width =  80;

   // translateLanguage();
    designUI();

    this->setMouseTracking(true);
    this->setWindowFlags(Qt::FramelessWindowHint);

    connect(ui->open_pushButton, SIGNAL(clicked()), this, SLOT(openFiles()));
    connect(ui->previous_pushButton, SIGNAL(clicked()), this, SLOT(previousPhoto()));
    connect(ui->next_pushButton, SIGNAL(clicked()), this, SLOT(nextPhoto()));
  //  connect(ui->previous_Button, SIGNAL(clicked()), this, SLOT(previousPhoto()));
    //connect(ui->next_Button, SIGNAL(clicked()), this, SLOT(nextPhoto()));
    connect(ui->expand_pushButton, SIGNAL(clicked()), this, SLOT(expandImage()));
    connect(ui->narrow_pushButton, SIGNAL(clicked()), this, SLOT(narrowImage()));
    connect(ui->delete_pushButton, SIGNAL(clicked()), this, SLOT(deleteImage()));
    connect(ui->adjust_pushButton, SIGNAL(clicked()), this, SLOT(adjustPhoto()));


   // QPainter *painter1 = new QPainter;
   // painter1->setBrush(Qt::black);
    //painter1->drawPixmap(original_x, original_y, image_width, image_height, pixmap);


}
Ejemplo n.º 4
0
void BackendOsmRG::slotResult(KJob* kJob)
{
    KIO::Job* kioJob = qobject_cast<KIO::Job*>(kJob);

    if (kioJob->error())
    {
        d->errorMessage = kioJob->errorString();
        emit(signalRGReady(d->jobs.first().request));
        d->jobs.clear();
        
        return;
    }

    for (int i = 0; i < d->jobs.count(); ++i)
    {
        if (d->jobs.at(i).kioJob == kioJob)
        {
            QString dataString;
            dataString = QString::fromUtf8(d->jobs[i].data.constData(),qstrlen(d->jobs[i].data.constData()));

            int pos = dataString.indexOf("<reversegeocode");
            dataString.remove(0,pos);

            QMap<QString, QString> resultMap = makeQMapFromXML(dataString);

            for (int j = 0; j < d->jobs[i].request.count(); ++j)
            {
                d->jobs[i].request[j].rgData = resultMap;
            }
            emit(signalRGReady(d->jobs[i].request));
 
            d->jobs.removeAt(i);

            if (!d->jobs.empty())
            {    
                QTimer::singleShot(500, this, SLOT(nextPhoto()));
            }

            break;
        }
    }
}