drrob1
(Robert Solomon)
February 29, 2020, 4:40pm
1
Hi. I’m trying to learn how to use Qt in Go. I am working my way through a book that uses C++ examples that I’m trying to translate into Go. I’m stuck at QKeySequences.
Will someone point me in the right direction? My computer runs ubuntu 18.04.
Thanks
lutzhorn
(Lutz Horn)
February 29, 2020, 8:04pm
2
For the record: You use https://therecipe.github.io/qt/
Can you show us a small sample of the code that you are having problems with?
drrob1
(Robert Solomon)
March 1, 2020, 6:43pm
3
MainWindow::MainWindow()
{
setWindowTitle(“SRM System”);
setFixedSize(500, 500);
QPixmap newIcon(“new.png”);
QPixmap openIcon(“open.png”);
QPixmap closeIcon(“close.png”);
// Setup File Menu
fileMenu = menuBar()->addMenu("&File");
quitAction = new QAction(closeIcon, “Quit”, this);
quitAction->setShortcuts(QKeySequence::Quit);
newAction = new QAction(newIcon, “&New”, this);
newAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
openAction = new QAction(openIcon, “&New”, this);
openAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
fileMenu->addAction(newAction);
fileMenu->addAction(openAction);
fileMenu->addSeparator();
fileMenu->addAction(quitAction);
helpMenu = menuBar()->addMenu(“Help”);
aboutAction = new QAction(“About”, this);
aboutAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H));
helpMenu->addAction(aboutAction);
// Setup Signals and Slots
connect(quitAction, &QAction::triggered, this, &QApplication::quit);
}
lutzhorn
(Lutz Horn)
March 1, 2020, 6:47pm
4
There are four usages of QKeySequence
in this C++ code.
How do you port it to Go? Does it work?
system
(system)
Closed
May 30, 2020, 6:47pm
5
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.