gui: network_view: add some help button to network graph

This commit is contained in:
chelovechishko 2022-04-17 02:20:44 +09:00
parent 7d8f23259c
commit 6144a66137
2 changed files with 32 additions and 0 deletions

View File

@ -59,6 +59,24 @@ NetworkView::NetworkView(QWidget *parent)
connect( ui.freezeCheckBox, SIGNAL(toggled(bool)), this, SLOT(setFreezeState(bool))); connect( ui.freezeCheckBox, SIGNAL(toggled(bool)), this, SLOT(setFreezeState(bool)));
connect( ui.nameBox, SIGNAL(textChanged(QString)), this, SLOT(setNameSearch(QString))); connect( ui.nameBox, SIGNAL(textChanged(QString)), this, SLOT(setNameSearch(QString)));
QString help_text = tr(
"<h2>Graph scene info</h2>"
"<p>You could use mouse to deal with the scene here:</p>"
"<ul>"
"<li>Left mouse button press on a node: " "selection to see with which nodes it has connections"
" (you can drag it for some distance)"
"<li>Right mouse button click on a node: " "to do some actions with it"
"<li>Drag scene with left mouse button: " "to scroll"
"</ul>"
"<p>and keyboard:</p>"
"<ul>"
"<li>Arrow keys: " "to scroll"
"<li>Space/Enter: " "to repaint a scene"
"<li>+/-: " "to scale"
"</ul>"
);
registerHelpButton(ui.helpButton, help_text, "Graph scene");
_should_update = true ; _should_update = true ;
} }

View File

@ -54,6 +54,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="8">
<widget class="QToolButton" name="helpButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="6"> <item row="0" column="6">
<spacer> <spacer>
<property name="orientation"> <property name="orientation">