KAddressBookIconView::KAddressBookIconView(KAB::Core *core, QWidget *parent, const char *name) : KAddressBookView(core, parent, name) { QVBoxLayout *layout = new QVBoxLayout(viewWidget()); mIconView = new AddresseeIconView(viewWidget(), "mIconView"); layout->addWidget(mIconView); // Connect up the signals connect(mIconView, SIGNAL(executed(QIconViewItem *)), this, SLOT(addresseeExecuted(QIconViewItem *))); connect(mIconView, SIGNAL(selectionChanged()), this, SLOT(addresseeSelected())); connect(mIconView, SIGNAL(addresseeDropped(QDropEvent *)), this, SIGNAL(dropped(QDropEvent *))); connect(mIconView, SIGNAL(startAddresseeDrag()), this, SIGNAL(startDrag())); connect(mIconView, SIGNAL(contextMenuRequested(QIconViewItem *, const QPoint &)), this, SLOT(rmbClicked(QIconViewItem *, const QPoint &))); }
djvViewMagnifyTool::~djvViewMagnifyTool() { //DJV_DEBUG("djvViewMagnifyTool::~djvViewMagnifyTool"); djvPrefs prefs("djvViewMagnifyTool"); prefs.set("zoom", _p->zoom); prefs.set("colorProfile", _p->colorProfile); prefs.set("displayProfile", _p->displayProfile); viewWidget()->makeCurrent(); delete _p; }
KAddressBookCardView::KAddressBookCardView(KAB::Core *core, QWidget *parent, const char *name) : KAddressBookView(core, parent, name) { mShowEmptyFields = false; QVBoxLayout *layout = new QVBoxLayout(viewWidget()); mCardView = new AddresseeCardView(viewWidget(), "mCardView"); mCardView->setSelectionMode(CardView::Extended); layout->addWidget(mCardView); // Connect up the signals connect(mCardView, SIGNAL(executed(CardViewItem *)), this, SLOT(addresseeExecuted(CardViewItem *))); connect(mCardView, SIGNAL(selectionChanged()), this, SLOT(addresseeSelected())); connect(mCardView, SIGNAL(addresseeDropped(QDropEvent *)), this, SIGNAL(dropped(QDropEvent *))); connect(mCardView, SIGNAL(startAddresseeDrag()), this, SIGNAL(startDrag())); connect(mCardView, SIGNAL(contextMenuRequested(CardViewItem *, const QPoint &)), this, SLOT(rmbClicked(CardViewItem *, const QPoint &))); }
void OSXStyle::drawSelection(QStyleOptionViewItemV4 opt, QPainter *painter, double opacity) { opt.palette=viewPalette(); if (opacity<0.999) { QColor col(opt.palette.highlight().color()); col.setAlphaF(opacity); opt.palette.setColor(opt.palette.currentColorGroup(), QPalette::Highlight, col); } QApplication::style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, viewWidget()); }
const QPalette & OSXStyle::viewPalette() { return viewWidget()->palette(); }
void djvViewMagnifyTool::pixelDataUpdate() { //DJV_DEBUG("djvViewMagnifyTool::pixelDataUpdate"); djvSignalBlocker signalBlocker(QObjectList() << _p->widget); djvPixelData tmp(djvPixelDataInfo( _p->widget->width(), _p->widget->height(), djvPixel::RGB_U8)); if (const djvPixelData * data = viewWidget()->data()) { //DJV_DEBUG_PRINT("data = " << *data); const double zoom = djvMath::pow(2, _p->zoom); djvVector2i pick = djvVectorUtil::floor<double, int>( djvVector2f(_p->pick - viewWidget()->viewPos()) * zoom - djvVector2f(tmp.info().size) / 2.0); //DJV_DEBUG_PRINT("zoom = " << zoom); //DJV_DEBUG_PRINT("pick = " << pick); try { viewWidget()->makeCurrent(); if (! _p->magnifyBuffer || _p->magnifyBuffer->info() != tmp.info()) { _p->magnifyBuffer.reset(new djvOpenGlOffscreenBuffer(tmp.info())); } djvOpenGlImageOptions options = viewWidget()->options(); options.xform.position -= pick; options.xform.scale *= zoom * viewWidget()->viewZoom(); if (! _p->colorProfile) { options.colorProfile = djvColorProfile(); } if (! _p->displayProfile) { options.displayProfile = djvViewDisplayProfile(); } djvOpenGlImage::copy( *data, tmp, options, &_p->magnifyState, _p->magnifyBuffer.data()); _p->widget->setPixmap( djvPixmapUtil::toQt( tmp, djvOpenGlImageOptions(), &_p->convertState, _p->convertBuffer.data())); } catch (djvError error) { error.add( djvViewUtil::errorLabels()[djvViewUtil::ERROR_MAGNIFY]); context()->printError(error); } } //_p->widget->setPixelData(tmp); _p->pixelDataInit = false; }