コード例 #1
0
ファイル: moc_upx.cpp プロジェクト: adoggie/5173.com
int upx::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: addHostGroup(); break;
        case 1: updateHostGroup(); break;
        case 2: delHostGroup(); break;
        case 3: addHost(); break;
        case 4: delHost(); break;
        case 5: groupClicked((*reinterpret_cast< QListWidgetItem*(*)>(_a[1]))); break;
        case 6: saveSettings(); break;
        case 7: saveLog2File(); break;
        case 8: addGame(); break;
        case 9: updateGame(); break;
        case 10: deleteGame(); break;
        case 11: calcGigest(); break;
        case 12: gameRefresh(); break;
        case 13: addGameHost(); break;
        case 14: deleteGameHost(); break;
        case 15: gameStop(); break;
        case 16: gameStart(); break;
        case 17: diffGameFiles(); break;
        case 18: syncGameFiles(); break;
        case 19: selectGamePath(); break;
        case 20: selectGameItem(); break;
        default: ;
        }
        _id -= 21;
    }
    return _id;
}
コード例 #2
0
ファイル: window.cpp プロジェクト: qtdevel/qgateway
//------------------------------------------------------------------------------------------------
void Window::addGatewaysTab()
{
    QWidget * w = new QWidget;

    gwEdit = new QLineEdit;
    gwEdit->setValidator(new IP4Validator(this));
    connect(gwEdit, SIGNAL(textChanged(const QString &)),
            this, SLOT(gwTextChanged(const QString &)));

    addGw = new QPushButton;
    addGw->setIcon(QIcon(":/images/plus.png"));
    connect(addGw, SIGNAL(clicked()), this, SLOT(addHost()));
    addGw->setEnabled(false);

    QHBoxLayout * h1 = new QHBoxLayout;
    h1->addWidget(gwEdit);
    h1->addWidget(addGw);

    gwList = new QListWidget;
    gwList->setSelectionMode(QAbstractItemView::SingleSelection);
    gwList->setSortingEnabled(false);
    connect(gwList, SIGNAL(itemSelectionChanged()),
            this, SLOT(gatewaySelectionChanged()));

    upGw = new QPushButton;
    upGw->setIcon(QIcon(":/images/arrow-up.png"));
    connect(upGw, SIGNAL(clicked()), this, SLOT(upHost()));

    downGw = new QPushButton;
    downGw->setIcon(QIcon(":/images/arrow-down.png"));
    connect(downGw, SIGNAL(clicked()), this, SLOT(downHost()));

    delGw = new QPushButton;
    delGw->setIcon(QIcon(":/images/minus.png"));
    connect(delGw, SIGNAL(clicked()), this, SLOT(delHost()));

    QGridLayout * g = new QGridLayout;
    g->addWidget(gwList, 0, 0, 4, 1);
    g->addWidget(upGw, 0, 1);
    g->addWidget(downGw, 1, 1);
    g->addWidget(delGw, 2, 1);

    QVBoxLayout * vl = new QVBoxLayout;
    vl->addLayout(h1);
    vl->addSpacing(10);
    vl->addLayout(g);
    w->setLayout(vl);
    tabs->addTab(w, QIcon(":/images/network-ip-local.png"), tr("Gateways"));
    checkButtons();
}
コード例 #3
0
_Hosts::_Hosts(QWidget *parent) :
    QWidget(parent)
{
    hosts = new QListWidget(this);
    add = new QPushButton(QIcon::fromTheme("list-add"), "", this);
    del = new QPushButton(QIcon::fromTheme("list-remove"), "", this);
    name = new QLineEdit(this);
    name->setPlaceholderText("Host name");
    port = new QLineEdit(this);
    port->setPlaceholderText("Port");
    colon = new QLabel(":", this);
    panelLayout = new QHBoxLayout(this);
    panel = new QWidget(this);
    panelLayout->addWidget(add, 2);
    panelLayout->addWidget(name, 40);
    panelLayout->addWidget(colon, 1);
    panelLayout->addWidget(port, 8);
    panelLayout->addWidget(del, 2);
    panel->setLayout(panelLayout);
    baseLayout = new QVBoxLayout(this);
    baseLayout->addWidget(hosts);
    baseLayout->addWidget(panel);
    baseWdg = new QWidget(this);
    baseWdg->setLayout(baseLayout);
    baseWdg->setVisible(false);
    useHosts = new QCheckBox("Use Hosts", this);
    commonLayout = new QVBoxLayout(this);
    commonLayout->addWidget(useHosts);
    commonLayout->addWidget(baseWdg);
    setLayout(commonLayout);
    connect(useHosts, SIGNAL(toggled(bool)),
            baseWdg, SLOT(setVisible(bool)));
    connect(add, SIGNAL(clicked()),
            this, SLOT(addHost()));
    connect(del, SIGNAL(clicked()),
            this, SLOT(delHost()));
    setFullHostMode(true);
    setOneHostMode(false);
}