Skip to content

Instantly share code, notes, and snippets.

@un1versal
Last active February 9, 2017 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save un1versal/2f1c1c2f2220c6b2401259f61041f2a4 to your computer and use it in GitHub Desktop.
Save un1versal/2f1c1c2f2220c6b2401259f61041f2a4 to your computer and use it in GitHub Desktop.
# First we'll create the main tabWidget.
%qcheatsheet=$new(tabWidget)
%qcheatsheet->$setToolTip("Show me a nice tooltip")
%qcheatsheet->$setTabPosition(Top)
%qcheatsheet->$setGeometry(400,400,600,400)
%qcheatsheet->$setWindowTitle("Testme")
# Now we'll create the new widgets and put they in to the main tabWidget.
%firsttab=$new(vbox)
%secondtab=$new(vbox)
# First tab
%html1 = $file.localdir("/tab-a.html")
%textbrowser = $new(textbrowser, %firsttab)
%textbrowser->$setSource(%html1)
%qcheatsheet->$addTab(%firsttab,Accel Keys, 65)
# We do the same work with the second tab's page.
%html2 = $file.localdir("/tab-b.html")
%textbrowser = $new(textbrowser, %secondtab)
%textbrowser->$setSource(%html2)
%qcheatsheet->$addTab(%secondtab,Manual Commands, 9)
# Show the widget.
%qcheatsheet->$show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment