本文整理汇总了C++中KConfig::readSizeEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::readSizeEntry方法的具体用法?C++ KConfig::readSizeEntry怎么用?C++ KConfig::readSizeEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::readSizeEntry方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: configRead
/** Read config settings */
void KControlAddEdit::configRead()
{
KConfig *config = KGlobal::config();
config->setGroup("AddModify Window");
QSize defaultSize(500,400);
resize( config->readSizeEntry("Geometry", &defaultSize ) );
}
示例2: readParameters
void MyFracWindow::readParameters()
{
KConfig* config = kapp->config();
config->setGroup("Parameters");
_sliderIterations->setValue(config->readNumEntry("Iterations", 2));
_sliderQuality->setValue(config->readNumEntry("Quality", 5));
_sliderScale->setValue(config->readNumEntry("Scale", 15));
_sliderOffset->setValue(config->readNumEntry("Offset", 0));
_sliderScroll->setValue(config->readNumEntry("Scroll", 25));
_sliderHeight->setValue(config->readNumEntry("Height", 20));
_comboGrid->setCurrentItem(config->readNumEntry("Grid", 1));
setGridSize(_comboGrid->currentItem());
QColor black(0, 0, 0);
_colorButton->setColor(config->readColorEntry("Background", &black));
QStringList list = config->readListEntry("Gradient");
if (list.size() == 4) {
Gradient gradient(list[0] == "hsv");
gradient.getSpline(0).fromString(list[1]);
gradient.getSpline(1).fromString(list[2]);
gradient.getSpline(2).fromString(list[3]);
setGradient(gradient);
} else
setGradient(_presets.getDefault());
QSize defSize(800, 600);
_imageSize = config->readSizeEntry("ImageSize", &defSize);
_imageMime = config->readEntry("ImageMime", "image/png");
_imagePath = config->readEntry("ImagePath");
}
示例3: restoreSettings
void HeaderEditor::restoreSettings()
{
KConfig* config = KGlobal::config();
KConfigGroupSaver saver(config, "HeaderEditor" );
QSize defaultSize(350,250);
_editorSize = config->readSizeEntry("Size", &defaultSize );
}
示例4: toggleDetails
void IndexProgressDialog::toggleDetails()
{
KConfig *cfg = KGlobal::config();
cfg->setGroup( "indexprogressdialog" );
if ( mLogView->isHidden() ) {
mLogLabel->show();
mLogView->show();
mDetailsButton->setText( i18n("Details <<") );
QSize size = cfg->readSizeEntry( "size" );
if ( !size.isEmpty() ) resize( size );
} else {
cfg->writeEntry( "size", size() );
hideDetails();
}
}
示例5: restoreWindowSize
void KNHelper::restoreWindowSize(const QString &name, QWidget *d, const QSize &defaultSize)
{
KConfig *c = knGlobals.config();
c->setGroup("WINDOW_SIZES");
QSize s = c->readSizeEntry(name, &defaultSize);
if(s.isValid())
{
QRect max = KGlobalSettings::desktopGeometry(QCursor::pos());
if(s.width() > max.width()) s.setWidth(max.width() - 5);
if(s.height() > max.height()) s.setHeight(max.height() - 5);
d->resize(s);
}
}
示例6: defSize
KMJobViewer::KMJobViewer(QWidget *parent, const char *name)
: KMainWindow(parent,name)
{
m_view = 0;
m_pop = 0;
m_jobs.setAutoDelete(false);
m_items.setAutoDelete(false);
m_printers.setAutoDelete(false);
m_type = KMJobManager::ActiveJobs;
m_stickybox = 0;
m_standalone = ( parent == NULL );
setToolBarsMovable(false);
init();
if (m_standalone)
{
setCaption(i18n("No Printer"));
KConfig *conf = KMFactory::self()->printConfig();
QSize defSize( 550, 250 );
conf->setGroup( "Jobs" );
resize( conf->readSizeEntry( "Size", &defSize ) );
}
}
示例7: KDialogBase
ServerListDialog::ServerListDialog(QWidget *parent, const char *name)
: KDialogBase(Plain, i18n("Server List"), Ok|Close, Ok, parent, name, false)
{
setButtonOK(KGuiItem(i18n("C&onnect"), "connect_creating", i18n("Connect to the server"), i18n("Click here to connect to the selected IRC network and channel.")));
QFrame* mainWidget = plainPage();
m_serverList = new ServerListView(mainWidget);
QWhatsThis::add(m_serverList, i18n("This shows the listof configured IRC networks. An IRC network is a collection of cooperating servers. You need only connect to one of the servers in the network to be connected to the entire IRC network. Once connected, Konversation will automatically join the channels shown. When Konversation is started for the first time, the Freenode network and the <i>#kde</i> channel are already entered for you."));
m_serverList->setAllColumnsShowFocus(true);
m_serverList->setRootIsDecorated(true);
m_serverList->setResizeMode(QListView::AllColumns);
m_serverList->addColumn(i18n("Network"));
m_serverList->addColumn(i18n("Identity"));
m_serverList->addColumn(i18n("Channels"));
m_serverList->setSelectionModeExt(KListView::Extended);
m_serverList->setShowSortIndicator(true);
m_serverList->setSortColumn(0);
m_serverList->setDragEnabled(true);
m_serverList->setAcceptDrops(true);
m_serverList->setDropVisualizer(true);
m_serverList->header()->setMovingEnabled(false);
m_addButton = new QPushButton(i18n("&New..."), mainWidget);
QWhatsThis::add(m_addButton, i18n("Click here to define a new Network, including the server to connect to, and the Channels to automatically join once connected."));
m_editButton = new QPushButton(i18n("&Edit..."), mainWidget);
m_delButton = new QPushButton(i18n("&Delete"), mainWidget);
QCheckBox* showAtStartup = new QCheckBox(i18n("Show at application startup"), mainWidget);
showAtStartup->setChecked(Preferences::showServerList());
connect(showAtStartup, SIGNAL(toggled(bool)), this, SLOT(setShowAtStartup(bool)));
QGridLayout* layout = new QGridLayout(mainWidget, 5, 2, 0, spacingHint());
layout->addMultiCellWidget(m_serverList, 0, 3, 0, 0);
layout->addWidget(m_addButton, 0, 1);
layout->addWidget(m_editButton, 1, 1);
layout->addWidget(m_delButton, 2, 1);
layout->addMultiCellWidget(showAtStartup, 4, 4, 0, 1);
layout->setRowStretch(3, 10);
m_serverList->setFocus();
m_selectedItem = false;
m_selectedServer = ServerSettings("");
// Load server list
updateServerList();
connect(m_serverList, SIGNAL(aboutToMove()), this, SLOT(slotAboutToMove()));
connect(m_serverList, SIGNAL(moved()), this, SLOT(slotMoved()));
connect(m_serverList, SIGNAL(doubleClicked(QListViewItem *, const QPoint&, int)), this, SLOT(slotOk()));
connect(m_serverList, SIGNAL(selectionChanged()), this, SLOT(updateButtons()));
connect(m_serverList, SIGNAL(expanded(QListViewItem*)), this, SLOT(slotSetGroupExpanded(QListViewItem*)));
connect(m_serverList, SIGNAL(collapsed(QListViewItem*)), this, SLOT(slotSetGroupCollapsed(QListViewItem*)));
connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAdd()));
connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEdit()));
connect(m_delButton, SIGNAL(clicked()), this, SLOT(slotDelete()));
updateButtons();
KConfig* config = kapp->config();
config->setGroup("ServerListDialog");
QSize newSize = size();
newSize = config->readSizeEntry("Size", &newSize);
resize(newSize);
m_serverList->setSelected(m_serverList->firstChild(), true);
}