KDevelop KDE application的问题

thisisll 2005-12-09 12:17:30
我用kdevelop生成一个KDE Application
看其中main.cpp的代码

if (app.isRestored())
{
RESTORE(KDEApp);
}
else
。。。
bool KApplication::isRestored ( ) const [inline]
Is the application restored from the session manager?
首先我想问一下这里的session是指的什么?
还有restore怎么理解、翻译?
既然他restored了为什么还要调用RESTORE(KDEApp);
#define RESTORE(type) { int n = 1;\
while (KMainWindow::canBeRestored(n)){\
(new type)->restore(n);\
n++;}}
626
...全文
229 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Wolf0403 2005-12-09
  • 打赏
  • 举报
回复
Session 是指当前的用户会话过程,restore 不理解。
x86 2005-12-09
  • 打赏
  • 举报
回复
session是指当前回话。退出KDE再进入时可以恢复上一次session,如果你的应用程序支持session,那么你可以在保存和恢复session的时候做相应的事情,比如保存用户操作状态等等。
loserking 2005-12-09
  • 打赏
  • 举报
回复
这个session跟用户会话应该无关。而是应该指的是QSessionManager。QSessionManager提供了一个interface来存储应用的运行状态。比如在windows下存储注册表,linux下存储某个文件中。

KDE应用在QT之上建立了一个自己的目录结构。isRestored()应该是检查具体app所在的目录下的状态配置文件,来判断是否有过以前存储的运行状态。如果以前串行化了运行状态,就根据这个串行化来构造应用,否则构造个新的空应用。

比如,那些toolbar或者停靠窗口,用户改变了它们的位置。当下次启动程序的时候,可能还希望是原来的用户习惯的位置。

kde的目录树我已经记不清了。去/usr/local下找吧。
thisisll 2005-12-09
  • 打赏
  • 举报
回复
当前的用户会话过程是指什么?
thisisll 2005-12-09
  • 打赏
  • 举报
回复
当前的用户会话过程是指什么?
KDE Application Tutorials

