当前位置: 首页>>代码示例>>C++>>正文


C++ setMouseTracking函数代码示例

本文整理汇总了C++中setMouseTracking函数的典型用法代码示例。如果您正苦于以下问题:C++ setMouseTracking函数的具体用法?C++ setMouseTracking怎么用?C++ setMouseTracking使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setMouseTracking函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QGLWidget

GLWidget::GLWidget(QWidget *parent) :
QGLWidget(parent), cc_(CamerasContainer::getInstance())
{
	setMouseTracking(false);
}
开发者ID:zprts,项目名称:simulator,代码行数:5,代码来源:glwidget.cpp

示例2: setFocusPolicy

void DkControlWidget::init() {

	// debug: show invisible widgets
	setFocusPolicy(Qt::StrongFocus);
	setFocus(Qt::TabFocusReason);
	setMouseTracking(true);

	// connect widgets with their settings
	mFilePreview->setDisplaySettings(&Settings::param().app().showFilePreview);
	mMetaDataInfo->setDisplaySettings(&Settings::param().app().showMetaData);
	mFileInfoLabel->setDisplaySettings(&Settings::param().app().showFileInfoLabel);
	mPlayer->setDisplaySettings(&Settings::param().app().showPlayer);
	mHistogram->setDisplaySettings(&Settings::param().app().showHistogram);
	mCommentWidget->setDisplaySettings(&Settings::param().app().showComment);
	mZoomWidget->setDisplaySettings(&Settings::param().app().showOverview);
	mFolderScroll->setDisplaySettings(&Settings::param().app().showScroller);

	// some adjustments
	mBottomLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	mBottomLeftLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	mRatingLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	mZoomWidget->setContentsMargins(10, 10, 0, 0);
	mCropWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
	mCommentWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);

	// register actions
	DkActionManager& am = DkActionManager::instance();
	mFilePreview->registerAction(am.action(DkActionManager::menu_panel_preview));
	mMetaDataInfo->registerAction(am.action(DkActionManager::menu_panel_exif));
	mPlayer->registerAction(am.action(DkActionManager::menu_panel_player));
	mCropWidget->registerAction(am.action(DkActionManager::menu_edit_crop));
	mFileInfoLabel->registerAction(am.action(DkActionManager::menu_panel_info));
	mHistogram->registerAction(am.action(DkActionManager::menu_panel_histogram));
	mCommentWidget->registerAction(am.action(DkActionManager::menu_panel_comment));
	mFolderScroll->registerAction(am.action(DkActionManager::menu_panel_scroller));

	// dummy - needed for three equal columns @markus: do not delete!
	QWidget* dw = new QWidget(this);
	dw->setMouseTracking(true);
	QBoxLayout* dLayout = new QBoxLayout(QBoxLayout::LeftToRight, dw);
	dLayout->setContentsMargins(0,0,0,0);
	dLayout->addWidget(mBottomLabel);
	dLayout->addStretch();

	// zoom widget
	QWidget* bw = new QWidget(this);
	bw->setMouseTracking(true);
	//bw->setMinimumHeight(40);
	//bw->setMaximumHeight(80);
	QVBoxLayout* zLayout = new QVBoxLayout(bw);
	zLayout->setAlignment(Qt::AlignBottom);
	zLayout->setContentsMargins(0,0,0,20);
	zLayout->setSpacing(0);
	zLayout->addWidget(mBottomLabel);
	zLayout->addWidget(mBottomLeftLabel);
	zLayout->addWidget(mCommentWidget);

	// left column widget
	QWidget* leftWidget = new QWidget(this);
	leftWidget->setMouseTracking(true);
	QBoxLayout* ulLayout = new QBoxLayout(QBoxLayout::TopToBottom, leftWidget);
	ulLayout->setContentsMargins(0,0,0,0);
	ulLayout->setSpacing(0);
	ulLayout->addWidget(mZoomWidget);
	ulLayout->addStretch();
	ulLayout->addWidget(bw);
	ulLayout->addWidget(dw);

	// center column
	QWidget* center = new QWidget(this);
	center->setMouseTracking(true);
	QVBoxLayout* cLayout = new QVBoxLayout(center);
	cLayout->setContentsMargins(0,0,0,0);
	cLayout->setAlignment(Qt::AlignBottom);
	cLayout->addWidget(mPlayer);
	
	// rating widget
	QWidget* rw = new QWidget(this);
	rw->setMouseTracking(true);
	rw->setMinimumSize(0,0);
	QBoxLayout* rLayout = new QBoxLayout(QBoxLayout::RightToLeft, rw);
	rLayout->setContentsMargins(0,0,0,17);
	rLayout->addWidget(mRatingLabel);
	rLayout->addStretch();

	// file info
	QWidget* fw = new QWidget(this);
	fw->setContentsMargins(0,0,0,30);
	fw->setMouseTracking(true);
	fw->setMinimumSize(0,0);
	QBoxLayout* rwLayout = new QBoxLayout(QBoxLayout::RightToLeft, fw);
	rwLayout->setContentsMargins(0,0,0,0);
	rwLayout->addWidget(mFileInfoLabel);
	rwLayout->addStretch();

	// right column
	QWidget* hw = new QWidget(this);
	hw->setContentsMargins(0,10,10,0);
	hw->setMouseTracking(true);
	QBoxLayout* hwLayout = new QBoxLayout(QBoxLayout::RightToLeft, hw);
//.........这里部分代码省略.........
开发者ID:nholmgaard,项目名称:nomacs,代码行数:101,代码来源:DkControlWidget.cpp

示例3: setMouseTracking

	M11TabBar::M11TabBar(M11TabWidget *parent)
		: ::QTabBar((QWidget *)parent)
	{
		setMouseTracking(true);
	}
开发者ID:AlekSi,项目名称:Jabbin,代码行数:5,代码来源:m11tabbar.cpp

示例4: QWidget

DisplayOptionsWidget::DisplayOptionsWidget(QWidget *parent)
	: QWidget(parent)
	, set(Settings::instance())
	, m_serverMode(set->getCurrentServerMode())
	, m_hwInterface(set->getHWInterface())
	, m_dataEngineState(set->getDataEngineState())
	, m_antialiased(true)
	, m_mouseOver(false)
	, m_minimumWidgetWidth(set->getMinimumWidgetWidth())
	, m_minimumGroupBoxWidth(set->getMinimumGroupBoxWidth())
	, m_btnSpacing(5)
	, m_currentReceiver(set->getCurrentReceiver())
	, m_btnChooserHit(0)
	, m_framesPerSecond(set->getFramesPerSecond(m_currentReceiver))
	, m_sampleRate(set->getSampleRate())
	, m_sMeterHoldTime(set->getSMeterHoldTime())
{
	//setMinimumWidth(m_minimumWidgetWidth);
	setContentsMargins(4, 0, 4, 0);
	setMouseTracking(true);

	m_rxDataList = set->getReceiverDataList();
	m_widebandOptions = set->getWidebandOptions();
	m_panadapterMode = set->getPanadapterMode(m_currentReceiver);
	m_waterColorMode = set->getWaterfallColorMode(m_currentReceiver);
	
	fonts = new CFonts(this);
	m_fonts = fonts->getFonts();

	createFPSGroupBox();
	createPanSpectrumOptions();
	createWidebandPanOptions();
	createWaterfallSpectrumOptions();
	createSMeterOptions();
	createCallSignEditor();

	QBoxLayout *mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this);
	mainLayout->setSpacing(5);
	mainLayout->setMargin(0);
	mainLayout->addSpacing(8);

	QHBoxLayout *hbox1 = new QHBoxLayout;
	hbox1->setSpacing(0);
	hbox1->setMargin(0);
	hbox1->addStretch();
	hbox1->addWidget(m_fpsGroupBox);

	QHBoxLayout *hbox2 = new QHBoxLayout;
	hbox2->setSpacing(0);
	hbox2->setMargin(0);
	hbox2->addStretch();
	hbox2->addWidget(m_panSpectrumOptions);

	QHBoxLayout *hbox3 = new QHBoxLayout;
	hbox3->setSpacing(0);
	hbox3->setMargin(0);
	hbox3->addStretch();
	hbox3->addWidget(m_widebandPanOptions);
	
	QHBoxLayout *hbox4 = new QHBoxLayout;
	hbox4->setSpacing(0);
	hbox4->setMargin(0);
	hbox4->addStretch();
	hbox4->addWidget(m_waterfallSpectrumOptions);

	QHBoxLayout *hbox5 = new QHBoxLayout;
	hbox5->setSpacing(0);
	hbox5->setMargin(0);
	hbox5->addStretch();
	hbox5->addWidget(m_sMeterOptions);

	QHBoxLayout *hbox6 = new QHBoxLayout;
	hbox6->setSpacing(0);
	hbox6->setMargin(0);
	hbox6->addStretch();
	hbox6->addWidget(m_callSignEditor);
	hbox6->addStretch();

	mainLayout->addLayout(hbox1);
	mainLayout->addLayout(hbox2);
	mainLayout->addLayout(hbox3);
	mainLayout->addLayout(hbox4);
	mainLayout->addLayout(hbox5);
	mainLayout->addLayout(hbox6);
	mainLayout->addStretch();
	setLayout(mainLayout);

	setupConnections();
}
开发者ID:amontefusco,项目名称:cudaSDR,代码行数:89,代码来源:cusdr_displayWidget.cpp

示例5: QAbstractSlider

NavigationSlider::NavigationSlider(QWidget *parent) :
    QAbstractSlider( parent ),
    m_handleImagePath( "marble/navigation/navigational_slider_handle" )
{
    setMouseTracking( true );
}
开发者ID:AsherBond,项目名称:marble,代码行数:6,代码来源:NavigationSlider.cpp

示例6: if

GNSSView::GNSSView(QStringList & args)
{
	fullScreen=true;
	
	for (int i=1;i<args.size();i++){ // skip the first
		if (args.at(i) == "--nofullscreen")
			fullScreen=false;
		else if (args.at(i) == "--help"){
			std::cout << "gnssview " << std::endl;
			std::cout << "Usage: gnssview [options]" << std::endl;
			std::cout << std::endl;
			std::cout << "--help         print this help" << std::endl;
			std::cout << "--license      print this help" << std::endl;
			std::cout << "--nofullscreen run in a window" << std::endl;
			std::cout << "--version      display version" << std::endl;
			
			exit(EXIT_SUCCESS);
		}
		else if (args.at(i) == "--license"){
			std::cout << " gnssview - a program for displaying GNSS satellite paths" << std::endl;
			std::cout <<  std::endl;
			std::cout << " The MIT License (MIT)" << std::endl;
			std::cout <<  std::endl;
			std::cout << " Copyright (c)  2014  Michael J. Wouters" << std::endl;
			std::cout <<  std::endl; 
			std::cout << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl;
			std::cout << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl;
			std::cout << " in the Software without restriction, including without limitation the rights" << std::endl;
			std::cout << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl;
			std::cout << " copies of the Software, and to permit persons to whom the Software is" << std::endl;
			std::cout << " furnished to do so, subject to the following conditions:" << std::endl;
			std::cout << std::endl; 
			std::cout << " The above copyright notice and this permission notice shall be included in" << std::endl;
			std::cout << " all copies or substantial portions of the Software." << std::endl;
			std::cout << std::endl;
			std::cout << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl;
			std::cout << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl;
			std::cout << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl;
			std::cout << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl;
			std::cout << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl;
			std::cout << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN" << std::endl;
			std::cout << " THE SOFTWARE." << std::endl;
			
			exit(EXIT_SUCCESS);
		}
		else if (args.at(i) == "--version"){
			std::cout << "gnssview " << VERSION_INFO << std::endl;
			std::cout << std::endl;
			std::cout << "This ain't no stinkin' Perl script!" << std::endl;
			
			exit(EXIT_SUCCESS);
		}
		else{
			std::cout << "gnssview: Unknown option '"<< args.at(i).toStdString() << "'" << std::endl;
			std::cout << "gnssview: Use --help to get a list of available command line options"<< std::endl;
			
			exit(EXIT_SUCCESS);
		}
	}
	
	setWindowTitle(tr("gnssview"));
	setMinimumSize(QSize(1920,1080));
	if (fullScreen)
		setWindowState(windowState() ^ Qt::WindowFullScreen);
	
	setMouseTracking(true); // so that mouse movements wake up the display
	QCursor curs;
	curs.setShape(Qt::BlankCursor);
	setCursor(curs);
	cursor().setPos(0,0);
	
	QTime on(7,0,0);
	QTime off(19,0,0);
	
	powerManager=new PowerManager(on,off);
	powerManager->enable(false);
	
	latitude=-33.87;
	longitude=151.21;
	address="";
	port=-1;
	
	// Note: readConfig needs 'view'
	QVBoxLayout * vb = new QVBoxLayout(this);
	vb->setContentsMargins(0,0,0,0);
	view = new GNSSViewWidget(NULL,&birds);
	vb->addWidget(view);
	
	QString config = app->locateResource("gnssview.xml");
	
	if (!config.isNull())
		readConfig(config);
	
	view->setLocation(latitude,longitude);
	
	createActions();
	setContextMenuPolicy(Qt::CustomContextMenu);
	connect(this,SIGNAL(customContextMenuRequested ( const QPoint & )),this,SLOT(createContextMenu(const QPoint &)));

	udpSocket = new QUdpSocket(this);
//.........这里部分代码省略.........
开发者ID:idaohang,项目名称:gnssview,代码行数:101,代码来源:GNSSView.cpp

示例7: setFixedSize

helpDialog::helpDialog(const QString &path, const QString &page, QWidget *parent)
{
    this->setWindowFlags( Qt::WindowStaysOnTopHint | Qt::SubWindow);
    this ->setWindowIcon(QIcon(":images/icon.png"));//:images/icon.png
    setFixedSize(565,540);
    setFocus();
    setAttribute(Qt::WA_DeleteOnClose);
    setAttribute(Qt::WA_GroupLeader);
    textBrowser=new QTextBrowser;
    textBrowser->setOpenLinks(true);

    homeButton=new QToolButton();
    QPixmap homeButtonpix(":/images/home.png");
    homeButton->setIcon(homeButtonpix);
    homeButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    homeButton->setIconSize(homeButtonpix.size());
    homeButton->setText(" 首  页 ");
    homeButton->setShortcut(tr("Home"));


    upSection=new QToolButton();
    QPixmap upSectionpix(":/images/up.png");
    upSection->setIcon(upSectionpix);
    upSection->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    upSection->setIconSize(upSectionpix.size());
    upSection->setText("上一节");
    upSection->setToolTip("已经是首页了◕‿◕");
    upSection->setShortcut(tr("Left"));

    downSection=new QToolButton();
    QPixmap downSectionpix(":/images/down.png");
    downSection->setIcon(downSectionpix);
    downSection->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    downSection->setIconSize(downSectionpix.size());
    downSection->setText("下一节");
    downSection->setShortcut(tr("Right"));

    //backButton=new QToolButton(tr("&Back"));
    closeButton=new QToolButton();
    QPixmap closeButtonpix(":/images/out.png");
    closeButton->setIcon(closeButtonpix);
    closeButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    closeButton->setIconSize(closeButtonpix.size());
    closeButton->setText(" 退  出 ");
    closeButton->setShortcut(tr("Esc"));

    QHBoxLayout *buttonlayout=new QHBoxLayout;
    buttonlayout->addWidget(homeButton);
    buttonlayout->addWidget(upSection);
    buttonlayout->addWidget(downSection);

    //buttonlayout->addStretch();
    buttonlayout->addWidget(closeButton);
    buttonlayout->setSpacing(70);
    QVBoxLayout *mainLayout =new QVBoxLayout;
    mainLayout->addLayout(buttonlayout);
    mainLayout->addWidget(textBrowser);
    setLayout(mainLayout);

    connect(homeButton,SIGNAL(clicked()),textBrowser,SLOT(home()));
    //connect(backButton,SIGNAL(clicked()),textBrowser,SLOT(backward()));
    connect(closeButton,SIGNAL(clicked()),this,SLOT(close()));

    connect(upSection,SIGNAL(clicked()),this,SLOT(forwardSection()));
    connect(downSection,SIGNAL(clicked()),this,SLOT(backwardSection()));
    connect(textBrowser,SIGNAL(sourceChanged(const QUrl &)),this,SLOT(updateWindowTitle()));
    textBrowser->setSearchPaths(QStringList()<< path <<":/images");
    textBrowser->setSource(page);
    setMouseTracking(true);
}
开发者ID:alex159s,项目名称:fangdeQC,代码行数:70,代码来源:helpDialog.cpp

示例8: setMouseTracking

void CountryInput::leaveEvent(QEvent *e) {
	setMouseTracking(false);
	_active = false;
	setCursor(style::cur_default);
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:5,代码来源:countryinput.cpp

示例9: QMessageBoxResize

 QMessageBoxResize(QWidget *parent = 0) : QMessageBox(parent) {
   setMouseTracking(true);
   setSizeGripEnabled(true);
 }
开发者ID:iraytrace,项目名称:qtcreatorProto,代码行数:4,代码来源:VSLapp.cpp

示例10: Q_INIT_RESOURCE

//=============================================================================
sstQt01PathPaintWidgetCls::sstQt01PathPaintWidgetCls(sstMisc01PrtFilCls      *poTmpPrt,
                                                     sstQt01PathStoreViewCls *poTmpPathStorage)
{

  Q_INIT_RESOURCE(tooltips);

  if (poTmpPathStorage == NULL) assert (0);
  if (poTmpPathStorage->countItems() <= 0) assert(0);

  this->oPathStorage = poTmpPathStorage;
  this->poPrt = poTmpPrt;

  setMouseTracking(true);
    setBackgroundRole(QPalette::Base);

    newCircleButton = createToolButton(tr("New Circle"),
                                       QIcon(":/images/circle.png"),
                                       SLOT(createNewCircle()));

    newSquareButton = createToolButton(tr("New Square"),
                                       QIcon(":/images/square.png"),
                                       SLOT(createNewSquare()));

    newTriangleButton = createToolButton(tr("New Triangle"),
                                         QIcon(":/images/triangle.png"),
                                         SLOT(createNewTriangle()));

    newLineButton = createToolButton(tr("New Line"),
                                         QIcon(":/images/line.png"),
                                         SLOT(createNewLine()));

    newPolyLineButton = createToolButton(tr("New PolyLine"),
                                         QIcon(":/images/polyline.png"),
                                         SLOT(createNewPolyLine()));

    newArcButton = createToolButton(tr("New Arc"),
                                         QIcon(":/images/arc.png"),
                                         SLOT(createNewArc()));

    newTextButton = createToolButton(tr("New Text"),
                                         QIcon(":/images/text.png"),
                                         SLOT(createNewText()));

    //=============================================================================
    // Create item templates
    circlePath.addEllipse(QRect(0, 0, 100, 100));
    squarePath.addRect(QRect(0, 0, 100, 100));

    qreal x = trianglePath.currentPosition().x();
    qreal y = trianglePath.currentPosition().y();
    trianglePath.moveTo(x + 120 / 2, y);
    trianglePath.lineTo(0, 100);
    trianglePath.lineTo(120, 100);
    trianglePath.lineTo(x + 120 / 2, y);

    linePath.moveTo( 0, 0);
    linePath.lineTo(100, 100);

    polylinePath.moveTo( 0, 0);
    polylinePath.lineTo(25, 75);
    polylinePath.lineTo(100, 100);

    // arcPath.moveTo( 150, 150);
    QRect oRect(100,100,200,200);
    arcPath.arcMoveTo(oRect,0);
    arcPath.arcTo(oRect,0,45);

    QFont oFont;
    oFont.setPointSize(50);
    // oFont.s
    QString oQStr = "A";
    textPath.moveTo( 0, 0);
    textPath.addText(50,50,oFont,oQStr);
    //=============================================================================

    setWindowTitle(tr("Tool Tips"));
    this->setMinimumSize(350,350);  // Get Size for 7 Buttons

    iActualItemIndex = 0;
    iItemInMotionIndex = 0;

}
开发者ID:UliRehr15,项目名称:sstQt01Lib,代码行数:83,代码来源:sstQt01PathPaintWidget.cpp

示例11: onProjectNameChanged

void
Gui::setupUi()
{
    onProjectNameChanged(QString(), false);

    setMouseTracking(true);
    installEventFilter(this);
    assert( !isFullScreen() );

    //Gui::loadStyleSheet();

    ///Restores position, size of the main window as well as whether it was fullscreen or not.
    _imp->restoreGuiGeometry();


    _imp->_undoStacksGroup = new QUndoGroup;
    QObject::connect( _imp->_undoStacksGroup, SIGNAL(activeStackChanged(QUndoStack*)), this, SLOT(onCurrentUndoStackChanged(QUndoStack*)) );

    createMenuActions();

    /*CENTRAL AREA*/
    //======================
    _imp->_centralWidget = new QWidget(this);
    setCentralWidget(_imp->_centralWidget);
    _imp->_mainLayout = new QHBoxLayout(_imp->_centralWidget);
    _imp->_mainLayout->setContentsMargins(0, 0, 0, 0);
    _imp->_centralWidget->setLayout(_imp->_mainLayout);

    _imp->_leftRightSplitter = new Splitter(_imp->_centralWidget);
    _imp->_leftRightSplitter->setChildrenCollapsible(false);
    _imp->_leftRightSplitter->setObjectName(QString::fromUtf8(kMainSplitterObjectName));
    _imp->_splitters.push_back(_imp->_leftRightSplitter);
    _imp->_leftRightSplitter->setOrientation(Qt::Horizontal);
    _imp->_leftRightSplitter->setContentsMargins(0, 0, 0, 0);


    _imp->_toolBox = new AutoHideToolBar(this, _imp->_leftRightSplitter);
    _imp->_toolBox->setToolButtonStyle(Qt::ToolButtonIconOnly);
    _imp->_toolBox->setOrientation(Qt::Vertical);
    _imp->_toolBox->setMaximumWidth(TO_DPIX(NATRON_TOOL_BUTTON_SIZE));

    if (_imp->leftToolBarDisplayedOnHoverOnly) {
        _imp->refreshLeftToolBarVisibility( mapFromGlobal( QCursor::pos() ) );
    }

    _imp->_leftRightSplitter->addWidget(_imp->_toolBox);

    _imp->_mainLayout->addWidget(_imp->_leftRightSplitter);

    _imp->createNodeGraphGui();
    _imp->createCurveEditorGui();
    _imp->createDopeSheetGui();
    _imp->createScriptEditorGui();
    _imp->createProgressPanelGui();
    ///Must be absolutely called once _nodeGraphArea has been initialized.
    _imp->createPropertiesBinGui();

    createDefaultLayoutInternal(false);

    _imp->_projectGui = new ProjectGui(this);
    _imp->_projectGui->create(_imp->_appInstance->getProject(),
                              _imp->_layoutPropertiesBin,
                              this);

    initProjectGuiKnobs();


    setVisibleProjectSettingsPanel();

    _imp->_aboutWindow = new AboutWindow(this, this);
    _imp->_aboutWindow->hide();

    _imp->shortcutEditor = new ShortCutEditor(this);
    _imp->shortcutEditor->hide();


    //the same action also clears the ofx plugins caches, they are not the same cache but are used to the same end
    
    boost::shared_ptr<Project> project = _imp->_appInstance->getProject();
    QObject::connect( project.get(), SIGNAL(projectNameChanged(QString,bool)), this, SLOT(onProjectNameChanged(QString,bool)) );
    
    boost::shared_ptr<TimeLine> timeline = project->getTimeLine();
    QObject::connect( timeline.get(),SIGNAL(frameChanged(SequenceTime,int)), this,SLOT(renderViewersAndRefreshKnobsAfterTimelineTimeChange(SequenceTime,int)) );
    QObject::connect( timeline.get(),SIGNAL(frameAboutToChange()), this, SLOT(onTimelineTimeAboutToChange()));

    /*Searches recursively for all child objects of the given object,
       and connects matching signals from them to slots of object that follow the following form:

        void on_<object name>_<signal name>(<signal parameters>);

       Let's assume our object has a child object of type QPushButton with the object name button1.
       The slot to catch the button's clicked() signal would be:

       void on_button1_clicked();

       If object itself has a properly set object name, its own signals are also connected to its respective slots.
     */
    QMetaObject::connectSlotsByName(this);
    
    appPTR->setOFXHostHandle(_imp->_appInstance->getOfxHostOSHandle());
//.........这里部分代码省略.........
开发者ID:JamesLinus,项目名称:Natron,代码行数:101,代码来源:Gui05.cpp

示例12: BaseStyleWidget

LauncherWidget::LauncherWidget(QWidget *parent) :
BaseStyleWidget(parent)
{
	QLabel *m_Title = new QLabel();
	m_Title->setText("@launcher"); 

	this->setObjectName("launcher");

	//this->setStyleSheet("LauncherWidget { border-image:url('Webbox::Utility::PathUtil::GetCurrentExePath() + /Skin/img/abstract.jpg') 0 0 0 0 stretch stretch; border-radius: 0px;  margin:0px;}");

	QPalette palette;
	palette.setBrush(QPalette::Window, QBrush(QColor(255, 255, 255, 240)));// Qt::transparent));
	this->setPalette(palette);
	this->setAutoFillBackground(true);

	m_dockWidget = new DockWidget(this); 
	 
	//m_dockWidget.setupUi(this);
	setMouseTracking(true);

	connect(m_dockWidget, SIGNAL(IconClicked(int)), this, SLOT(__onItemClicked(int)));
 
	QString paths[] = { 
		"dota2.png" ,
		"messages.png",
		"safari.png",
		"ibooks.png",
		"launchpad.png",
		"maps.png",
		"facetime.png",
		"gamecenter.png"
	}; 

	m_dockWidget->AddIcon(QPixmap(Webbox::Config::AllCfg::getIconPath().append("dota2.png")), "Dota 2 CN");
	//m_dockWidget->AddIcon(QPixmap(Webbox::Utility::PathUtil::GetCurrentExePath() +"/Skin/img/vancl_round.png"), "VANCL");
	m_dockWidget->AddIcon(QPixmap(Webbox::Config::AllCfg::getIconPath().append("messages.png")), "iMessage");
	m_dockWidget->AddIcon(QPixmap(Webbox::Config::AllCfg::getIconPath().append("safari.png")), "Safari");
	m_dockWidget->AddIcon(QPixmap(Webbox::Config::AllCfg::getIconPath().append("ibooks.png")), "iBooks");
	m_dockWidget->AddIcon(QPixmap(Webbox::Config::AllCfg::getIconPath().append("launchpad.png")), "LaunchPad");
	m_dockWidget->AddIcon(QPixmap(Webbox::Config::AllCfg::getIconPath().append("maps.png")), "Maps");
	m_dockWidget->AddIcon(QPixmap(Webbox::Config::AllCfg::getIconPath().append("facetime.png")), "FaceTime");
	m_dockWidget->AddIcon(QPixmap(Webbox::Config::AllCfg::getIconPath().append("maps.png")), "Maps");
	m_dockWidget->AddIcon(QPixmap(Webbox::Config::AllCfg::getIconPath().append("gamecenter.png")), "Game Center");

	QGridLayout *grid_layout = new QGridLayout();
	grid_layout->setContentsMargins(0,0,0,0);
	grid_layout->setMargin(0); 
 
	//BoxDocument *doc = DocumentManager::get

	int idx = 0;

	for (int row = 0; row < 3; ++row)
	{
		for (int col = 0; col < 5; ++col)
		{
			if (idx < 8)
			{
				Webbox::Data::LaunchProperty *_property = new Webbox::Data::LaunchProperty();
				_property->icon_name = paths[idx++];
				_property->name_cn = "Sample App";
				grid_layout->addWidget(addToolButton(80, 80, _property), row, col, Qt::AlignCenter);
			}
			else
			{
				grid_layout->addWidget(new QWidget(), row, col, Qt::AlignCenter);
			}
		}
	}
		

	//int idx = 0;

	//for (int row = 0; row < 3; ++row) 
	//	for (int col = 0; col < 5; ++col)
	//	{ 
	//		if (idx < 8)
	//		{
	//			/*Webbox::Data::LaunchProperty *_property = new Webbox::Data::LaunchProperty();
	//			QFile file(paths[idx++]);
	//			file.open(QIODevice::ReadOnly);
	//			QByteArray blob = file.readAll();
	//			_property->setIcon(blob);
	//			_property->setNameCN("Sample App");*/
	//			grid_layout->addWidget(addToolButton(80, 80, _property), row, col, Qt::AlignCenter);
	//		} 
	//		else
	//		{
	//			grid_layout->addWidget(new QWidget(), row, col, Qt::AlignCenter); 
	//		}
	//	} 	
	 
	QVBoxLayout *main_layout = new QVBoxLayout(); 
	main_layout->setSpacing(0);
	main_layout->setContentsMargins(0, 0, 0, 0);
	main_layout->addLayout(grid_layout);
	main_layout->addWidget(m_dockWidget);

	this->setLayout(main_layout);
}
开发者ID:dreamxstudio,项目名称:webbox,代码行数:100,代码来源:LauncherWidget.cpp

示例13: QFrame

Frame::Frame( QWidget* parent_ ) :
   QFrame( parent_ ), mImage() {
   mColor = QColor( 255, 0, 0 );
   setMouseTracking( true );
}
开发者ID:JolinZh,项目名称:previewbox,代码行数:5,代码来源:frame.cpp

示例14: setAttribute

void VncView::updateImage(int x, int y, int w, int h)
{
//     kDebug(5011) << "got update" << width() << height();

    m_x = x;
    m_y = y;
    m_w = w;
    m_h = h;

    if (m_horizontalFactor != 1.0 || m_verticalFactor != 1.0) {
        // If the view is scaled, grow the update rectangle to avoid artifacts
        m_x-=1;
        m_y-=1;
        m_w+=2;
        m_h+=2;
    }

    m_frame = vncThread.image();

    if (!m_initDone) {
        setAttribute(Qt::WA_StaticContents);
        setAttribute(Qt::WA_OpaquePaintEvent);
        installEventFilter(this);

        setCursor(((m_dotCursorState == CursorOn) || m_forceLocalCursor) ? localDotCursor() : Qt::BlankCursor);

        setMouseTracking(true); // get mouse events even when there is no mousebutton pressed
        setFocusPolicy(Qt::WheelFocus);
        setStatus(Connected);
//         emit framebufferSizeChanged(m_frame.width(), m_frame.height());
        emit connected();
        
        if (m_scale) {
            if (parentWidget())
                scaleResize(parentWidget()->width(), parentWidget()->height());
        } 
        
        m_initDone = true;

#ifndef QTONLY
        if (m_hostPreferences->walletSupport()) {
            saveWalletPassword(vncThread.password());
        }
#endif
    }

    if ((y == 0 && x == 0) && (m_frame.size() != size())) {
        kDebug(5011) << "Updating framebuffer size";
        if (m_scale) {
            setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
            if (parentWidget())
                scaleResize(parentWidget()->width(), parentWidget()->height());
        } else {
            kDebug(5011) << "Resizing: " << m_frame.width() << m_frame.height();
            resize(m_frame.width(), m_frame.height());
            setMaximumSize(m_frame.width(), m_frame.height()); //This is a hack to force Qt to center the view in the scroll area
            setMinimumSize(m_frame.width(), m_frame.height());
        }
        emit framebufferSizeChanged(m_frame.width(), m_frame.height());
    }

    m_repaint = true;
    repaint(qRound(m_x * m_horizontalFactor), qRound(m_y * m_verticalFactor), qRound(m_w * m_horizontalFactor), qRound(m_h * m_verticalFactor));
    m_repaint = false;
}
开发者ID:crrodriguez,项目名称:qtemu,代码行数:65,代码来源:vncview.cpp

示例15: QTreeView

PlaylistView::PlaylistView(QWidget* parent)
    : QTreeView(parent),
      app_(nullptr),
      style_(new PlaylistProxyStyle(style())),
      playlist_(nullptr),
      header_(new PlaylistHeader(Qt::Horizontal, this, this)),
      setting_initial_header_layout_(false),
      upgrading_from_qheaderview_(false),
      read_only_settings_(true),
      upgrading_from_version_(-1),
      background_image_type_(Default),
      previous_background_image_opacity_(0.0),
      fade_animation_(new QTimeLine(1000, this)),
      last_height_(-1),
      last_width_(-1),
      force_background_redraw_(false),
      glow_enabled_(true),
      currently_glowing_(false),
      glow_intensity_step_(0),
      rating_delegate_(nullptr),
      inhibit_autoscroll_timer_(new QTimer(this)),
      inhibit_autoscroll_(false),
      currently_autoscrolling_(false),
      row_height_(-1),
      currenttrack_play_(":currenttrack_play.png"),
      currenttrack_pause_(":currenttrack_pause.png"),
      cached_current_row_row_(-1),
      drop_indicator_row_(-1),
      drag_over_(false),
      dynamic_controls_(new DynamicPlaylistControls(this)) {
  setHeader(header_);
  header_->setMovable(true);
  setStyle(style_);
  setMouseTracking(true);

  connect(header_, SIGNAL(sectionResized(int, int, int)), SLOT(SaveGeometry()));
  connect(header_, SIGNAL(sectionMoved(int, int, int)), SLOT(SaveGeometry()));
  connect(header_, SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)),
          SLOT(SaveGeometry()));
  connect(header_, SIGNAL(SectionVisibilityChanged(int, bool)),
          SLOT(SaveGeometry()));
  connect(header_, SIGNAL(sectionResized(int, int, int)),
          SLOT(InvalidateCachedCurrentPixmap()));
  connect(header_, SIGNAL(sectionMoved(int, int, int)),
          SLOT(InvalidateCachedCurrentPixmap()));
  connect(header_, SIGNAL(SectionVisibilityChanged(int, bool)),
          SLOT(InvalidateCachedCurrentPixmap()));
  connect(header_, SIGNAL(StretchEnabledChanged(bool)), SLOT(SaveSettings()));
  connect(header_, SIGNAL(StretchEnabledChanged(bool)),
          SLOT(StretchChanged(bool)));
  connect(header_, SIGNAL(MouseEntered()), SLOT(RatingHoverOut()));

  inhibit_autoscroll_timer_->setInterval(kAutoscrollGraceTimeout * 1000);
  inhibit_autoscroll_timer_->setSingleShot(true);
  connect(inhibit_autoscroll_timer_, SIGNAL(timeout()),
          SLOT(InhibitAutoscrollTimeout()));

  horizontalScrollBar()->installEventFilter(this);
  verticalScrollBar()->installEventFilter(this);

  setAlternatingRowColors(true);

  setAttribute(Qt::WA_MacShowFocusRect, false);

  dynamic_controls_->hide();

#ifdef Q_OS_DARWIN
  setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
#endif
  // For fading
  connect(fade_animation_, SIGNAL(valueChanged(qreal)),
          SLOT(FadePreviousBackgroundImage(qreal)));
  fade_animation_->setDirection(QTimeLine::Backward);  // 1.0 -> 0.0
}
开发者ID:abika,项目名称:Clementine,代码行数:74,代码来源:playlistview.cpp


注:本文中的setMouseTracking函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。