[Interest] Why int for size() of containers instead of quint32?

2016-05-18 Thread Николай Шатохин
Hello.

I see that Qt uses int type many times in containers implementations? Why?
Why do you not use your own quint32? Why do you using signed and platform
dependent type for this purpose?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to reset QML WebView?

2014-06-03 Thread Николай Шатохин
Looks. Here is the simplest code:
https://www.dropbox.com/s/ctdcgrk0eqgq3a3/webview_test.tar.gz

When you start this app you will see white window. Click on window and you
will see browser with Twitter. Click again and browser will be hide and
destroyed.

So, please login to Twitter, than destroy browser by clicking first window
and then create it again by clicking on first window. You will see that you
left signed in. But I need that browser every time opens without signed
user (even if user checked Remember me checkbox). How to do this? How to
reset browser to the initial state?


2014-06-03 17:55 GMT+03:00 Jan Kundrát j...@flaska.net:

 On Monday, 2 June 2014 19:59:11 CEST, Николай Шатохин wrote:
  if(_socialWindow == NULL)

 Please note that identifiers that start with an underscore are reserved in
 C++. You are not supposed to use them for your own purposes in your code.

  _socialWindow-setSource(QUrl(source)); // source is a patch to QML
 file

 How does that QML file look like?

  And clearing cookies manually
 
 
 _socialWindow-engine()-networkAccessManager()-cookieJar()-setCookieJar(new
  QNetworkCookieJar());

 This is Qt5, and in Qt5, the QML WebView does not use the
 QNetworkAccessManager for network IO anymore. The QNAM you access here is
 only used for the QML engine's own purposes when it fetches QML files over
 the network. It has absolutely no effect on how QtWebKit (and the QML
 WebView) accesses web pages.

  _socialWindow-engine()-clearComponentCache();

 QML component cache has nothing to do with WebView's webkit cache.

 You should follow the advice given by Olivier Tilloy. If the private
 browsing mode really doesn't work, there's quite some breakage.

 With kind regards,
 Jan

 --
 Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to reset QML WebView?

2014-06-03 Thread Николай Шатохин
Is it safe to use experimental functions in production?


2014-06-03 19:10 GMT+03:00 Jan Kundrát j...@flaska.net:

 On Tuesday, 3 June 2014 18:03:32 CEST, Николай Шатохин wrote:

 When you start this app you will see white window. Click on window and you
 will see browser with Twitter. Click again and browser will be hide and
 destroyed.


 As Olivier already told you, activate the private browsing mode. You can
 only do this from the QML side, *not* from the C++ side.

 The QML code example you link to just instantiates the stock QML WebView,
 but does not make any attempt at activating its private browsing mode.


 With kind regards,
 Jan

 --
 Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to reset QML WebView?

2014-06-03 Thread Николай Шатохин
I just tried it. Not working.


2014-06-03 19:10 GMT+03:00 Jan Kundrát j...@flaska.net:

 On Tuesday, 3 June 2014 18:03:32 CEST, Николай Шатохин wrote:

 When you start this app you will see white window. Click on window and you
 will see browser with Twitter. Click again and browser will be hide and
 destroyed.


 As Olivier already told you, activate the private browsing mode. You can
 only do this from the QML side, *not* from the C++ side.

 The QML code example you link to just instantiates the stock QML WebView,
 but does not make any attempt at activating its private browsing mode.


 With kind regards,
 Jan

 --
 Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to reset QML WebView?

2014-06-03 Thread Николай Шатохин
import QtQuick 2.0
import QtWebKit 3.0
import QtWebKit.experimental 1.0

Item {
width: 640
height: 480

signal closeWindow();

WebView
{
anchors.fill: parent
url: address
experimental.preferences.privateBrowsingEnabled: true
}
}


2014-06-03 19:27 GMT+03:00 Николай Шатохин n.shatok...@gmail.com:

 I just tried it. Not working.


 2014-06-03 19:10 GMT+03:00 Jan Kundrát j...@flaska.net:

 On Tuesday, 3 June 2014 18:03:32 CEST, Николай Шатохин wrote:

 When you start this app you will see white window. Click on window and
 you
 will see browser with Twitter. Click again and browser will be hide and
 destroyed.


 As Olivier already told you, activate the private browsing mode. You can
 only do this from the QML side, *not* from the C++ side.

 The QML code example you link to just instantiates the stock QML WebView,
 but does not make any attempt at activating its private browsing mode.


 With kind regards,
 Jan

 --
 Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] How to reset QML WebView?

2014-06-02 Thread Николай Шатохин
Hello.

I have a web browser's window maked by QML from WebView.

And in C++ I create window:

if(_socialWindow == NULL)
{
_socialWindow= new QQuickView();
_socialWindow-setFlags(Qt::Tool);
_socialWindow-setResizeMode(QQuickView::SizeRootObjectToView);
_socialWindow-setMinimumWidth(640);
_socialWindow-setMinimumHeight(300);
}

_socialWindow-engine()-clearComponentCache();
_socialWindow-setSource(QUrl(source)); // source is a patch to QML file

then I post to twitter and then I destroy window:

if(_socialWindow != NULL)
{
_socialWindow-deleteLater();
_socialWindow = NULL;
}

First time all is OK: I authorize and share. But second time browser opens
with logged user. How to clear window? Why did it not reset after delete
and create new?


Best regards,

Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Ubuntu-phone] How to reset QML WebView?

2014-06-02 Thread Николай Шатохин
You didn't understand. It's not Android. It's Qt and QML


2014-06-03 0:24 GMT+03:00 Olivier Tilloy olivier.til...@canonical.com:




 On Mon, Jun 2, 2014 at 7:59 PM, Николай Шатохин n.shatok...@gmail.com
 wrote:

 Hello.

 I have a web browser's window maked by QML from WebView.

 And in C++ I create window:

 if(_socialWindow == NULL)
 {
 _socialWindow= new QQuickView();
 _socialWindow-setFlags(Qt::Tool);
 _socialWindow-setResizeMode(QQuickView::SizeRootObjectToView);
 _socialWindow-setMinimumWidth(640);
 _socialWindow-setMinimumHeight(300);
 }

 _socialWindow-engine()-clearComponentCache();
 _socialWindow-setSource(QUrl(source)); // source is a patch to QML file

 then I post to twitter and then I destroy window:

 if(_socialWindow != NULL)
 {
 _socialWindow-deleteLater();
 _socialWindow = NULL;
 }

 First time all is OK: I authorize and share. But second time browser
 opens with logged user. How to clear window? Why did it not reset after
 delete and create new?


 Hi Николай,

 I think what you’re seeing is the session cookie for whatever social
 service you’re logging into being persisted to disk, so the second time you
 instantiate the WebView the cookie is being picked up and the user is
 automatically logged in.

 I assume you’re using QtWebKit’s WebView. If so, you might want to try
 setting experimental.preferences.privateBrowsingEnabled to true on your
 WebView instance.

 I hope this helps.

  Olivier

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Ubuntu-phone] How to reset QML WebView?

2014-06-02 Thread Николай Шатохин
No, it doesn't help too :(

And clearing cookies manually

_socialWindow-engine()-networkAccessManager()-cookieJar()-setCookieJar(new
QNetworkCookieJar());

or cache

_socialWindow-engine()-clearComponentCache();

not solve the problem.

It looks like that QML file saves it state and lives between different
instances of QQuickView. How to reset it to initial state after creating
new QQuickView?


2014-06-03 0:44 GMT+03:00 Olivier Tilloy olivier.til...@canonical.com:




 On Mon, Jun 2, 2014 at 11:32 PM, Николай Шатохин n.shatok...@gmail.com
 wrote:

 You didn't understand. It's not Android. It's Qt and QML


 I think I understood, and I don’t think I mentioned Android anywhere (by
 the way Qt and QML also run on android, they’re not mutually exclusive
 technologies).

 I was suggesting you try something like that with your QML webview:

   import QtQuick 2.0
   import QtWebKit 3.1
   import QtWebKit.experimental 1.0
   WebView {
 experimental.preferences.privateBrowsingEnabled: true
   }

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt for NaCl port

2014-05-09 Thread Николай Шатохин
You can be interested in QmlWeb https://gitorious.org/qmlweb/pages/Home


2014-05-08 22:54 GMT+03:00 Daiwei Li daiwe...@gmail.com:

 Hello,

 I'm investigating porting an existing C++/QML application to Google NaCl,
 and I found that Qt had attempted a port a couple years ago:
 http://qt-project.org/wiki/Qt_for_Google_Native_Client. From what I've
 found online, it looks like it's unsupported and no longer works with the
 latest Qt and NaCl toolchain.

 I'm currently only looking into porting what's necessary for getting the
 QML engine/renderer running. Can anyone familiar with NaCl think of any
 showstoppers for this subset of Qt functionality? It looks like NaCl has an
 implementation of OpenGLES2, and worst case, if it doesn't support JIT, V4
 has an interpreter option.

 Does anyone have experience with the Qt for NaCl project? Any
 tips/advice/considerations on attempting such a port?

 Thanks,
 Daiwei

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Qt laptop stickers

2014-01-06 Thread Николай Шатохин
Hello.

Does anyone have a Qt laptop stickers? Can you sell me some?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Qt widgets: widgets appears without backgound

2013-12-19 Thread Николай Шатохин
If I show widget inside other widget, it appears with transparent
background. How to disable this?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Hackathon at Kiev (Ukraine)

2013-12-09 Thread Николай Шатохин
Hello.

We will organize coding Hackathon at Kiev in January. We invite you to
participate
it.

The exact date and location will be announced later.


We organized over 15 Hackathons at few Ukrainian cities. Each
Hackathon attracted
about one hundred highly skilled developers.

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Web Development

2013-11-26 Thread Николай Шатохин
And CppCms http://cppcms.com/wikipp/en/page/main with Qt libs for
server-side.


2013/11/26 Alan Alpert 4163654...@gmail.com

 On Tue, Nov 26, 2013 at 11:06 AM, Jason H scorp...@yahoo.com wrote:
  So as the release of 5.2 approaches, we get Qt in Win/Lin/OSX and iOS and
  Android, Qt will be fantastic toolkit. A glaring commission now is web
  development.
 
  I've been playing with node.js and since Qt is now dropping the v8 engine
  for a custom one, could Qt use the new engine for QML web apps? For those
  not familiar with nodejs it is a v8-powered javascript engine used for
  making server-side applications.

 Which has some custom JS extensions. Once we have a fully extendable
 JS engine (see that thread on the dev list, but we're still quite some
 way from it), it will be easy to add your own node extensions and
 run existing node.js libaries with our engine. Until then, you're
 stuck with QML or plain JS libraries, when many are written
 specifically for node.

  If we were to take that same engine and
  equip it whith HTML/JS widgets, we could use QML to code websites, much
 in
  the same way Wt is the web version of Qt. However, we (I) would not want
 to
  split this functionality from Qt itself.

 All you need is to write a QML module which generates HTML/JS instead
 of pushing pixels to screen. Theoretically, you might even be able to
 write a custom QSGRenderer (although that would ruin even the limited
 interaction of server-side generated HTML).

 PS: Have a look at
 https://projects.kde.org/projects/playground/www/qmlweb if you haven't
 seen it. Maybe not quite the same approach though, it's more
 client-side.

 --
 Alan Alpert
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Z-order in QML

2013-11-01 Thread Николай Шатохин
Hello.

Is it possible to set depth of sprite in QML for show one object behind
other and change it dynamically?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Ubuntu-phone] Z-order in QML

2013-11-01 Thread Николай Шатохин
Thanks


2013/11/1 Gustavo Niemeyer gustavo.nieme...@canonical.com

 Yes, it's possble. Check this out for details:

 http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-item.html#z-prop

 On Fri, Nov 1, 2013 at 10:18 AM, Николай Шатохин n.shatok...@gmail.com
 wrote:
  Hello.
 
  Is it possible to set depth of sprite in QML for show one object behind
  other and change it dynamically?
 
  Best regards,
  Nick
 
  --
  Mailing list: https://launchpad.net/~ubuntu-phone
  Post to : ubuntu-ph...@lists.launchpad.net
  Unsubscribe : https://launchpad.net/~ubuntu-phone
  More help   : https://help.launchpad.net/ListHelp
 

 --
 gustavo @ http://niemeyer.net

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Pointers as Q_PPOPERTY

2013-10-07 Thread Николай Шатохин
Can I use QList (or something similar) as Q_PROPERTY? How can I use it in
QML? Can I use QList of pointers? And get objects in QML

Best regards,
Nick


2013/10/4 Николай Шатохин n.shatok...@gmail.com

 Yes, I did exactly the same. Thanks.


 2013/10/4 Bo Thorsen bthor...@ics.com

 Hi Николай Шатохин,

 I saw on the list, that you got this working. But there were a bunch of
 things missing in the discussion. I have just done the same thing you are
 trying in one of our 4.8.5 based projects.

 Some of this has been said, other parts haven't. I hope this is a
 complete description that should help you understand the topic.

 Den 02-10-2013 16:12, Николай Шатохин skrev:

  I registered as QML Type class Ship inherited from QObject that have
 fields:

 Q_PROPERTY(Hull hull READ hull)
 Q_PROPERTY(Reactor reactor READ reactor)
 Q_PROPERTY(Shields shields READ shields)

 (all field classes inherited from QObject too)

 But in ship class I'm using this fields as pointers (Hull * hull). So,
 how to use correctly Q_Properties in this case? (I need call methods
 from this fields and catch signals from them in QML)

 Can I use something like this Q_PROPERTY(Hull hull READ hull)?


 As already pointed out, you have to do pointers for this:

 class Hull : public QObject { ... };

 class Ship : public QObject {
   Q_OBJECT
   Q_PROPERTY(Hull* hull READ hull CONSTANT)
   Hull* m_hull;
 public:
   Ship() : m_hull(new Hull(this)) {}
   Hull* hull() { return m_hull; }
 };

 The Reactor and Shields work exactly the same way.

 For this to work, you have to declare the Hull, Reactor and Shields types
 to the QML engine. Something like this:

 qmlRegisterUncreatableType**Hull(MyGame, 1, 0, Hull, Can't be
 created.);
 qmlRegisterTypeShip(MyGame**, 1, 0, Ship);


  And then in QML:

 Ship
 {
  id: ship
  Hull
  {
   id: hull_indicator
   backend: ship.hull
  }

  onDamage:
  {
  ship.hull.reduce(damage);
  }
 }


 You don't need the extra Hull {} declaration here. There is already a
 Hull object in your ship, the ship.hull you use in onDamage.

 If this is about visualization, you should have a different set of
 classes, ShipView and HullView or something, that shows this:

 import MyGame 1.0
 Item {
   id: completeShip

   ShipView {
 anchors.fill: parent
 ship: internal.ship
   }

   HullView {
 anchors.fill: parent
 hull: internal.ship.hull
   }

   QtObject {
 id: internal

 Ship {
   id: ship
 }
   }
 }

 This might seem complicated at first, but you achieve one thing I find
 extremely important in QML coding: Keep your state in C++ and totally
 separated from the visualization of it.

 This is a standard MVC pattern, actually. The Ship is the model, the
 completeShip is the controller and ShipView/HullView is the visualization.
 But somehow this isn't always followed when people code QML.

 I hope this helps.

 Bo.

 --
 Bo Thorsen, European Qt Manager, ICS
 Integrated Computer Solutions. Delivering World-Class Applications
 http://ics.com/services



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Install both Qt5 and Qt4.7 at one Ubuntu

2013-10-07 Thread Николай Шатохин
Hello.

I need Qt4.7 for developing apps for embedded systems and Qt5 for desktop
apps. Is it possible to install it both in Ubuntu 13.04 without conflicts?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Install both Qt5 and Qt4.7 at one Ubuntu

2013-10-07 Thread Николай Шатохин
But installing qt4-default from repo removing qt5-default.


2013/10/7 Jonathan Greig redteam...@gmail.com

 they should play nicely, look for qtchooser and use it to switch between
 the two:

 qtchooser -run-tool=qmake -qt=qt5
 make




 On Mon, Oct 7, 2013 at 5:06 AM, Mandeep Sandhu 
 mandeepsandhu@gmail.com wrote:

 I think both Qt4 and 5 are there in the Ubuntu apt repos. Though I'm not
 sure if they'll play nice if _both_ are installed from apt (eg which qmake
 will be used?).

 Maybe you can install one of them directly (eg: by downloading Qt5
 pre-built binaries from qt-project.org) and the other one from apt.

 Basically you just need to use the right qmake for building your apps.
 Eg: you can have 'qmake5' point to the Qt5 qmake binary and use that for
 building Qt5 apps while 'qmake' uses the Qt4 binary.

 HTH,
 -mandeep




 On Mon, Oct 7, 2013 at 3:21 PM, Николай Шатохин n.shatok...@gmail.comwrote:

 Hello.

 I need Qt4.7 for developing apps for embedded systems and Qt5 for
 desktop apps. Is it possible to install it both in Ubuntu 13.04 without
 conflicts?

 Best regards,
 Nick

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest



 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Install both Qt5 and Qt4.7 at one Ubuntu

2013-10-07 Thread Николай Шатохин
qtchooser working, thanks.

But there is only Qt4.8.1 in Ubuntu repos. Is it possible to install Qt4.7
without building from source?


2013/10/7 Jonathan Greig redteam...@gmail.com

 Do not worry about it removing the qt4-default or qt5-default. It will do
 that, just figure out which one you use more often and make that the
 default. When you want to build for qt4 or qt5 then just use the qtchooser.
 I'm using the qtchooser method on a Kubuntu 13.10 install and it hasn't
 broken yet :P


 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Install both Qt5 and Qt4.7 at one Ubuntu

2013-10-07 Thread Николай Шатохин
Lol, you just solved my segfault problem :))


2013/10/7 Guido Seifert warg...@gmx.de

 There can always be conflicts. One problem, which bit me:
 I have a Qt5 app, which uses QMultimedia. QMultimedia uses the gstreamer
 libs
 on Linux. The gstreamer libs use libproxy if available. And one of the
 libproxy
 modules links against Qt4 - crash.

 Only solution for me was to delete the libproxy plugin, which I
 fortunately don't
 need. This was on Debian und not Ubuntu.

 Guido


 On Mon, 7 Oct 2013 12:51:48 +0300
 Николай Шатохин n.shatok...@gmail.com wrote:

  Hello.
 
  I need Qt4.7 for developing apps for embedded systems and Qt5 for desktop
  apps. Is it possible to install it both in Ubuntu 13.04 without
 conflicts?
 
  Best regards,
  Nick
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Pointers as Q_PPOPERTY

2013-10-04 Thread Николай Шатохин
Yes, I did exactly the same. Thanks.


