Skip to content

Instantly share code, notes, and snippets.

@ilius
Last active November 10, 2024 02:46
Show Gist options
  • Save ilius/e438497a2c46eb712464ee505affcd41 to your computer and use it in GitHub Desktop.
Save ilius/e438497a2c46eb712464ee505affcd41 to your computer and use it in GitHub Desktop.
MIQT QTableWidget
package main
import (
"os"
qt "github.com/mappu/miqt/qt6"
)
func main() {
qt.NewQApplication(os.Args)
window := qt.NewQMainWindow2()
window.SetWindowTitle("FrequencyView")
window.Resize(600, 400)
entry := qt.NewQLineEdit2()
entry.SetPlaceholderText("")
entry.SetFixedHeight(25)
view := qt.NewQTableWidget2()
view.SetHorizontalHeaderItem(0, qt.NewQTableWidgetItem2("Key"))
view.SetHorizontalHeaderItem(1, qt.NewQTableWidgetItem2("Count"))
centralWidget := qt.NewQWidget2()
mainLayout := qt.NewQVBoxLayout2()
centralWidget.SetLayout(mainLayout.Layout())
mainLayout.AddWidget(entry.QWidget)
mainLayout.AddWidget(view.QWidget)
window.SetCentralWidget(centralWidget)
window.Show()
qt.QApplication_Exec()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment