根据代码,修改TableWidget 设置拖拽功能// WARNING! All changes made in this file will be lost!
package uigen
import (
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/widgets"
)
type UIMomoMainWindow struct {
Centralwidget *widgets.QWidget
TableWidget *widgets.QTableWidget
CheckBox *widgets.QCheckBox
CheckBox2 *widgets.QCheckBox
CheckBox3 *widgets.QCheckBox
ColumnView *widgets.QColumnView
PushButton *widgets.QPushButton
PushButton2 *widgets.QPushButton
PlainTextEdit *widgets.QPlainTextEdit
Menubar *widgets.QMenuBar
Statusbar *widgets.QStatusBar
}
func (this *UIMomoMainWindow) SetupUI(MainWindow *widgets.QMainWindow) {
MainWindow.SetObjectName("MainWindow")
MainWindow.SetGeometry(core.NewQRect4(0, 0, 1087, 732))
this.Centralwidget = widgets.NewQWidget(MainWindow, core.Qt__Widget)
this.Centralwidget.SetObjectName("Centralwidget")
this.TableWidget = widgets.NewQTableWidget(this.Centralwidget)
this.TableWidget.SetObjectName("TableWidget")
this.TableWidget.SetGeometry(core.NewQRect4(0, 0, 1091, 511))
this.TableWidget.SetColumnCount(9)
this.TableWidget.SetRowCount(0)
// 预创建所有表头项,确保它们存在
for i := 0; i < 9; i++ {
tableItem := widgets.NewQTableWidgetItem(0)
this.TableWidget.SetHorizontalHeaderItem(i, tableItem)
}
this.CheckBox = widgets.NewQCheckBox(this.Centralwidget)
this.CheckBox.SetObjectName("CheckBox")
this.CheckBox.SetGeometry(core.NewQRect4(20, 540, 61, 19))
this.CheckBox2 = widgets.NewQCheckBox(this.Centralwidget)
this.CheckBox2.SetObjectName("CheckBox2")
this.CheckBox2.SetGeometry(core.NewQRect4(110, 540, 61, 19))
this.CheckBox3 = widgets.NewQCheckBox(this.Centralwidget)
this.CheckBox3.SetObjectName("CheckBox3")
this.CheckBox3.SetGeometry(core.NewQRect4(190, 540, 91, 21))
this.ColumnView = widgets.NewQColumnView(this.Centralwidget)
this.ColumnView.SetObjectName("ColumnView")
this.ColumnView.SetGeometry(core.NewQRect4(270, 520, 811, 161))
this.PushButton = widgets.NewQPushButton(this.Centralwidget)
this.PushButton.SetObjectName("PushButton")
this.PushButton.SetGeometry(core.NewQRect4(20, 580, 231, 28))
this.PushButton2 = widgets.NewQPushButton(this.Centralwidget)
this.PushButton2.SetObjectName("PushButton2")
this.PushButton2.SetGeometry(core.NewQRect4(20, 630, 231, 28))
this.PlainTextEdit = widgets.NewQPlainTextEdit(this.Centralwidget)
this.PlainTextEdit.SetObjectName("PlainTextEdit")
this.PlainTextEdit.SetGeometry(core.NewQRect4(270, 520, 811, 161))
this.PlainTextEdit.SetStyleSheet("background-color: rgb(0, 0, 0);\ncolor: rgb(45, 111, 26);")
MainWindow.SetCentralWidget(this.Centralwidget)
this.Menubar = widgets.NewQMenuBar(MainWindow)
this.Menubar.SetObjectName("Menubar")
this.Menubar.SetGeometry(core.NewQRect4(0, 0, 1087, 26))
MainWindow.SetMenuBar(this.Menubar)
this.Statusbar = widgets.NewQStatusBar(MainWindow)
this.Statusbar.SetObjectName("Statusbar")
MainWindow.SetStatusBar(this.Statusbar)
this.RetranslateUi(MainWindow)
}
func (this *UIMomoMainWindow) RetranslateUi(MainWindow *widgets.QMainWindow) {
_translate := core.QCoreApplication_Translate
MainWindow.SetWindowTitle(_translate("MainWindow", "MainWindow", "", -1))
this.TableWidget.SetColumnCount(9)
this.TableWidget.SetRowCount(0)
this.TableWidget.HorizontalHeaderItem(0).SetText(_translate("MainWindow", "id", "", -1))
this.TableWidget.HorizontalHeaderItem(1).SetText(_translate("MainWindow", "moid", "", -1))
this.TableWidget.HorizontalHeaderItem(2).SetText(_translate("MainWindow", "用户名", "", -1))
this.TableWidget.HorizontalHeaderItem(3).SetText(_translate("MainWindow", "死活", "", -1))
this.TableWidget.HorizontalHeaderItem(4).SetText(_translate("MainWindow", "环境", "", -1))
this.TableWidget.HorizontalHeaderItem(5).SetText(_translate("MainWindow", "男女", "", -1))
this.TableWidget.HorizontalHeaderItem(6).SetText(_translate("MainWindow", "名字", "", -1))
this.TableWidget.HorizontalHeaderItem(7).SetText(_translate("MainWindow", "是否实名", "", -1))
this.TableWidget.HorizontalHeaderItem(8).SetText(_translate("MainWindow", "账号等级", "", -1))
this.CheckBox.SetText(_translate("MainWindow", "死号", "", -1))
this.CheckBox2.SetText(_translate("MainWindow", "实名", "", -1))
this.CheckBox3.SetText(_translate("MainWindow", "掉实名", "", -1))
this.PushButton.SetText(_translate("MainWindow", "开始任务", "", -1))
this.PushButton2.SetText(_translate("MainWindow", "导出结果", "", -1))
}
最新发布