2013/10/4 Bo Thorsen bthor...@ics.com

 Hi Николай Шатохин,

 I saw on the list, that you got this working. But there were a bunch of
 things missing in the discussion. I have just done the same thing you are
 trying in one of our 4.8.5 based projects.

 Some of this has been said, other parts haven't. I hope this is a complete
 description that should help you understand the topic.

 Den 02-10-2013 16:12, Николай Шатохин skrev:

  I registered as QML Type class Ship inherited from QObject that have
 fields:

 Q_PROPERTY(Hull hull READ hull)
 Q_PROPERTY(Reactor reactor READ reactor)
 Q_PROPERTY(Shields shields READ shields)

 (all field classes inherited from QObject too)

 But in ship class I'm using this fields as pointers (Hull * hull). So,
 how to use correctly Q_Properties in this case? (I need call methods
 from this fields and catch signals from them in QML)

 Can I use something like this Q_PROPERTY(Hull hull READ hull)?


 As already pointed out, you have to do pointers for this:

 class Hull : public QObject { ... };

 class Ship : public QObject {
   Q_OBJECT
   Q_PROPERTY(Hull* hull READ hull CONSTANT)
   Hull* m_hull;
 public:
   Ship() : m_hull(new Hull(this)) {}
   Hull* hull() { return m_hull; }
 };

 The Reactor and Shields work exactly the same way.

 For this to work, you have to declare the Hull, Reactor and Shields types
 to the QML engine. Something like this:

 qmlRegisterUncreatableType**Hull(MyGame, 1, 0, Hull, Can't be
 created.);
 qmlRegisterTypeShip(MyGame**, 1, 0, Ship);


  And then in QML:

 Ship
 {
  id: ship
  Hull
  {
   id: hull_indicator
   backend: ship.hull
  }

  onDamage:
  {
  ship.hull.reduce(damage);
  }
 }


 You don't need the extra Hull {} declaration here. There is already a Hull
 object in your ship, the ship.hull you use in onDamage.

 If this is about visualization, you should have a different set of
 classes, ShipView and HullView or something, that shows this:

 import MyGame 1.0
 Item {
   id: completeShip

   ShipView {
 anchors.fill: parent
 ship: internal.ship
   }

   HullView {
 anchors.fill: parent
 hull: internal.ship.hull
   }

   QtObject {
 id: internal

 Ship {
   id: ship
 }
   }
 }

 This might seem complicated at first, but you achieve one thing I find
 extremely important in QML coding: Keep your state in C++ and totally
 separated from the visualization of it.

 This is a standard MVC pattern, actually. The Ship is the model, the
 completeShip is the controller and ShipView/HullView is the visualization.
 But somehow this isn't always followed when people code QML.

 I hope this helps.

 Bo.

 --
 Bo Thorsen, European Qt Manager, ICS
 Integrated Computer Solutions. Delivering World-Class Applications
 http://ics.com/services

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Qt on PS4 and SteamOS

2013-09-30 Thread Николай Шатохин
Hello.

Can I use Qt5 and QML for game developing for PS4 and SteamOS?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Creating QML views for C++ objects (not classes)

2013-09-29 Thread Николай Шатохин
Hello.

When I create a class in C++, I can register it for QML and can create view
for it. It's very convenient. But, if I need many objects of the same type,
and need to show few views on screen, I got problems.
Is it possible to register QML type for object, not for class?
If I change some object, I need to see only its view changed.

Best regard,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Qt5 with Qt 4.7 on Ubuntu 13.04. How to install it both without conflicts?

2013-08-05 Thread Николай Шатохин
Hello.

I'm using Qt5 and need Qt 4.7 now (for porting my game to handheld game
console). Is it possible to install it additionally on Ubuntu 13.04?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Fastest way to send a signal to one of children processes

2013-05-02 Thread Николай Шатохин
Hello.

I have one main process and many children processes that controls
TCP-connections with clients (For example, one million). Each child process
can send signal to main process with id of another process. So, server must
to send data to this process. How to do this quickly? Now, I send signals
to each process and they check id in signal with their ids.

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] How to update resource file before every building project

2013-02-09 Thread Николай Шатохин
Hello.

My QML files in resource file (.qrc). So, when I editing qml I need change
something in resource file and save it for apply changes to qml files. How
to do this automatically before build?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to update resource file before every building project

2013-02-09 Thread Николай Шатохин
Didn't help.


2013/2/9 Oleg Shparber troll...@gmail.com

 Hi,

 Running qmake should help.

 --
 Oleg


 On Sat, Feb 9, 2013 at 7:21 PM, Николай Шатохин n.shatok...@gmail.comwrote:

 Hello.

 My QML files in resource file (.qrc). So, when I editing qml I need
 change something in resource file and save it for apply changes to qml
 files. How to do this automatically before build?

 Best regards,
 Nick

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] QML: is it draw unvisible parts?

