示例#1
0
void TabBarItem::setNotify(const ITabPageNotify &ANotify)
{
	FNotify = ANotify;
	FIconHidden = false;
	FBlinkTimer.stop();
	if (FNotify.priority > 0)
	{
		if (FNotify.blink)
			FBlinkTimer.start(BLINK_VISIBLE_TIME);
		if (!FNotify.iconKey.isEmpty() && !FNotify.iconStorage.isEmpty())
			showIconKey(FNotify.iconKey,FNotify.iconStorage);
		else
			showIcon(FNotify.icon);
		showToolTip(FNotify.toolTip);
		showStyleKey(FNotify.styleKey);
	}
	else
	{
		if (!FIconKey.isEmpty())
			showIconKey(FIconKey, RSR_STORAGE_MENUICONS);
		else
			showIcon(FIcon);
		showText(FText);
		showToolTip(FToolTip);
		showStyleKey(QString::null);
	}
}
示例#2
0
void ProgressBar::setMyToolTip(const QString &text)
{
    tooltip_text = text;

    if(QToolTip::isVisible())
        showToolTip();
}
示例#3
0
CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent)
: SceneWidget (document.getData().getResourceSystem(), parent, 0, false), mSceneElements(0), mRun(0), mDocument(document),
  mInteractionMask (0), mEditMode (0), mLocked (false), mDragging (false), mDragX(0), mDragY(0), mDragFactor(0),
  mDragWheelFactor(0), mDragShiftFactor(0),
  mToolTipPos (-1, -1), mShowToolTips(false), mToolTipDelay(0)
{
    setAcceptDrops(true);

    QAbstractItemModel *referenceables =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables);

    connect (referenceables, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceableDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (referenceables, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceableAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (referenceables, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceableAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *references =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_References);

    connect (references, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (references, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (references, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *pathgrids = document.getData().getTableModel (CSMWorld::UniversalId::Type_Pathgrids);

    connect (pathgrids, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (pathgridDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (pathgrids, SIGNAL (rowsRemoved (const QModelIndex&, int, int)),
        this, SLOT (pathgridRemoved (const QModelIndex&, int, int)));
    connect (pathgrids, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (pathgridAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (pathgrids, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (pathgridAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *debugProfiles =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_DebugProfiles);

    connect (debugProfiles, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (debugProfileDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (debugProfiles, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (debugProfileAboutToBeRemoved (const QModelIndex&, int, int)));

    mToolTipDelayTimer.setSingleShot (true);
    connect (&mToolTipDelayTimer, SIGNAL (timeout()), this, SLOT (showToolTip()));

    CSMPrefs::get()["3D Scene Input"].update();
    CSMPrefs::get()["Tooltips"].update();
}
示例#4
0
void
HeadersGroup::addHeader(int trackId, int height, int ypos, double /* xcur */)
{
    StaffHeader *sh = new StaffHeader(this, trackId, height, ypos);
    m_layout->addWidget(sh);
    m_headers.push_back(sh);
    m_usedHeight += height;

    connect(sh, SIGNAL(showToolTip(QString)),
            m_widget, SLOT(slotShowHeaderToolTip(QString)));

    connect(sh, SIGNAL(staffModified()),
            m_widget, SLOT(slotRegenerateHeaders()), Qt::QueuedConnection);
            // Without Qt::QueuedConnection, headers may be deleted
            // from themselves leading to crash
}
示例#5
0
QVariant TableModel::data(const QModelIndex & index, int role) const
{
    if (!index.isValid()) {
        return QVariant();
    }
    if (index.row() >= m_dataModel->rowCount() || index.row() < 0) {
        return QVariant();
    }
    if (role == Qt::DisplayRole) {
        return m_dataModel->data(index.row(), index.column());
    } else if (role == Qt::TextAlignmentRole) {
        return m_align;
    } else if (role == Qt::ToolTipRole) {
        emit showToolTip(index);
    }

    return QVariant();
}
示例#6
0
void
HeadersGroup::removeAllHeaders()
{
    TrackHeaderVector::iterator i;
    for (i=m_headers.begin(); i!=m_headers.end(); ++i) {
        disconnect(*i, SIGNAL(showToolTip(QString)),
                   m_widget, SLOT(slotShowHeaderToolTip(QString)));
        delete *i;
    }
    m_headers.erase(m_headers.begin(), m_headers.end());

    if (m_filler) {
        delete m_filler;
        m_filler = 0;
    }
    m_usedHeight = 0;
    m_lastWidth = -1;
}
示例#7
0
void DropBox::showEvent(QShowEvent *event)
{
	QRect screenGeometry = QApplication::desktop()->availableGeometry();

	resize(dropBoxLabel->pixmap()->size());
	setMaximumSize(dropBoxLabel->pixmap()->size());
	
	m_counterLabel.setGeometry(0, dropBoxLabel->height() - 30, dropBoxLabel->width(), 25);

	if(m_firstShow)
	{
		m_firstShow = false;
		int max_x = screenGeometry.width() - frameGeometry().width() + screenGeometry.left();
		int max_y = screenGeometry.height() - frameGeometry().height() + screenGeometry.top();
		move(max_x, max_y);
		QTimer::singleShot(333, this, SLOT(showToolTip()));
	}

	if(m_moving)
	{
		QApplication::restoreOverrideCursor();
		m_moving = false;
	}
}
示例#8
0
void ViewSettingsTab::slotDefaultSliderMoved(int value)
{
    showToolTip(m_defaultSizeSlider, value);
}
CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidget* parent)
    : SceneWidget (document.getData().getResourceSystem(), parent, 0, false)
    , mSceneElements(0)
    , mRun(0)
    , mDocument(document)
    , mInteractionMask (0)
    , mEditMode (0)
    , mLocked (false)
    , mDragMode(InteractionType_None)
    , mDragging (false)
    , mDragX(0)
    , mDragY(0)
    , mSpeedMode(false)
    , mDragFactor(0)
    , mDragWheelFactor(0)
    , mDragShiftFactor(0)
    , mToolTipPos (-1, -1)
    , mShowToolTips(false)
    , mToolTipDelay(0)
{
    setAcceptDrops(true);

    QAbstractItemModel *referenceables =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables);

    connect (referenceables, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceableDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (referenceables, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceableAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (referenceables, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceableAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *references =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_References);

    connect (references, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (referenceDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (references, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (referenceAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (references, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (referenceAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *pathgrids = document.getData().getTableModel (CSMWorld::UniversalId::Type_Pathgrids);

    connect (pathgrids, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (pathgridDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (pathgrids, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (pathgridAboutToBeRemoved (const QModelIndex&, int, int)));
    connect (pathgrids, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
        this, SLOT (pathgridAdded (const QModelIndex&, int, int)));

    QAbstractItemModel *debugProfiles =
        document.getData().getTableModel (CSMWorld::UniversalId::Type_DebugProfiles);

    connect (debugProfiles, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),
        this, SLOT (debugProfileDataChanged (const QModelIndex&, const QModelIndex&)));
    connect (debugProfiles, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
        this, SLOT (debugProfileAboutToBeRemoved (const QModelIndex&, int, int)));

    mToolTipDelayTimer.setSingleShot (true);
    connect (&mToolTipDelayTimer, SIGNAL (timeout()), this, SLOT (showToolTip()));

    CSMPrefs::get()["3D Scene Input"].update();
    CSMPrefs::get()["Tooltips"].update();

    // Shortcuts
    CSMPrefs::Shortcut* primaryEditShortcut = new CSMPrefs::Shortcut("scene-edit-primary", "scene-speed-modifier",
            CSMPrefs::Shortcut::SM_Detach, this);
    connect(primaryEditShortcut, SIGNAL(activated(bool)), this, SLOT(primaryEdit(bool)));
    connect(primaryEditShortcut, SIGNAL(secondary(bool)), this, SLOT(speedMode(bool)));

    CSMPrefs::Shortcut* secondaryEditShortcut = new CSMPrefs::Shortcut("scene-edit-secondary", this);
    connect(secondaryEditShortcut, SIGNAL(activated(bool)), this, SLOT(secondaryEdit(bool)));

    CSMPrefs::Shortcut* primarySelectShortcut = new CSMPrefs::Shortcut("scene-select-primary", this);
    connect(primarySelectShortcut, SIGNAL(activated(bool)), this, SLOT(primarySelect(bool)));

    CSMPrefs::Shortcut* secondarySelectShortcut = new CSMPrefs::Shortcut("scene-select-secondary", this);
    connect(secondarySelectShortcut, SIGNAL(activated(bool)), this, SLOT(secondarySelect(bool)));

    CSMPrefs::Shortcut* abortShortcut = new CSMPrefs::Shortcut("scene-edit-abort", this);
    connect(abortShortcut, SIGNAL(activated()), this, SLOT(abortDrag()));
}
示例#10
0
void IconsWidget::enterEvent(QEvent *)
{
    QTimer::singleShot(500, this, SLOT(showToolTip()));
}
示例#11
0
void TabBarItem::setToolTip(const QString &AToolTip)
{
	if (FNotify.priority < 0)
		showToolTip(AToolTip);
	FToolTip = AToolTip;
}
示例#12
0
void QueueLabel::aboutToShow()
{
    if( hasMouse() && !m_tooltipHidden )
        showToolTip();
}
示例#13
0
void ToolTipManager::prepareToolTip()
{
    showToolTip( d->item );
}
示例#14
0
文件: Area.cpp 项目: GrasJulien/appli
Area::Area(QWidget *parent, QString path) :
    QWidget(parent)
{
    this->path = path;

    // call the constructors of all the areas
    this->textArea = new TextArea(this);
    this->textArea->setReadOnly(false);
    this->myArea = new MyArea(this, this->path);
    this->treeArea = new TreeArea(this);
    this->indicatorEdit = new TextArea(this);
    this->listOldText = new QStringList();

    //Add text coloration (lie le TextArea)
    colorerSequences = new ColorerSequences(textArea->document());

    // treeArea: create widgets containing the buttons
    this->treeButtonArea = new QWidget(this);
    this->treeButtonArea->setMinimumWidth(12);
    this->treeButtonArea->setMaximumWidth(12);
    this->textButtonArea = new QWidget(this);
    this->textButtonArea->setMinimumWidth(12);
    this->textButtonArea->setMaximumWidth(12);

    // create the buttons
    this->leftButton = new QPushButton("<", this->treeButtonArea);
    this->leftButton->setMaximumWidth(12);
    this->leftButton->setMinimumHeight(70);
    QVBoxLayout *layoutLeft = new QVBoxLayout;
    layoutLeft->addWidget(leftButton);
    layoutLeft->setContentsMargins(0,0,0,0);
    this->treeButtonArea->setLayout(layoutLeft);

    this->rightButton = new QPushButton(">", this->textButtonArea);
    this->rightButton->setMaximumWidth(12);
    this->rightButton->setMinimumHeight(70);
    this->rightExpandButton = new QPushButton("<", this->textButtonArea);
    this->rightExpandButton->setMaximumWidth(12);
    this->rightExpandButton->setMinimumHeight(70);
    QVBoxLayout *layoutRight = new QVBoxLayout;
    layoutRight->addWidget(this->rightButton);
    layoutRight->addWidget(this->rightExpandButton);
    layoutRight->setContentsMargins(0,0,0,0);
    this->textButtonArea->setLayout(layoutRight);

    this->saveTextEdit = new QPushButton("Update",this);
    this->saveTextEdit->setFixedSize(QSize(80,30));
    this->saveTextEdit->setVisible(false);
    this->saveTextEdit->setEnabled(false);
    this->saveTextEdit->setShortcut(QKeySequence((Qt::CTRL + Qt::Key_E)));

    this->cancelTextEdit = new QPushButton("Cancel",this);
    this->cancelTextEdit->setFixedSize(QSize(80,30));
    this->cancelTextEdit->setVisible(false);
    this->cancelTextEdit->setEnabled(false);

    //indicatorEdit preferences

    this->indicatorEdit->setReadOnly(true);
    this->indicatorEdit->changeBackgroundColor(QColor("#F1F1F1"));
    this->indicatorEdit->setFixedSize(QSize(200,27));
    this->indicatorEdit->setTextColor(QColor(228,26,4));
    this->indicatorEdit->setCurrentFont(QFont("TypeWriter",10));
    this->indicatorEdit->setFontWeight(5);
    this->indicatorEdit->setFrameShape(QTextEdit::NoFrame);
    this->indicatorEdit->setFrameShadow(QTextEdit::Plain);
    this->indicatorEdit->setPlainText("Edition...");
    this->indicatorEdit->setVisible(false);
    //Press CTRL+E to save or CTRL+ESC to cancel

    // set the global layout
    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(this->treeArea);
    layout->addWidget(this->treeButtonArea);
    layout->addWidget(this->myArea);
    layout->addWidget(this->textButtonArea);

    QVBoxLayout *VLayout = new QVBoxLayout;
    VLayout->addWidget(this->indicatorEdit);
    VLayout->addWidget(this->textArea);

    QHBoxLayout *options = new QHBoxLayout;
    options->addWidget(this->saveTextEdit);
    options->addWidget(this->cancelTextEdit);

    VLayout->addLayout(options);

    QHBoxLayout *global = new QHBoxLayout;
    global->addLayout(layout);
    global->addLayout(VLayout);

    this->setLayout(global);

    // connect
    QObject::connect(this->leftButton, SIGNAL(clicked()), this, SLOT(hideOrShowTree()));
    QObject::connect(this->rightButton, SIGNAL(clicked()), this, SLOT(hideOrShowText()));
    QObject::connect(this->rightExpandButton, SIGNAL(clicked()), this, SLOT(expandOrReduceText()));
    QObject::connect(this->cancelTextEdit, SIGNAL(clicked()), this, SLOT(cancelEdit()));
    QObject::connect(this->textArea, SIGNAL(textChanged()), this->textArea, SLOT(onTextEdit()));
    QObject::connect(this->saveTextEdit, SIGNAL(clicked()), this, SLOT(saveEdit()));
    QObject::connect(this->textArea, SIGNAL(textChanged()), this, SLOT(onTextEdit()));    
    QObject::connect(this, SIGNAL(edition()), this, SLOT(showToolTip()));
    QObject::connect(this, SIGNAL(makeTempXML()), this, SLOT(tempXMLfile()));

    // initialization
    this->textArea->setHidden(true);
    this->rightButton->setText("<");
    this->rightExpandButton->hide();
    this->saveTextEdit->setDefault(false);
    this->cancelTextEdit->setDefault(false);
}
示例#15
0
void IconSizeGroupBox::slotDefaultSliderMoved(int value)
{
    showToolTip(m_defaultSizeSlider, value);
    emit defaultSizeChanged(value);
}
示例#16
0
void IconSizeGroupBox::slotPreviewSliderMoved(int value)
{
    showToolTip(m_previewSizeSlider, value);
    emit previewSizeChanged(value);
}
示例#17
0
void ProgressBar::enterEvent(QEvent *e)
{
    QWidget::enterEvent(e);

    QTimer::singleShot(150,this,SLOT(showToolTip()));
}
示例#18
0
void ViewSettingsTab::slotPreviewSliderMoved(int value)
{
    showToolTip(m_previewSizeSlider, value);
}
示例#19
0
void NVolumeSlider::wheelEvent(QWheelEvent *event)
{
    NSlider::wheelEvent(event);
    event->accept();
    showToolTip(event->x(), event->y());
}
示例#20
0
void NVolumeSlider::mouseMoveEvent(QMouseEvent *event)
{
    NSlider::mouseMoveEvent(event);
    showToolTip(event->x(), event->y());
}
示例#21
0
	void ToolTipManager::notifyEventFrameStart(float _time)
	{
		Widget* widget = InputManager::getInstance().getMouseFocusWidget();
		if (mOldFocusWidget != widget)
		{
			if (mToolTipVisible)
			{
				mToolTipVisible = false;
				hideToolTip(mOldFocusWidget);
			}
			mOldFocusWidget = widget;
			mNeedToolTip = false;

			if (mOldFocusWidget != nullptr)
			{
				mCurrentTime = 0;
				mOldMousePoint = InputManager::getInstance().getMousePositionByLayer();
				mOldIndex = getToolTipIndex(mOldFocusWidget);
				mNeedToolTip = isNeedToolTip(mOldFocusWidget);
			}
		}
		else if (mNeedToolTip)
		{
			bool capture = InputManager::getInstance().isCaptureMouse();
			if (capture)
			{
				if (mToolTipVisible)
				{
					mToolTipVisible = false;
					hideToolTip(mOldFocusWidget);
				}
			}
			else
			{
				IntPoint point = InputManager::getInstance().getMousePositionByLayer();
				if (!mToolTipVisible && point != mOldMousePoint)
				{
					if (mToolTipVisible)
					{
						mToolTipVisible = false;
						hideToolTip(mOldFocusWidget);
					}
					mCurrentTime = 0;
					mOldMousePoint = point;
					mOldIndex = getToolTipIndex(mOldFocusWidget);
				}
				else
				{
					size_t index = getToolTipIndex(mOldFocusWidget);
					if (mOldIndex != index)
					{
						if (mToolTipVisible)
						{
							mToolTipVisible = false;
							hideToolTip(mOldFocusWidget);
						}
						mCurrentTime = 0;
						mOldIndex = index;
					}
					else
					{
						if (!mToolTipVisible)
						{
							mCurrentTime += _time;
							if (mCurrentTime >= mDelayVisible)
							{
								mToolTipVisible = true;
								showToolTip(mOldFocusWidget, mOldIndex, point);
							}
						}
						else if (point != mOldMousePoint)
						{
							moveToolTip(mOldFocusWidget, mOldIndex, point);
						}
					}
				}
			}
		}
	}