/// /// \brief The Storage class класс области содержащей изображение /// Storage::Storage(QWidget *parent) : QLabel(parent) { arrow_size_ = 20; // view_labels_ = 1; // view_current_l_ = 0; // set_label_width_ = 0; repaint_needed_ = 0; // confirm_nothing_tools_ = 1; // change_ = 0; // change_ID_= -1 ; tool_ = NoTool; state_ = StandBy; keyboard_modifier_ = Qt::NoModifier; // focused_selection_ = -1; // focused_label_ID_selection_ = -1; // focused_selection_type_ = NoFigure; // hovered_point_.figure = NoFigure; // hovered_point_.figureID = -1; // hovered_point_.pointID = -1; // selected_point_ = -1; // list_bounding_box_ = 0; // point_radius_ = 6; scale_=1; setScaledContents(true); setMouseTracking(true); setScaledContents(true); // можно масштабировать контенд scale_ = 1; // переменная, хранящая масштаб }
ImageViewer::ImageViewer(QWidget* parent) : QLabel(parent) { setBackgroundRole(QPalette::Base); setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); setScaledContents(true); }
JulyUrl::JulyUrl(QWidget *parent, int x, int y, int w, int h, QString link) : QLabel(parent) { startRect=QRect(x,y,w,h); setGeometry(startRect); zoomTimer = new QTimer(this); connect(zoomTimer,SIGNAL(timeout()),this,SLOT(zoom())); udNormalFont=0; isAnimating=false; add=2; text=link;; QFont font; font.setFamily("Arial"); font.setPixelSize(46); font.setStretch(60); double textWidth=QFontMetrics(font).width(link); pixmap1 = QPixmap(400,100); pixmap1.fill(Qt::transparent); QPainter painter(&pixmap1); painter.setPen(Qt::blue); painter.setFont(font); painter.drawText(QRectF(0,0,400,100),Qt::AlignCenter,text); pixmap2=pixmap1; QPixmap line(textWidth,4); line.fill(Qt::blue); painter.drawPixmap((400-textWidth)/2,84,line); setPixmap(pixmap1); notPressing=true; setScaledContents(true); }
LapUSMouse::LapUSMouse(mtsIntuitiveDaVinci *daVinci ,QWidget* mainWidget) { // this->parent = parent; this->daVinci = daVinci; this->mainWidget = mainWidget; setAutoFillBackground(true); setScaledContents(true); resize(50,50); setText("I am a mouse"); //setPixmap(Qt::red); setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); setupDaVinci(); //update the first time updateDaVinci(); QDesktopWidget *desk = QApplication::desktop(); if(desk) screenSize = desk->screenGeometry(0); std::cout<<"Screen size width "<<screenSize.width()<<std::endl; std::cout<<"Screen size height "<<screenSize.height()<<std::endl; // connect with the timer to update the mouse position every 50 milliseconds connect( &timer, SIGNAL(timeout()), this, SLOT(updateMouse()) ); timer.start( 100 ); }
CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i ) : QLabel( parent ), p_intf( _p_i ), p_item( NULL ) { setContextMenuPolicy( Qt::ActionsContextMenu ); CONNECT( THEMIM->getIM(), artChanged( input_item_t * ), this, showArtUpdate( input_item_t * ) ); setMinimumHeight( 128 ); setMinimumWidth( 128 ); setScaledContents( false ); setAlignment( Qt::AlignCenter ); QAction *action = new QAction( qtr( "Download cover art" ), this ); CONNECT( action, triggered(), this, askForUpdate() ); addAction( action ); action = new QAction( qtr( "Add cover art from file" ), this ); CONNECT( action, triggered(), this, setArtFromFile() ); addAction( action ); p_item = THEMIM->currentInputItem(); if( p_item ) showArtUpdate( p_item ); else showArtUpdate( "" ); }
KCMessageBoxPanel::KCMessageBoxPanel(QWidget *parent) : QLabel(parent) { //Set properties setFixedHeight(66); setScaledContents(true); setPixmap(QPixmap(":/MsgBox/image/MessageBox/Bottom.png")); setMinimumWidth(0); panelLayout=new QHBoxLayout(this); panelLayout->setContentsMargins(0,0,0,0); panelLayout->setSpacing(50); setLayout(panelLayout); panelLayout->addStretch(); buttonMapper=new QSignalMapper(this); okButton=new KCGraphicButtonOK(this); panelLayout->addWidget(okButton); connect(okButton, SIGNAL(clicked()), buttonMapper, SLOT(map())); buttonMapper->setMapping(okButton, 1); connect(okButton, SIGNAL(clicked()), this, SIGNAL(requiredExit())); cancelButton=new KCGraphicButtonCancel(this); panelLayout->addWidget(cancelButton); cancelButton->hide(); connect(cancelButton, SIGNAL(clicked()), buttonMapper, SLOT(map())); buttonMapper->setMapping(cancelButton, 2); connect(cancelButton, SIGNAL(clicked()), this, SIGNAL(requiredExit())); panelLayout->addStretch(); connect(buttonMapper, SIGNAL(mapped(int)), this, SLOT(sendSignals(int))); }
/* normalize label */ void KbfxPixmapLabel::normalize () { setFrameShape ( QLabel::NoFrame ); setFrameShadow ( QLabel::Plain ); setScaledContents ( FALSE ); setAlignment ( int ( QLabel::WordBreak | QLabel::AlignCenter ) ); }
PicturePopup::PicturePopup(QWidget *parent) : QLabel(parent, Qt::Popup) , m_lTimeToShow(0) , m_lTimeToLive(0) , m_lTimeToHide(0) , m_lDelayBetweenShowEvents(0) , m_lDelayBetweenHideEvents(0) , m_nStartPosX(0) , m_nStartPosY(0) , m_nCurrentPosX(0) , m_nCurrentPosY(0) , m_nTaskbarPlacement(0) , m_nIncrement(7) , m_strCaption("") , m_nAnimStatus(IDT_HIDDEN) , m_nTaskbarHeight(0) { ui.setupUi(this); setFrameStyle( WinPanel | Raised ); setAlignment( Qt::AlignCenter ); setScaledContents(true); m_pTimerAppear = new QTimer(this); connect(m_pTimerAppear, SIGNAL(timeout()), this, SLOT(OnTimerAppear())); m_pTimerDisappear = new QTimer(this); connect(m_pTimerDisappear, SIGNAL(timeout()), this, SLOT(OnTimerDisappear())); m_pTimerWait = new QTimer(this); connect(m_pTimerWait, SIGNAL(timeout()), this, SLOT(OnTimerWait())); }
//! A constructor initializing some variables ImageHolder::ImageHolder(QWidget *aParent) : QLabel(aParent) { repaint_needed_ = 0; tool_ = NoTool; state_ = StandBy; keyboard_modifier_ = Qt::NoModifier; focused_selection_ = -1; focused_selection_type_ = NoFigure; hovered_point_.figure = NoFigure; hovered_point_.figureID = -1; hovered_point_.pointID = -1; selected_point_ = -1; list_bounding_box_ = 0; main_label_ = 0; //list_bounding_box_ = new QList< QRect >; scale_ = 1; point_radius_ = 6; setScaledContents(true); setMouseTracking(true); }
KCMessageBoxTitle::KCMessageBoxTitle(QWidget *parent) : QLabel(parent) { //Set properties setContentsMargins(0,0,0,0); setFixedHeight(60); setScaledContents(true); setPixmap(QPixmap(":/MsgBox/image/MessageBox/Title.png")); setMinimumWidth(0); //Set font QFont titleFont; titleFont.setFamily("sao"); titleFont.setPixelSize(20); //Set widgets titleCaption=new QLabel(this); titleCaption->setFont(titleFont); titleCaption->setAlignment(Qt::AlignHCenter); titleCaption->resize(width(), titleCaption->height()); titleCaption->setGeometry(0, (height()-titleCaption->height())/2, width(), height()); setTitleText(QApplication::applicationName()); hasPressed=false; }
ClickableLabel::ClickableLabel(QWidget * parent, Qt::WindowFlags f) : QLabel(parent,f) { initialized = false; setMouseTracking(true); setScaledContents(true); }
VideoQLabel::VideoQLabel(QWidget *parent) : QLabel(parent) { activeClick = false; connect(this,SIGNAL(updateGuiSignal()),this,SLOT(updateGuiSlot())); setScaledContents(true); setMouseTracking(true); }
//BEGIN class BGMonitor BGMonitor::BGMonitor(QWidget *parent, const char *name) : QLabel(parent, name) { setAlignment(AlignCenter); setScaledContents(true); setAcceptDrops(true); }
CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i ) : QLabel( parent ), p_intf( _p_i ) { setContextMenuPolicy( Qt::ActionsContextMenu ); CONNECT( this, updateRequested(), this, askForUpdate() ); setMinimumHeight( 128 ); setMinimumWidth( 128 ); setMaximumHeight( 128 ); setScaledContents( false ); setAlignment( Qt::AlignCenter ); QList< QAction* > artActions = actions(); QAction *action = new QAction( qtr( "Download cover art" ), this ); CONNECT( action, triggered(), this, askForUpdate() ); addAction( action ); input_item_t *p_item = THEMIM->currentInputItem(); if( p_item ) { showArtUpdate( THEMIM->getIM()->decodeArtURL( p_item ) ); } else showArtUpdate( "" ); }
int QLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QFrame::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 12) qt_static_metacall(this, _c, _id, _a); _id -= 12; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = text(); break; case 1: *reinterpret_cast< Qt::TextFormat*>(_v) = textFormat(); break; case 2: _a[0] = const_cast<void*>(reinterpret_cast<const void*>(pixmap())); break; case 3: *reinterpret_cast< bool*>(_v) = hasScaledContents(); break; case 4: *reinterpret_cast< Qt::Alignment*>(_v) = alignment(); break; case 5: *reinterpret_cast< bool*>(_v) = wordWrap(); break; case 6: *reinterpret_cast< int*>(_v) = margin(); break; case 7: *reinterpret_cast< int*>(_v) = indent(); break; case 8: *reinterpret_cast< bool*>(_v) = openExternalLinks(); break; case 9: *reinterpret_cast< Qt::TextInteractionFlags*>(_v) = textInteractionFlags(); break; case 10: *reinterpret_cast< bool*>(_v) = hasSelectedText(); break; case 11: *reinterpret_cast< QString*>(_v) = selectedText(); break; } _id -= 12; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setText(*reinterpret_cast< QString*>(_v)); break; case 1: setTextFormat(*reinterpret_cast< Qt::TextFormat*>(_v)); break; case 2: setPixmap(*reinterpret_cast< QPixmap*>(_v)); break; case 3: setScaledContents(*reinterpret_cast< bool*>(_v)); break; case 4: setAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break; case 5: setWordWrap(*reinterpret_cast< bool*>(_v)); break; case 6: setMargin(*reinterpret_cast< int*>(_v)); break; case 7: setIndent(*reinterpret_cast< int*>(_v)); break; case 8: setOpenExternalLinks(*reinterpret_cast< bool*>(_v)); break; case 9: setTextInteractionFlags(*reinterpret_cast< Qt::TextInteractionFlags*>(_v)); break; } _id -= 12; } else if (_c == QMetaObject::ResetProperty) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 12; } #endif // QT_NO_PROPERTIES return _id; }
Label::Label(QWidget* parent) : QLabel(parent) , m_mousePosition(0) { setMouseTracking(true); setAlignment(Qt::AlignCenter); setScaledContents(true); }
/* Der Muelleimer */ TrashBin::TrashBin(QWidget * parent) : QLabel(parent) { Normal = loadIcon("trashcan.png"); Offen = loadIcon("trashcan2.png"); setPixmap(Normal); setScaledContents(false); setAcceptDrops(true); }
ToolBarColorBox::ToolBarColorBox(QWidget *parent) : QLabel(parent) { m_copyHexColor = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")), tr("Copy Color"), this); connect(m_copyHexColor, SIGNAL(triggered()), SLOT(copyColorToClipboard())); setScaledContents(false); }
PreviewImageLabel::PreviewImageLabel(QWidget *parent) : QLabel(parent) { setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); setAlignment(Qt::AlignCenter); setAcceptDrops(true); setAutoFillBackground(true); setMaximumSize(256, 256); setScaledContents(true); }
NCoverWidget::NCoverWidget(QWidget *parent) : QLabel(parent) { m_coverReader = dynamic_cast<NCoverReaderInterface *>(NPluginLoader::getPlugin(N::CoverReader)); m_popup = NULL; hide(); setScaledContents(true); }
/* Der Muelleimer */ TrashBin::TrashBin(QWidget * parent) : QLabel(parent) { Normal = IconManager::instance()->loadPixmap("trashcan.png"); Offen = IconManager::instance()->loadPixmap("trashcan2.png"); setPixmap(Normal); setScaledContents(false); setAcceptDrops(true); }
SimplePreviewLabel::SimplePreviewLabel(int index, QWidget *parent): QLabel(parent), m_index(index), m_selected(false) { setScaledContents(true); setMinimumSize(130, 100); setMaximumSize(130, 100); }
FDialogPreview::FDialogPreview(QWidget *pa) : QLabel(pa) { setAlignment(Qt::AlignLeft | Qt::AlignTop); setFixedSize( QSize( 200, 200 ) ); setScaledContents( false ); setFrameShape( QLabel::WinPanel ); setFrameShadow( QLabel::Sunken ); updtPix(); }
//BEGIN class BGMonitorLabel BGMonitorLabel::BGMonitorLabel(QWidget *parent, const char *name) : QLabel(parent, name) { setAlignment(AlignCenter); setScaledContents(true); setPixmap( QPixmap( locate("data", "kcontrol/pics/monitor.png") ) ); m_pBGMonitor = new BGMonitor(this); QWhatsThis::add( this, i18n("This picture of a monitor contains a preview of what the current settings will look like on your desktop.") ); }
PHIPixLabel::PHIPixLabel( QWidget *parent ) : QLabel( parent ) { setWordWrap( false ); setScaledContents( true ); setAutoFillBackground( true ); //QPalette p=palette(); //p.setColor( QPalette::Window, Qt::transparent ); //setPalette( p ); }
void QUpdateLabel::init() { m_updating = false; m_count = 0; m_updateBarColor = QColor(0x1C, 0xA4, 0xFF); setFocusPolicy(Qt::NoFocus); setScaledContents(true); }
FullscreenHypnotoad::FullscreenHypnotoad() : movie_(new QMovie(":/hypnotoad.gif")) { setMovie(movie_); setScaledContents(true); // White background QPalette p(palette()); p.setColor(QPalette::Window, Qt::white); setPalette(p); }
TrayIcon::TrayIcon(QWidget *parent) : KSystemTray(parent), updateCount(0), appletState(APPLET_NO_UPDATES) { KIconLoader iconLoader(PROGRAM_NAME); setPixmap(loadIcon(TRAY_ICON_GREEN)); setScaledContents(true); setState(APPLET_NO_UPDATES); kdDebug() << "Tray Icon ready" << endl; }
ToolBarColorBox::ToolBarColorBox(QWidget *parent) : QLabel(parent) { m_color = Qt::white; m_borderColorOuter = Qt::white; m_borderColorInner = QColor(143, 143 ,143); m_copyHexColorAction = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-small-hicontrast.png")), tr("Copy Color"), this); connect(m_copyHexColorAction, SIGNAL(triggered()), SLOT(copyColorToClipboard())); setScaledContents(false); }
void imageViewer::init(thumbType tp) { setScaledContents(false); setAlignment(Qt::AlignCenter); setAutoFillBackground(true); slotBGColorChanged(); addToLog(QString("image creation %1").arg(tp),LOGIMAG); setType(tp); setPixmap(QPixmap()); clear(); }