1. Introduction
1.1. What you should know already
2. Getting Started
3. Building the Qt Tutorials
3.1. Step One: Hello World!
3.1.1. What to change first
3.1.2. Entering the tutorial code
3.1.3. Building Hello World!
3.1.4. Exercises
3.2. Step 2 and 3: Extensions
3.3. Writing your own Widgets
3.4. Extending the Widget Class
3.5. Adding a new Class
3.6. Step 7-14
4. Creating KDE Applications
5. Installing KDE 2
5.1. Setting up Qt-2.1
5.2. Setting up KDE 2 Libraries
5.3. Setting up KDevelop
6. Application Concepts
6.1. The Document-View Model
6.2. The Multiple Document Interface (MDI)
7. The MDI Framework
7.1. Creating an MDI Framework
7.2. Overview
8. Defining the Documents
8.1. Adding the Instances
8.2. Initialization of the Document
8.3. Implementing the Serialization
9. Defining the View
9.1. Interactivity with the User
9.2. Reimplementing Event Handlers
9.3. Painting and Resizing the Document
10. Extending the GUI
10.1. Adding the "Pen" Menu
10.2. Adding Toolbar Buttons
10.3. Creating the Pen Width Dialog
10.4. Connections and Setting Up
10.5. Calling the Dialogs
11. Extended Views
11.1. Syncronizing Views
11.2. Scrolled Views
11.2.1. Sizing the Document Contents
11.3. Adapting the View
12. Using KImageIO with KScribble
12.1. Preparing the Document
12.2. Registering File Formats
12.3. Opening Images
12.4. Setting File Filters with KImageIO
13. Adding Printing Functionality
14. Copyright
A. KScribble-1.0 Example Sourcecode
A.1. Project Tarball
A.2. main.cpp
A.3. kscribble.h
A.4. kscribble.cpp
A.5. kscribbledoc.h
A.6. kscribbledoc.cpp
A.7. kscribbleview.h
A.8. kscribbleview.cpp
A.9. kpenbrushdlg.h
A.10. kpenbrushdlg.cpp
A.11. kpenbrushdlgdata.cpp
A.12. resource.h
The KDevelop Programming Handbook1. Introduction1.1. What you should know already1.2. About this Handbook1.3. Additional Information2. The KDE and Qt Libraries2.1. The Qt GUI Toolkit2.1.1. The first Qt Application2.1.2. The Reference Documentation for Qt 2.1.3. Interpretation of the Sample2.1.4. User Interaction2.1.5. Object Interaction by Signals and Slots2.2. What KDE provides2.2.1. The KDE 1.1.x libraries2.2.2. Example KDE Application3. Creating new Applications3.1. Invoking KAppWizard and Project Generation3.1.1. Starting KAppWizard and the First Page3.1.2. The Generate Settings Page3.1.3. The Header and Source Templates3.1.4. Creating the Project3.2. The First Build3.3. The Source Skeleton3.3.1. The main() Function3.3.2. User Application Start3.3.3. Invocation by Session Management3.4. Additional Contents of KDevelop Projects4. Application View Design4.1. Using Library Views4.1.1. Qt Views4.1.2. KDE Views4.2. Creating your own Views5. Configuring Menubars and Toolbars5.1. How does it work ?5.2. Adding a new menu5.3. Integrating Toolbar buttons5.4. Configuring Statusbars5.5. Keyboard Accelerator Configuration6. The Dialogeditor: Where your Dialogs are Build6.1. What the Dialogeditor provides6.2. Qt and KDE Widgets6.3. Properties of Qt supported Widgets6.3.1. QWidget Properties6.3.2. QButton inherited widgets6.3.3. QComboBox Properties6.3.4. QFrame inherited widgets6.3.5. QLineEdit Properties6.3.6. QScrollBar Properties6.3.7. QSlider Properties6.4. Properties of KDE supported Widgets6.4.1. KColorButton6.4.2. KKeyButton6.4.3. KCombo6.4.4. KDatePicker6.4.5. KLedLamp6.4.6. KProgress6.4.7. KSeparator6.4.8. KDateTable6.4.9. KTreeList6.4.10. KRestrictedLine6.4.11. KLed6.5. Constructing a new Dialog6.6. Setting Widget Properties6.7. Integrating the Dialog6.7.1. QWidget inherited6.7.2. QDialog inherited7. Printing Support7.1. The Qt Print Dialog7.2. The QPainter Class8. Help Functions8.1. Tool-Tips8.2. Adding Quick-help8.3. Extending the Statusbar Help8.4. The "What's This...?" Button9. Extending the Documentation with SGML 9.1. Why SGML ?9.2. What the Documentation already contains9.3. Writing SGML Documentation9.3.1. The DTD Declaration9.3.2. Titlepages9.3.3. Indices9.3.4. The Document Contents9.4. How to call Help in Dialogs10. Class Documentation with KDoc 10.1. How to use KDevelop's Documentation features10.2. Adding Class and Member Documentation10.3. Special Tags11. Internationalization11.1. What is i18n ?11.2. How KDE supports Internationalization11.3. Adding a Language to your Project11.4. Translation Team Contacts12. Finding Errors12.1. Debugging Macros provided by Qt 12.2. KDE Macros13. The KDE File System Standard13.1. Introduction13.2. Directory Layout13.3. What does this mean to application developers?13.4. Application Documentation13.5. What does this mean to library developers?14. File System Usage for KDevelop Projects14.1. Accessing Files during Runtime14.2. KApplication Methods14.3. KIconLoader Methods14.4. Setting File Installation Properties14.5. Organizing Project Data14.6. The kdelnk File15. Programming Guidelines15.1. General Rules15.2. Operating System Dependencies16. Licensing16.1. The GPL License16.2. KDE and Qt Licensing Issues16.2.1. Non-commercial Development16.2.2. Commercial Development16.3. Your Product License17. References18. CopyrightA. Additional InformationA.1. Example Makefile.am for a Shared Library

23,128

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