Example #1
0
/* processing mouse double click events over label */
void KbfxPixmapLabel::mouseDoubleClickEvent ( QMouseEvent * e )
{
	e->accept();
	ButtonState _btn = e->button();
	kdDebug() << "Mouse Double Clicked: " << _btn << endl;
	emit mouseDoubleClicked ();
	emit mouseDoubleClicked ( _btn );
}
Example #2
0
void FileListView::mouseDoubleClickEvent( QMouseEvent* event )
{
    _mousePosition = this->mapToGlobal( event->pos() );

    emit mouseDoubleClicked();

    QListView::mouseDoubleClickEvent( event );
}
Example #3
0
void AbstractMargin::mouseDoubleClickEvent( QMouseEvent* event )
{
    QWidget::mouseDoubleClickEvent( event );
    
    if ( d->line != -1 ) {
        emit mouseDoubleClicked( d->line, event->button(), event->buttons(), event->modifiers() );
    }
}
void QITreeView::mouseDoubleClickEvent(QMouseEvent *pEvent)
{
    /* Reject event initially: */
    pEvent->setAccepted(false);
    /* Notify listeners about event allowing them to handle it: */
    emit mouseDoubleClicked(pEvent);
    /* Call to base-class only if event was not yet accepted: */
    if (!pEvent->isAccepted())
        QTreeView::mouseDoubleClickEvent(pEvent);
}
Example #5
0
void Books::addBook(const QString &path)
{
    QString bookName = path;
    BookLabel * label = new BookLabel;
    label->setAlignment(Qt::AlignCenter);
    label->setText(bookName);
    QString style = "background-color: green";
    label->setStyleSheet(style);
    label->setMinimumSize(100, 100);
    connect(label, SIGNAL(mouseDoubleClicked()), this, SLOT(openBook()));
    ui.scrollAreaWidgetContents->layout()->addWidget(label);

}
void AMCrosshairOverlayVideoWidget::mouseReleaseEvent(QMouseEvent *e)
{
	AMOverlayVideoWidget::mouseReleaseEvent(e);

	if(e->button() == Qt::LeftButton) {
		if(doubleClickInProgress_) {
			emit mouseDoubleClicked(mapSceneToVideo(mapToScene(e->pos())));
			doubleClickInProgress_ = false;
		}
		else {
			emit mouseReleased(mapSceneToVideo(mapToScene(e->pos())));
		}
	}
}
void FileSystemBrowser::initContent()
{
    _fileTreeView = new FileTreeView();
    _fileTreeView->setRootFolder( "/" );

    connect( _fileTreeView, SIGNAL(mouseDoubleClicked()),   this, SLOT(fileBrowserDoubleClicked())  );
    connect( _fileTreeView, SIGNAL(mouseRightClicked()),    this, SLOT(fileBrowserRightClick())     );

    setContentWidget( _fileTreeView );

    // setup the file operations
    _fileSystemOperations.setMaxThreadsLimit( 1 );

}
Example #8
0
PictureWidget::PictureWidget(QWidget *parent) : QDialog(parent)
{
    installEventFilter(this);

    widgetLayout = new QHBoxLayout(this);
    widgetLayout->setSpacing(0);
    widgetLayout->setContentsMargins(0, 0, 0, 0);

    pictureLabel = new UiModLabel(this);
    pictureLabel->setObjectName("pictureLabel");
    pictureLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    pictureLabel->setContextMenuPolicy(Qt::CustomContextMenu);
    pictureLabel->setAlignment(Qt::AlignCenter);
    widgetLayout->addWidget(pictureLabel);

    QObject::connect(pictureLabel, SIGNAL(mouseDoubleClicked(Qt::MouseButton)), this, SLOT(pictureDoubleClicked(Qt::MouseButton)));
    QObject::connect(pictureLabel, SIGNAL(customContextMenuRequested(QPoint)), parent, SLOT(exportCustomContextMenuRequested(QPoint)));
    QObject::connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(updateWindowSize(int)));

    setLayout(widgetLayout);
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    hwnd = (HWND)ui->paintArea->winId();
    hdc = GetDC(hwnd);
    painter = new Paint;

    connect(ui->red, 	SIGNAL(rightClicked()), this, SLOT(onRedRightClicked()));
    connect(ui->red, 	SIGNAL(leftClicked()), 	this, SLOT(onRedLeftClicked()));
    connect(ui->orange, SIGNAL(rightClicked()), this, SLOT(onOrangeRightClicked()));
    connect(ui->orange, SIGNAL(leftClicked()), 	this, SLOT(onOrangeLeftClicked()));
    connect(ui->yellow, SIGNAL(rightClicked()), this, SLOT(onYellowRightClicked()));
    connect(ui->yellow, SIGNAL(leftClicked()), 	this, SLOT(onYellowLeftClicked()));
    connect(ui->purple, SIGNAL(rightClicked()), this, SLOT(onPurpleRightClicked()));
    connect(ui->purple, SIGNAL(leftClicked()), 	this, SLOT(onPurpleLeftClicked()));
    connect(ui->blue, 	SIGNAL(rightClicked()), this, SLOT(onBlueRightClicked()));
    connect(ui->blue, 	SIGNAL(leftClicked()), 	this, SLOT(onBlueLeftClicked()));
    connect(ui->green, 	SIGNAL(rightClicked()), this, SLOT(onGreenRightClicked()));
    connect(ui->green, 	SIGNAL(leftClicked()), 	this, SLOT(onGreenLeftClicked()));

    connect(ui->purpleLight, 	SIGNAL(rightClicked()), this, SLOT(onPurpleLightRightClicked()));
    connect(ui->purpleLight, 	SIGNAL(leftClicked()), 	this, SLOT(onPurpleLightLeftClicked()));
    connect(ui->blueLight, 		SIGNAL(rightClicked()), this, SLOT(onBlueLightRightClicked()));
    connect(ui->blueLight, 		SIGNAL(leftClicked()), 	this, SLOT(onBlueLightLeftClicked()));
    connect(ui->greenLight, 	SIGNAL(rightClicked()), this, SLOT(onGreenLightRightClicked()));
    connect(ui->greenLight, 	SIGNAL(leftClicked()), 	this, SLOT(onGreenLightLeftClicked()));

    connect(ui->zoom, SIGNAL(leftClicked()), this, SLOT(on_zoomOut_clicked()));
    connect(ui->zoom, SIGNAL(rightClicked()), this, SLOT(on_zoomIn_clicked()));

    connect(ui->paintArea,  SIGNAL(leftPressed(int, int)), this, SLOT(mouseLeftPressed(int, int)));
    connect(ui->paintArea,  SIGNAL(rightPressed(int, int)), this, SLOT(mouseRightPressed(int, int)));
    connect(ui->paintArea,  SIGNAL(leftReleased(int, int)), this, SLOT(mouseLeftReleased(int, int)));
    connect(ui->paintArea,  SIGNAL(rightReleased(int, int)), this, SLOT(mouseRightReleased(int, int)));
    connect(ui->paintArea,  SIGNAL(moved(int, int)), this, SLOT(mouseMoved(int, int)));
    connect(ui->paintArea,  SIGNAL(doubleClicked()), this, SLOT(mouseDoubleClicked()));
}
Example #10
0
void QIStateIndicator::mouseDoubleClickEvent (QMouseEvent * e)
{
    emit mouseDoubleClicked (this, e);
}
Example #11
0
void CPushButton::mouseDoubleClickEvent(QMouseEvent *event){
    emit mouseDoubleClicked();
    event->pos();
}
Example #12
0
void IPImageViewer::on_mouseDoubleClicked()
{
    emit mouseDoubleClicked();
}
Example #13
0
void MainWindow::addPlaylistHashToGrid(const QVector<QHash<QString, QString> > &items)
{
   QScreen *screen = qApp->primaryScreen();
   QSize screenSize = screen->size();
   QListWidgetItem *currentItem = m_listWidget->currentItem();
   settings_t *settings = config_get_ptr();
   int i = 0;
   int zoomValue = m_zoomSlider->value();

   m_gridProgressBar->setMinimum(0);
   m_gridProgressBar->setMaximum(qMax(0, items.count() - 1));
   m_gridProgressBar->setValue(0);

   for (i = 0; i < items.count(); i++)
   {
      const QHash<QString, QString> &hash = items.at(i);
      QPointer<GridItem> item;
      QPointer<ThumbnailLabel> label;
      QString thumbnailFileNameNoExt;
      QLabel *newLabel = NULL;
      QSize thumbnailWidgetSizeHint(screenSize.width() / 8, screenSize.height() / 8);
      QByteArray extension;
      QString extensionStr;
      QString imagePath;
      int lastIndex = -1;

      if (m_listWidget->currentItem() != currentItem)
      {
         /* user changed the current playlist before we finished loading... abort */
         m_gridProgressWidget->hide();
         break;
      }

      item = new GridItem();

      lastIndex = hash["path"].lastIndexOf('.');

      if (lastIndex >= 0)
      {
         extensionStr = hash["path"].mid(lastIndex + 1);

         if (!extensionStr.isEmpty())
         {
            extension = extensionStr.toLower().toUtf8();
         }
      }

      if (!extension.isEmpty() && m_imageFormats.contains(extension))
      {
         /* use thumbnail widgets to show regular image files */
         imagePath = hash["path"];
      }
      else
      {
         thumbnailFileNameNoExt = hash["label_noext"];
         thumbnailFileNameNoExt.replace(m_fileSanitizerRegex, "_");
         imagePath = QString(settings->paths.directory_thumbnails) + "/" + hash.value("db_name") + "/" + THUMBNAIL_BOXART + "/" + thumbnailFileNameNoExt + ".png";
      }

      item->hash = hash;
      item->widget = new ThumbnailWidget();
      item->widget->setSizeHint(thumbnailWidgetSizeHint);
      item->widget->setFixedSize(item->widget->sizeHint());
      item->widget->setLayout(new QVBoxLayout());
      item->widget->setObjectName("thumbnailWidget");
      item->widget->setProperty("hash", QVariant::fromValue<QHash<QString, QString> >(hash));

      connect(item->widget, SIGNAL(mouseDoubleClicked()), this, SLOT(onGridItemDoubleClicked()));
      connect(item->widget, SIGNAL(mousePressed()), this, SLOT(onGridItemClicked()));

      label = new ThumbnailLabel(item->widget);
      label->setObjectName("thumbnailGridLabel");

      item->label = label;
      item->labelText = hash.value("label");

      newLabel = new QLabel(item->labelText, item->widget);
      newLabel->setObjectName("thumbnailQLabel");
      newLabel->setAlignment(Qt::AlignCenter);
      newLabel->setToolTip(item->labelText);

      calcGridItemSize(item, zoomValue);

      item->widget->layout()->addWidget(label);

      item->widget->layout()->addWidget(newLabel);
      qobject_cast<QVBoxLayout*>(item->widget->layout())->setStretchFactor(label, 1);

      m_gridLayout->addWidgetDeferred(item->widget);
      m_gridItems.append(item);

      loadImageDeferred(item, imagePath);

      if (i % 25 == 0)
      {
         /* Needed to update progress dialog while doing a lot of stuff on the main thread. */
         qApp->processEvents();
      }

      m_gridProgressBar->setValue(i);
   }

   /* If there's only one entry, a min/max/value of all zero would make an indeterminate progress bar that never ends... so just hide it when we are done. */
   if (m_gridProgressBar->value() == m_gridProgressBar->maximum())
      m_gridProgressWidget->hide();
}
Example #14
0
void ThumbnailWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
   QWidget::mouseDoubleClickEvent(event);

   emit mouseDoubleClicked();
}
Example #15
0
void RDListWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
  emit(mouseDoubleClicked(event));
  QListWidget::mouseDoubleClickEvent(event);
}