English 中文(简体)
平台具体守则
原标题:Platform specific code
  • 时间:2011-01-02 03:02:26
  •  标签:
  • qt

希望到这里来。 我正试图获得QT,以略微不同的代码汇编每个平台。 例如,

If platform is Windows then include windows.h
If platform is OSX then include time.h

目 录

If platform is Windows use QueryPerformanceCounter function from windows.h If platform is Linux use gettimeofdayfunction from time.h

这里的目标是,在没有两套法典的情况下,写包装功能,以回收利用Windows(QueryPerformanceCounter) &的经过微秒。 视窗XP的定时分辨率不足。 (约10-15米加薪)。

任何人都可以告诉我如何这样做? 预先感谢你和欢乐的新年。

Gary Cho

问题回答

如果这是偶然的话,我只想建立一个有条件进口正确单元之一的模块。

这是C++, 我相当肯定了这一先兆(不是C++专家)。 即使所汇编的双手能够同时使用窗户和钢机。 我看不出把窗户和轴头汇成可起诉的,然后在操作时选择。

你们需要汇编2本手册,其中每个版本都有正确的负责人。





相关问题
Qt: Do events get processed in order?

If I had a class A, where one of its functions does: void A::func() { emit first_signal(); emit second_signal(); } Assuming that a class B has 2 slots, one connected to first_signal, and the ...

How to determine how much free space on a drive in Qt?

I m using Qt and want a platform-independent way of getting the available free disk space. I know in Linux I can use statfs and in Windows I can use GetDiskFreeSpaceEx(). I know boost has a way, ...

Drag & drop with .ui files

I m having big troubles with drag & drop. I ve created a new Qt Designer Form Class in which I have one QListWidget and one QWidget. Now I want to enable dragging & dropping between these two ...

Link errors on Snow Leopard

I creating a small desktop application using Qt and Poco on Mac OS X Snow Leopard. Qt works fine, but once I started linking with Poco I get the following warning: ld: warning: in /Developer/SDKs/...

Showing two windows in Qt4

My friend and I have each created parts of a GUI using Qt 4. They both work independently and I am trying to integrate his form with the my main window. As of now this is the code I am using to try ...

Qt equivalent of .NET data binding?

Is there an equivalent of .NET s data binding in Qt? I want to populate some combo boxes and other widgets with QStrings that refer to specific entities in my database. However, it would be cleaner ...

热门标签