本文整理汇总了C++中KPushButton::show方法的典型用法代码示例。如果您正苦于以下问题:C++ KPushButton::show方法的具体用法?C++ KPushButton::show怎么用?C++ KPushButton::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPushButton
的用法示例。
在下文中一共展示了KPushButton::show方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupIHostsPage
void kiptablesgenerator::setupIHostsPage()
{
iHostsPage = new QFrame(this);
QGridLayout *layout = new QGridLayout(iHostsPage, 4, 2);
QLabel *label = new QLabel(i18n(
"<p><i>Advanced users only</i> - If you wish to allow or block any specific hosts, "
"ignoring all other rules, add them to this page.</p>"),
iHostsPage);
label->show();
layout->addMultiCellWidget(label, 0, 0, 0, 1);
KListView *hosts = new KListView(iHostsPage);
hosts->addColumn(i18n("Allow/Block"));
hosts->addColumn(i18n("MAC/IP"));
hosts->addColumn(i18n("Host"));
hosts->show();
namedWidgets["hostsList"] = hosts;
layout->addMultiCellWidget(hosts, 1, 3, 0, 0);
KPushButton *addHost = new KPushButton(i18n("Add..."), iHostsPage);
addHost->show();
layout->addWidget(addHost, 1, 1);
connect( addHost, SIGNAL(clicked()), newHostDialog, SLOT(show()));
KPushButton *delHost = new KPushButton(i18n("Remove"), iHostsPage);
layout->addWidget(delHost, 2, 1);
connect( delHost, SIGNAL(clicked()), this, SLOT(slotDelHost()));
this->addPage(iHostsPage, i18n("Host Control"));
}
示例2: setupIPortsPage
void kiptablesgenerator::setupIPortsPage()
{
iPortsPage = new QFrame(this);
QGridLayout *layout = new QGridLayout(iPortsPage, 6, 2);
QLabel *intro = new QLabel(
i18n("<p>Here you can select which services are available to the outside world.</p>"),
iPortsPage);
intro->show();
layout->addMultiCellWidget(intro, 0, 0, 0, 1);
KListView *ports = new KListView(iPortsPage);
ports->addColumn(i18n("Port"));
ports->addColumn(i18n("Protocol"));
ports->addColumn(i18n("Action"));
ports->addColumn(i18n("Service"));
ports->setSorting(-1);
ports->show();
layout->addMultiCellWidget(ports, 1, 5, 0, 0);
namedWidgets["iPorts"] = ports;
KPushButton *newService = new KPushButton(i18n("A&dd Service"), iPortsPage);
newService->show();
layout->addWidget(newService, 1, 1);
connect(newService, SIGNAL(clicked()), newServiceDialog, SLOT(show()));
KPushButton *delService = new KPushButton(i18n("&Remove Service"), iPortsPage);
delService->show();
layout->addWidget(delService, 2, 1);
connect(delService, SIGNAL(clicked()), this, SLOT(slotDelService()));
KPushButton *upService = new KPushButton(i18n("&Move Up"), iPortsPage);
upService->show();
layout->addWidget(upService, 3, 1);
connect(upService, SIGNAL(clicked()), this, SLOT(slotUpService()));
KPushButton *downService = new KPushButton(i18n("M&ove Down"), iPortsPage);
downService->show();
layout->addWidget(downService, 4, 1);
connect(downService, SIGNAL(clicked()), this, SLOT(slotDownService()));
iPortsPage->show();
this->addPage(iPortsPage, i18n("Incoming Ports"));
}
示例3: addLanguageButton
void KSwitchLanguageDialogPrivate::addLanguageButton(const QString & languageCode, bool primaryLanguage)
{
QString labelText = primaryLanguage ? i18n("Primary language:") : i18n("Fallback language:");
KLanguageButton *languageButton = new KLanguageButton(page);
fillApplicationLanguages(languageButton);
languageButton->setCurrentItem(languageCode);
QObject::connect(
languageButton,
SIGNAL(activated(const QString &)),
p,
SLOT(languageOnButtonChanged(const QString &))
);
LanguageRowData languageRowData;
KPushButton *removeButton = 0;
if (!primaryLanguage)
{
removeButton = new KPushButton(i18n("Remove"), page);
QObject::connect(
removeButton,
SIGNAL(clicked()),
p,
SLOT(removeButtonClicked())
);
}
languageButton->setToolTip(primaryLanguage
? i18n("This is the main application language which will be used first, before any other languages.")
: i18n("This is the language which will be used if any previous languages do not contain a proper translation."));
int numRows = languagesLayout->rowCount();
QLabel *languageLabel = new QLabel(labelText, page);
languagesLayout->addWidget( languageLabel, numRows + 1, 1, Qt::AlignLeft );
languagesLayout->addWidget( languageButton, numRows + 1, 2, Qt::AlignLeft );
if (!primaryLanguage)
{
languagesLayout->addWidget( removeButton, numRows + 1, 3, Qt::AlignLeft );
languageRowData.setRowWidgets( languageLabel, languageButton, removeButton );
removeButton->show();
}
languageRows.insert(removeButton, languageRowData);
languageButtons.append(languageButton);
languageButton->show();
languageLabel->show();
}
示例4: addButton
void EstateDetails::addButton(QString command, QString caption, bool enabled)
{
KPushButton *button = new KPushButton(caption, this);
m_buttons.append(button);
m_buttonCommandMap[(QObject *)button] = command;
m_buttonBox->addWidget(button);
if (m_estate)
{
QColor bgColor, fgColor;
bgColor = m_estate->bgColor().light(110);
fgColor = ( bgColor.red() + bgColor.green() + bgColor.blue() < 255 ) ? Qt::white : Qt::black;
button->setPaletteForegroundColor( fgColor );
button->setPaletteBackgroundColor( bgColor );
}
button->setEnabled(enabled);
button->show();
connect(button, SIGNAL(pressed()), this, SLOT(buttonPressed()));
}
示例5: setupInterfacesPage
void kiptablesgenerator::setupInterfacesPage()
{
interfacesPage = new QFrame(this);
QVBoxLayout *layout = new QVBoxLayout(interfacesPage);
QLabel *intro = new QLabel(i18n(
"<p>Which of the following interfaces do you want to filter?</p>"
"<p>It is strongly advised <b>not</b> to filter '<tt>lo</tt>'.</p>"), interfacesPage);
intro->show();
layout->addWidget(intro);
KListBox *interfaces = new KListBox(interfacesPage);
char buffer[IFNAMSIZ];
for(unsigned int i = 1; if_indextoname(i, buffer) != NULL; i++)
{
interfaces->insertItem((QString)buffer);
}
interfaces->setSelectionMode(QListBox::Multi);
for (unsigned short i = 0; i < interfaces->count(); i++)
if (interfaces->item(i)->text() != "lo")
interfaces->setSelected(i, true);
interfaces->show();
layout->addWidget(interfaces);
namedWidgets["iInterfaces"] = interfaces;
KPushButton *newInterface = new KPushButton(i18n("A&dd Interface..."), interfacesPage);
newInterface->show();
layout->addWidget(newInterface);
connect(newInterface, SIGNAL(clicked()), this, SLOT(slotNewInterface()));
interfacesPage->show();
this->addPage(interfacesPage, i18n("Interfaces"));
}