English 中文(简体)
Qt 和鼠标悬停在 QGraphicsText 上的动画图形界面
原标题:Animated GUI with Qt and mouse hover on QGraphicsTextItem

我试图在 Windows 上的 Qt 4. 8 帮助下制作我自己的动画图形界面。 开始时我用部件和 Qt 设计器放置水平/ 格/ etc 版式, 并将其放入正常部件中, 但我发现让它们与动画框架移动并不太容易。 因此我切换到 QGraphicsScene/ QGraphicsView, 这看起来比较简单。 我将做一个简单的菜单, 上面有在悬浮的主要项目, 使子菜单可见。 一些简单的东西, 是关于下拉水平菜单的简单事项 。 我放置了 QGraphicsText 项, 但我仍然不明白如何将主要项目的悬浮事件连接到子菜单中来显示子菜单 。 任何想法吗? 当我有一个带 QMainWindow 的QGraphics View 部件的QMainWindow 时, 我将看到全部区域 。

最佳回答

您可以在悬浮上显示子菜单( 或做任何你想做的动作), 方法是创建您自己的专门子类 GraphicsTextTextTextTrom 并重新实施 < a href=" https://doc. qt.io/qt- 6/qgraphicsitect. html# hoverEnterEvent" rel=" nofollown noreferrer"\\\code> hoverEnterEvent 和 hoverLeaveEvent 方法 。

确保您读过 < a href=> https://doc.qt.io/qt- 6/qgraphicsitem. html#setAcfeptionHoverEvents\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

问题回答

暂无回答




相关问题
How to start to create an application GUI using C#?

HI! I am new to C# and plan to use it for my application GUI. I am trying to make my GUI similar to SPSS:http://www.spss.com/images/08/statistics_screens/ez_rfm-big.jpg Is this easy in C#? Is there ...

Automatic height of edit box

My shoes application has three items stacked on top of each other (with a stack, of course), in order: A banner An edit box Two buttons in a flow What I want to do is have the banner stay at it s ...

Search by using the keyboard in a list/grid - algorithm

I need to implement a custom search in a grid and I would like to find some user interface guidelines that explain the standard way to implement it. I mean this kind of search that is initiated by ...

UI And TcpClient Issue in vb.net

I m having some problems with a small ircbot i m writing. Basically I connect to the server using a tcpclient in a seperate class, which also runs on its own thread. I want to display the server text ...

UI Convention: Shortcut key for application exit? [closed]

Is there a convention for the shortcut keys for application exit? Some applications uses Alt+X some others use Ctrl+ X and Ctrl+Q. Applications like FF and IE doesnot assign a shortcut at all. So is ...

热门标签