本文整理汇总了C++中KateMainWindow::size方法的典型用法代码示例。如果您正苦于以下问题:C++ KateMainWindow::size方法的具体用法?C++ KateMainWindow::size怎么用?C++ KateMainWindow::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KateMainWindow
的用法示例。
在下文中一共展示了KateMainWindow::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KateMainWindowAdaptor
KateMainWindow::KateMainWindow (KConfig *sconfig, const QString &sgroup)
: KateMDI::MainWindow (0)
{
setObjectName((QString("__KateMainWindow#%1").arg(uniqueID)).toLatin1());
// first the very important id
myID = uniqueID;
uniqueID++;
new KateMainWindowAdaptor( this );
m_dbusObjectPath = "/MainWindow/" + QString::number( myID );
QDBusConnection::sessionBus().registerObject( m_dbusObjectPath, this );
m_modignore = false;
// here we go, set some usable default sizes
if (!initialGeometrySet())
{
int scnum = QApplication::desktop()->screenNumber(parentWidget());
QRect desk = QApplication::desktop()->screenGeometry(scnum);
QSize size;
// try to load size
if (sconfig)
{
KConfigGroup cg( sconfig, sgroup );
size.setWidth (cg.readEntry( QString::fromLatin1("Width %1").arg(desk.width()), 0 ));
size.setHeight (cg.readEntry( QString::fromLatin1("Height %1").arg(desk.height()), 0 ));
}
// if thats fails, try to reuse size
if (size.isEmpty())
{
// first try to reuse size known from current or last created main window ;=)
if (KateApp::self()->mainWindows () > 0)
{
KateMainWindow *win = KateApp::self()->activeMainWindow ();
if (!win)
win = KateApp::self()->mainWindow (KateApp::self()->mainWindows () - 1);
size = win->size();
}
else // now fallback to hard defaults ;)
{
// first try global app config
KConfigGroup cg( KGlobal::config(), "MainWindow" );
size.setWidth (cg.readEntry( QString::fromLatin1("Width %1").arg(desk.width()), 0 ));
size.setHeight (cg.readEntry( QString::fromLatin1("Height %1").arg(desk.height()), 0 ));
if (size.isEmpty())
size = QSize (qMin (700, desk.width()), qMin(480, desk.height()));
}
resize (size);
}
}
// start session restore if needed
startRestore (sconfig, sgroup);
m_mainWindow = new Kate::MainWindow (this);
// setup most important actions first, needed by setupMainWindow
setupImportantActions ();
// setup the most important widgets
setupMainWindow();
// setup the actions
setupActions();
setStandardToolBarMenuEnabled( true );
setXMLFile( "kateui.rc" );
createShellGUI ( true );
//kDebug() << "****************************************************************************" << sconfig;
// register mainwindow in app
KateApp::self()->addMainWindow (this);
// enable plugin guis
KatePluginManager::self()->enableAllPluginsGUI (this, sconfig);
// caption update
for (uint i = 0; i < KateDocManager::self()->documents(); i++)
slotDocumentCreated (KateDocManager::self()->document(i));
connect(KateDocManager::self(), SIGNAL(documentCreated(KTextEditor::Document*)), this, SLOT(slotDocumentCreated(KTextEditor::Document*)));
readOptions();
if (sconfig)
m_viewManager->restoreViewConfiguration (KConfigGroup(sconfig, sgroup) );
finishRestore ();
fileOpenRecent->loadEntries( KConfigGroup(sconfig, "Recent Files" ) );
setAcceptDrops(true);
//.........这里部分代码省略.........