porting

Models and roles in Qt5 and Qt 4.8

烂漫一生 提交于 2019-12-10 14:18:21
问题 Today I wanted to play with QtQuick2 a little bit. So I have started to port very simple Qt Quick1 app to Quick2. This app uses some models. And in Qt5 models are not working as I expect: I can't access data using roles. This is my QML code: import QtQuick 2.0 Rectangle { width: 800 height: 360 ListView { model: mainModel spacing: 5 anchors.fill: parent orientation: ListView.Vertical delegate: Text { text: "1" Component.onCompleted: { console.log(mainModel); console.log(mainModel.roles() );

Guidance regarding Android Kernel Porting from one device to other

那年仲夏 提交于 2019-12-10 11:14:59
问题 I own a Samsung Galaxy 3 and want to port kernels available for other Android Devices. I have all building environment ready. I have C knowledge also. What exactly I dont understand is how and what all things porting involves, which codes should be modified in what way? If someone could help me. It would be great. Thanks in advance. Ok I got it. But the real problem is I dont understand one thing. What needs to be changed in the source code so that to make it compatible in other device? Can

Drawables for qHD resolution

*爱你&永不变心* 提交于 2019-12-10 10:45:35
问题 I'm designing a game possibly for all kinds of Android devices, so I have multiple drawable folders for phones of different resolutions, and for tablets. Here is the list of my folders: drawable-mdpi - for 480x320 devices drawable-hdpi - for 800x480 and 854x480 devices drawable-large-hdpi - for 1024x600 tablets drawable-xlarge-mdpi - for 1200x800 tablets My question is what name should have a folder with drawables for qHD resolution, which is 960x540 and 256 dpi? Thanks in advance. 回答1: I

Adding custom widgets to QMenuBar

﹥>﹥吖頭↗ 提交于 2019-12-10 09:24:49
问题 Qt3 used to provide QMenuBar::insertItem with QWidget* parameter. This way any custom widget could be added to menu bar - for example a clock-widget. In Qt4 there is no such overloaded method. What would be the best way to reach the same goal - adding custom widgets to a menu bar? The custom widgets should be integrated in the layout of menu bar. Does anyoune knows the background, why this overload of insertItem was removed in Qt4 API? Best regards. 回答1: there's a QMenuBar::addAction (

Android Resources Folders by Screen Size

孤街浪徒 提交于 2019-12-10 00:18:26
问题 I've deloped an Android game which supports almost resolutions in the market (240x320, 320x480, 480x800, 480x854, 600x1024). My problem is when I'm trying to support tablets, I don't understand why Android divide the resources in different folders (hdpi, ldpi, mpdi, large-mdpi, ...) when that qualifiers isn't useful! I have several graphics sets (according width) but I'm going crazy, for example, with the tablets 480x800 with density mdpi or ldpi! It's is impossible reach every device. So, do

Converting iPhone/iPad apps onto Android [closed]

≯℡__Kan透↙ 提交于 2019-12-09 02:12:20
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I have started to build my own apps on iPhone and iPad using the iPhone SDK. The next question that is always asked by the client is,

Porting Java class and methods to Android. (TextLayout, Font, Graphics2D, & more)

自闭症网瘾萝莉.ら 提交于 2019-12-08 17:03:58
问题 I've been toying around in Android and attempting to port over a Java app. Below are some questions regarding to issues I've run into and would like some guidance on. It is a rather large question (multiple questions rather). However, I'm not asking them blindly as I have researched what I could about them and attempted to put my understanding to use. I've put time into asking the questions in hopes that they are half-ways clear on what I'm wanting to achieve. I'll be offering half of my rep

extern “C” char** environ - Windows - C++/CLI

丶灬走出姿态 提交于 2019-12-08 16:26:26
I have some old linux code I'm trying to port to Windows. When I first built it as a straight native DLL, I go no issues with this piece of code, but when I tried making it a mixed-mode C++/CLI DLL, I got an unresolved external object error on this: extern "C" char** environ; Why would this work for native and not CLI? Any idea how to work around this, or what it even does? That holds the environment variables (PATH, etc, etc). The C standard (if i recall correctly) requires environ to point to an array of these variables. They're also passed as the 3rd argument to the main entry point

Equivalent of C++ shift operator << in Java?

江枫思渺然 提交于 2019-12-08 15:53:31
问题 C++ shift operator << does not cycle. For example if you do: // C++ int a = 1; cout << (a<<38); You get 0. But, in Java you actually cycle and get a valid value of 64. I need to translate some C++ code to Java, so what do I use as the equivalent for << ? 回答1: The Java language spec states: If the promoted type of the left-hand operand is int, only the five lowest-order bits of the right-hand operand are used as the shift distance. It is as if the right-hand operand were subjected to a bitwise

socket.fromfd for Windows

我与影子孤独终老i 提交于 2019-12-08 04:34:32
问题 I am porting a Python-based web server from Linux to Windows. There is a call to socket.fromfd, which is only available in Unix and I've been trying to find a Windows-equivalent with no luck. I came upon WinSock and WSADuplicateSocket, but these don't seem to be available in Python based on this post: Can I use the winsock api from python? I know there is also DuplicateHandle, but it is not reliable for sockets. Is there any reliable way to reproduce socket.fromfd for Windows? 回答1: I think