2012-12-14 Thread Николай Шатохин
Hi.

If I'll create long game scene on QML and will just move it to left or to
right on screen (game scene bigger than screen), will it be slow? Or QML
don't draw unvisible parts?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Adding objects in QML and scrolling it

2012-10-05 Thread Николай Шатохин
Hello.

Can anybody help me with my problem? I have a scene (Rectangle). I need add
objects (circles) into scene by signal (signal returns coordinates) from
C++ class and move all objects on scene to left after it (scrolling).

So, how can I add new object (Qml type)?
How can I move all added objects to left by x coordinate for a custom value?
How can I destroy object when it left screen?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Disconnecting signals when object destroyed

2012-10-05 Thread Николай Шатохин
Hello.

I found that QML trying to call object's methods even when it destroyed.

It's my main.qml file:

import QtQuick 1.1


Rectangle {

id: appWindow

width: 360

height: 360


property int i: 0;

property real step: 0.1;


property Component component;


signal trigger(int dx)


Text {

text: qsTr(Hello World)

anchors.centerIn: parent

}

MouseArea {

anchors.fill: parent

onClicked: {

//Qt.quit();

trigger(100);


component = Qt.createComponent(Note.qml);


if(component != null)

continueCreation();

else

component.ready.connect(continueCreation);



}

}


onTrigger: {

console.log(parent trigger);

}


function destruction(obj)

{

console.log(destruction);

trigger.disconnect(obj.move);

}


function continueCreation()

{

var sprite = component.createObject(appWindow, {x: 100, y:
100, color:Qt.rgba(1, i*step, 1-i*step, 1)});


 if (sprite == null) {

 // Error Handling

 console.log(Error creating object);

 }

 sprite.destruction.connect(destruction);

 trigger.connect(sprite.move);


 i++;

}

}


It's my Note.qml file:

import QtQuick 1.1


Rectangle {

id: note

width: 100

height: 62

color: red


//signal move();

signal destruction(variant obj);


MouseArea {

anchors.fill: parent

onClicked: {

destruction(this);

note.destroy();

}

}


function move(dx)

{

x += dx

}

}


Why it can't disconnect signal when object destroyed? How to do this right?


Sorry, I'm novice in QML.


Best regards,

Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Protect qml files from changing

2012-10-05 Thread Николай Шатохин
Hello.

I'm creating paid application. How can I protect my QML files from changing
to avoid app cracking?

Best regards,
Nick.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] StyleSheets in children QWidgets

2012-02-23 Thread Николай Шатохин
Hello.

When I set custom StyleSheet in CentralWidget or MainWindow, all children
widgets and elements lost their default StyleSheets. How to keep default
StyleSheets in cheldren elements? And how to disable ugly pink selection in
buttons when I change it StyleSheets?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] StyleSheets in children QWidgets

2012-02-23 Thread Николай Шатохин
So, If I change StyleSheet of CentralWidget then I must change StyleSheets
of all children Widgets? So, is it possible to see default stylesheets of
widgets? What stylesheet do I must to set to create button with rounded
corners and different pictures on click, mouse over, selection, normal and
disabled states? And how can I turn off ugly pink selection?

2012/2/23 noru...@me.com

 This isn't possible. I know there where a hack/workaround but this doesn't
 work either.

 Best Regards

 Am 23.02.2012 um 12:14 schrieb Николай Шатохин n.shatok...@gmail.com:

  Hello.
 
  When I set custom StyleSheet in CentralWidget or MainWindow, all
 children widgets and elements lost their default StyleSheets. How to keep
 default StyleSheets in cheldren elements? And how to disable ugly pink
 selection in buttons when I change it StyleSheets?
 
  Best regards,
  Nick
  ___
  Interest mailing list
  Interest@qt-project.org
  http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Qt and QML applications for NaCl

2012-02-23 Thread Николай Шатохин
Hello.

Is it possible to develop Google NaCl applications by Qt and with interface
by QML? Is it possible to port NaCl to other browsers, not only Google
Chrome and Chromium?

Best regards,
Nick
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest