Re: [Interest] Memory leak
Widget may be deleting itself when closed (for example if Qt::WA_DeleteOnClose qthelp://com.trolltech.qt.486/qdoc/qt.html#WidgetAttribute-enum flag is set ) which would be perfectly fine cool staff actually shows the widget one or another way. when std::shared_ptrWidget temp( new Widget () ); does not make any sense unless widget is modal and exec() is called in the same function. On Fri, Jun 12, 2015 at 7:02 AM, Igor Mironchik igor.mironc...@gmail.com wrote: And to avoid memory leak just give to the Widget the parent. And when parent will die he will delete your Widget. It's just as example... But to answer to your question more clearly we need to know some more details. Such as what widget is doing, when he should die, and so on... On 12.06.2015 16:57, Dmitry Volosnykh wrote: In your case the 'temp' object will be deleted upon quitting function foo(), so the signalTriggered() is never emitted. In previous version, it would have been living longer because of memory leak you mentioned. On Fri, Jun 12, 2015 at 4:52 PM, Berkay Elbir berkayel...@gmail.com wrote: Hello all; We recently joined a new project, which is full with idiom like: , void foo(){ Widget* temp = new Widget; connect(temp, Widget::signalTriggerred,[this, temp ]() { do cool staff... }} As you can see no delete nothing, I am afraid even user class Widget is inherited QObject, this is still a leak. Does QT do something fancy to prevent leek in case above? What I am planning to do: void foo { std::shared_ptrWidget temp( new Widget () ); connect(temp.get(), Widget::signalTriggerred,[this, temp] () { do even cooler things... }} Is there a problem with my apporach? (For example I didn't want to use .get() but compiler errors forced me to use it). Thanks in advance, BE ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing listInterest@qt-project.orghttp://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] VS2013
I do not care about binaries, which I used to build myself anyway. They are built once. But I do not want to lose 2010 support. When your code is dependent on different languages and 3rd party products you tend to stay on the old compilers for long time. Often you have to skip versions cause 3rd party introduced bug which often is fixed only 2 ore more versions after it was found ( my regards to INTEL Fortran compiler which allowed me to skip VS 2008 transition completely). Alex On Thu, Dec 12, 2013 at 1:17 PM, Thiago Macieira thiago.macie...@intel.comwrote: On quinta-feira, 12 de dezembro de 2013 21:17:56, Felix morack wrote: I think a lot of us windows guys want to move over to VS2013 (optimization bugs in VS2012 and all). Unfortunately, VS2013 wasnt released in time to have full support in Qt 5.2. VS2013 has been around for a while now, and code to update the VSAddon to support VS2013 has been reviewed, approved and merged into the respective master branch over a week ago, and is ready to ship. A lot of people, including myself, have been using 5.2RC with VS2013 successfully for some time now. Given all that, can we hope for a quick transition to 5.2.1, with VS2013 support in the online installer and a release of the VSAddon? We need to drop something else. Would people feel bad if we no longer provided binaries for VS 2010? -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ 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] QDataStream::version() -- safe to assume 8-bit?
Typically it is a not magic number, it is a magic string, which solves most problems. I would recommend to keep it this way. If you want to use number there, write it to string first. then write the string. Alex On Sat, Oct 26, 2013 at 6:49 PM, Constantin Makshin cmaks...@gmail.comwrote: Since QDataStream versions form a contiguous sequence of integer numbers and new ones are added in [some] minor Qt updates, I'd say you have a LOT of time before these numbers stop fitting into 7-8 bits. As for the magic number issue, you may store it *after* the stream version number -- if the version is wrong (i.e. larger than your application understands), there's no need to worry about the magic number because the stream should be considered unreadable anyway. On Oct 27, 2013 3:44 AM, Charley Bay charleyb...@gmail.com wrote: The QDataStream docs give examples on serializing for compatible formats across versions defined by QDataStream: http://doc-snapshot.qt-project.org/qdoc/qdatastream.html#setVersion Other examples on the web are similar, like: http://doc.qt.digia.com/qq/qq05-achtung.html The recommendation is something like: //--- //... QDataStream out(file); // Write a header with a magic number and a version out (quint32)0xA0B0C0D0; out (qint32)123; //--- Then, reading in is: //--- //...- QDataStream in(file); // Read and check the header quint32 magic; in magic; if (magic != 0xA0B0C0D0) return XXX_BAD_FILE_FORMAT; // Read the version qint32 version; in version; //--- QUESTION #1: Is it safe to write the 32-bit magic-number before reading-and-setting the QDataStream::version() ? It seems like these examples are not cross-platform, as the 32-bit value may have varying formats on different platforms. Other reading suggests that it is safe to assume QDataStream::version() wholly fits into an 8-bit value, so this should not be a problem with that value. QUESTION #2: Is it forever safe to assume an 8-bit value is sufficient to store QDataStream::version()? Because of my concern regarding #1, it seems like four magic-quint8 values should be serialized instead of one magic-quint32 value. Or, am I just paranoid? --charley P.S.: I'll close with the quote from the Digia page above because I found it funny: We have two choices, either to attack I/O now and get it over with, or to postpone I/O until near the end. Neither prospect is very attractive. -- Donald E. Knuth ___ 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] Cannot enable dragging from QAbstractItemModel
Did you try to set setDragDropMode of the tree view to QAbstractItemView::DragDrop? QAbstractItemView::InternalMove accepts only move operation from itself and does not accept copy. Regards, Alex On Tue, Oct 1, 2013 at 3:33 PM, Etienne Sandré-Chardonnal etienne.san...@m4x.org wrote: Dear all, After successfully enabling drag from a QAbstractListModel, I am trying to do the same with a tree model. Here is what I did: //In constructor: setSupportedDragActions(Qt::CopyAction); //Qt::ItemFlags Model::flags(const QModelIndex index) implementation return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled; I also implemented mimeData() , but it gets never called anyway. Dragging is not triggered, and items are only selected. I do not know what to do for enabling drag support? It works well with QAbstractListModel Thanks, Etienne ___ 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] QSettings possible bug on Windows
Thanks Scott for advices, - 10 times checked that there was no typo qdesktopservices do not provide path to common application data folder, only to user specific. Reason I guess that there is no such concept on unix derived systems. I finally did write an extension to it which on Windows returns value I am looking for basically it is call to SHGetSpecialFolderPath with CSIDL_COMMON_APPDATA parameter.and on Linux returns results obtained with QDesktopServices::DataLocation This is supposed to be a right way to dt it anyway (besides extending qdesktopservices which would be probably even better) , but it does not explain problem I see with QSettings Regards, Alex On Mon, Sep 30, 2013 at 8:17 PM, Scott Aron Bloom scott.bl...@onshorecs.com wrote: Two things.. ** ** **1) **Try doing a foreach( const QString child, reg.childKeys() ) and see, maybe there is a typo you are missing **2) **Take a look at the Qt source code for qdesktopservices_win.cpp It uses SHGetSpecialFolder to find the directories you are looking for. Scott ** ** *From:* interest-bounces+scott.bloom=onshorecs@qt-project.org [mailto: interest-bounces+scott.bloom=onshorecs@qt-project.org] *On Behalf Of *Alex Malyushytskyy *Sent:* Monday, September 30, 2013 7:02 PM *To:* interest@qt-project.org *Subject:* Re: [Interest] QSettings possible bug on Windows ** ** Just want to add that key is found, qDebug() child keys =reg.childKeys(); result in child keys = (Common Administrative Tools, Common AppData, Common Desktop, Common Documents, Common Programs, Common Start Menu, Common Startup, Common Templates, CommonMusic, CommonPictures, CommonVideo, OEM Links, Personal) but value returned is empty string - different from visible in regedit *** * Alex ** ** On Mon, Sep 30, 2013 at 6:24 PM, Alex Malyushytskyy alexmal...@gmail.com wrote: I found a problem with QSettings when trying to read from registry. I am using Qt 4.7.3 so I would appreciate if anybody can check with Qt 5 at least. Problem: QSettings fails to return specific key value (Common AppData) when read other keys at the same level just fine. Key exists and verified with regedit. Test case is below: #include QApplication #include QSettings #include QDebug void ddd2(); int main(int argc, char *argv[]) { // execute test and return QApplication a(argc, argv); ddd2(); ** ** return 0; } void ddd2() { QSettings reg(HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders, QSettings::NativeFormat); QString key; QString val; key = QString(Common AppData); val = QString ( reg.value(key).toString()); qDebug() key: key value: val; key = QString(Common Desktop); val = QString ( reg.value(key).toString()); qDebug() key: key value: val; key = QString(Common Documents); val = QString ( reg.value(key).toString()); qDebug() key: key value: val; } Output: key: Common AppData value: key: Common Desktop value: C:\Users\Public\Desktop key: Common Documents value: C:\Users\Public\Documents Expected * WinXP: c:\Documents and Settings\All Users\Application Data * WinV/7/8: c:\ProgramData Regards, Alex ** ** ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QGraphicsScene crashed after removeItem() and delete item
I am not using qt 5, but if I am not mistaken QGraphicsScene code was migrated from QT4 On Sun, Sep 22, 2013 at 8:56 AM, 程梁 devb...@outlook.com wrote: Hi, there! I have a problem: when I called QGraphicsScene::removeItem() then delete the removed item, my application crashed. This happens on Qt5 64bits (I tested on openSUSE with 5.1.1 and gcc 4.7.2) but not on Qt4. This is my code: void GameController::snakeAteFood(Snake *snake, Food *food) { scene.removeItem(food); delete food; addNewFood(); } If I remove the line delete food; everything is OK. But it will crash with this line. The Food::boundingRect() will not change but Snake::boundingRect() does so I did add prepareGeometryChange() function before it changed. I've no idea why this still crashed. Please help me. Thank you! Cheng Liang Nanjing, China http://www.devbean.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] What is different with the eventloop if I am setting Qt::WindowModal on Mac?
As far as I understand application event loop is not running until modal widget event loop is running. Closing the widget will start application event loop and you get your message printed. It would be worth if widget delete itself on closing, then you would have a crush. I guess comment in documentation stays there since QT 4.1. Alex On Thu, Sep 19, 2013 at 12:00 PM, Jenssen Tim tim.jens...@digia.com wrote: I had a confusing problem on Mac with Qt 4.8 and as a side note but it works with 5.2. If I start the following application I get the test print immediately after the start. If I start my test application with modal the test print, comes if I close the window. What is the cause? (Does it creates an own event loop on mac? why does it work on windows and linux?) #include QWidget #include QApplication #include QDebug class TestWidget : public QWidget { Q_OBJECT public: TestWidget() { QMetaObject::invokeMethod(this, printTest, Qt::QueuedConnection); } public slots: void printTest() { qDebug() test print; } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); TestWidget* myTest = new TestWidget(); if (a.arguments().contains(modal)) myTest-setWindowModality(Qt::WindowModal); myTest-show(); return a.exec(); } #include main.moc PS: In the documentation even in Qt 5.x There is some strange comment at WindowModality: This property only makes sense for windows. - which is not true, or I am wrong? ___ 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] 64 bit capable QVector
This question appears on the mailing lists since Qt 3 at least . At one point I was disappointed with having signed int restriction, but then I decided that QT containers are just a convenience classes which are designed to work with either widgets or data of limited size displayed by that widgets. If guaranteed performance is needed you should use STL anyway. Regards, Alex On Tue, Sep 3, 2013 at 11:58 AM, Constantin Makshin cmaks...@gmail.comwrote: Thanks for the explanation, although I still don't appreciate the choice (mostly regarding the size, not signedness). :) On 09/03/2013 10:48 PM, Thiago Macieira wrote: On terça-feira, 3 de setembro de 2013 22:18:39, Constantin Makshin wrote: Could you please explain (or give a link to an article or something like that) the reasons Qt developers used to choose signed 32-bit integer for this purpose? Signed 32-bit container sizes, i.e. number of elements in a container, would be acceptable (considering the equation 'n * sizeof(T)' for the amount of memory consumed by the array alone) but why use them to calculate and store sizes of allocated memory blocks? For two reasons: 1) it's signed because we need negative values in several places in the API: indexOf() returns -1 to indicate a value not found; many of the from parameters can take negative values to indicate counting from the end. So even if we used 64-bit integers, we'd need the signed version of it. That's the POSIX ssize_t or the Qt qintptr. This also avoids sign-change warnings when you implicitly convert unsigneds to signed: -1 + size_t_variable= warning size_t_variable - 1 = no warning 2) it's simply int to avoid conversion warnings or ugly code related to the use of integers larger than int. io/qfilesystemiterator_unix.cpp: size_t maxPathName = ::pathconf(nativePath.constData(), _PC_NAME_MAX); if (maxPathName == size_t(-1)) io/qfsfileengine.cpp: if (len 0 || len != qint64(size_t(len))) { io/qiodevice.cpp: qint64 QIODevice::bytesToWrite() const { return qint64(0); } return readSoFar ? readSoFar : qint64(-1); On 09/03/2013 08:42 PM, Thiago Macieira wrote: On terça-feira, 3 de setembro de 2013 19:33:47, Mehmet İpek wrote: Btw, size limit of QVector is 2^31 in 64 bit platforms too? Yes. All Qt container classes use a signed int for sizes. ___ 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] 64 bit capable QVector
STL is first of all an interface and there are various implementations, hence your remark about performances does not make sense. It does. All implementations of STL I ever used are clear about their effectiveness, associated types and complexity guarantees. Qt containers are far more than just convenience classes They are designed to work within Qt only. As far as I understand they never meant to be one of implementation or replacement of STL, thus it is not provided if not counted rare exceptions . Thus these are 'convenience' classes which provide sufficient in terms of data size and performance support of tasks common for Qt. I would add that Qt containers are designed to work with Qt widgets and carry the same limitations. And until it is impossible for example to fill QCombobox the number of items which exceeds capabilities of Qt container, it does not make sense to change the containers. But I disagree with 99.9% of Qt programmers don't need 64 bit containers. statement. It might be true for mobile devices , but it is false even for home desktops. Even if simply counting % of software which have to handle data exceeding 32 bit limit on the home personal computer you will get higher %. Rising of interest in distributed computing including visualization probably does not meant to solve problems with low memory requirements. I would expect most of the scientific programs need to support 64 bit containers even though sometimes they might need that support occasionally . Alex On Tue, Sep 3, 2013 at 2:55 PM, Philippe philw...@gmail.com wrote: ** I could easily guess 99.9% of Qt programmers don't need 64 bit containers... Qt containers are far more than just convenience classes. STL is first of all an interface and there are various implementations, hence your remark about performances does not make sense. Philippe On Tue, 3 Sep 2013 14:44:58 -0700 Alex Malyushytskyy alexmal...@gmail.com wrote: This question appears on the mailing lists since Qt 3 at least . At one point I was disappointed with having signed int restriction, but then I decided that QT containers are just a convenience classes which are designed to work with either widgets or data of limited size displayed by that widgets. If guaranteed performance is needed you should use STL anyway. Regards, Alex On Tue, Sep 3, 2013 at 11:58 AM, Constantin Makshin cmaks...@gmail.comwrote: Thanks for the explanation, although I still don't appreciate the choice (mostly regarding the size, not signedness). :) On 09/03/2013 10:48 PM, Thiago Macieira wrote: On terça-feira, 3 de setembro de 2013 22:18:39, Constantin Makshin wrote: Could you please explain (or give a link to an article or something like that) the reasons Qt developers used to choose signed 32-bit integer for this purpose? Signed 32-bit container sizes, i.e. number of elements in a container, would be acceptable (considering the equation 'n * sizeof(T)' for the amount of memory consumed by the array alone) but why use them to calculate and store sizes of allocated memory blocks? For two reasons: 1) it's signed because we need negative values in several places in the API: indexOf() returns -1 to indicate a value not found; many of the from parameters can take negative values to indicate counting from the end. So even if we used 64-bit integers, we'd need the signed version of it. That's the POSIX ssize_t or the Qt qintptr. This also avoids sign-change warnings when you implicitly convert unsigneds to signed: -1 + size_t_variable= warning size_t_variable - 1 = no warning 2) it's simply int to avoid conversion warnings or ugly code related to the use of integers larger than int. io/qfilesystemiterator_unix.cpp: size_t maxPathName = ::pathconf(nativePath.constData(), _PC_NAME_MAX); if (maxPathName == size_t(-1)) io/qfsfileengine.cpp: if (len 0 || len != qint64(size_t(len))) { io/qiodevice.cpp: qint64 QIODevice::bytesToWrite() const { return qint64(0); } return readSoFar ? readSoFar : qint64(-1); On 09/03/2013 08:42 PM, Thiago Macieira wrote: On terça-feira, 3 de setembro de 2013 19:33:47, Mehmet Ipek wrote: Btw, size limit of QVector is 2^31 in 64 bit platforms too? Yes. All Qt container classes use a signed int for sizes. ___ 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] 64 bit capable QVector
Forgot to add, I am not trying to offend performance or any other aspect of Qt container. Personally all my code related to displaying data use them. I just believe it is not replacement for STL. Regards, Alex On Tue, Sep 3, 2013 at 4:16 PM, Alex Malyushytskyy alexmal...@gmail.comwrote: STL is first of all an interface and there are various implementations, hence your remark about performances does not make sense. It does. All implementations of STL I ever used are clear about their effectiveness, associated types and complexity guarantees. Qt containers are far more than just convenience classes They are designed to work within Qt only. As far as I understand they never meant to be one of implementation or replacement of STL, thus it is not provided if not counted rare exceptions . Thus these are 'convenience' classes which provide sufficient in terms of data size and performance support of tasks common for Qt. I would add that Qt containers are designed to work with Qt widgets and carry the same limitations. And until it is impossible for example to fill QCombobox the number of items which exceeds capabilities of Qt container, it does not make sense to change the containers. But I disagree with 99.9% of Qt programmers don't need 64 bit containers. statement. It might be true for mobile devices , but it is false even for home desktops. Even if simply counting % of software which have to handle data exceeding 32 bit limit on the home personal computer you will get higher %. Rising of interest in distributed computing including visualization probably does not meant to solve problems with low memory requirements. I would expect most of the scientific programs need to support 64 bit containers even though sometimes they might need that support occasionally . Alex On Tue, Sep 3, 2013 at 2:55 PM, Philippe philw...@gmail.com wrote: ** I could easily guess 99.9% of Qt programmers don't need 64 bit containers... Qt containers are far more than just convenience classes. STL is first of all an interface and there are various implementations, hence your remark about performances does not make sense. Philippe On Tue, 3 Sep 2013 14:44:58 -0700 Alex Malyushytskyy alexmal...@gmail.com wrote: This question appears on the mailing lists since Qt 3 at least . At one point I was disappointed with having signed int restriction, but then I decided that QT containers are just a convenience classes which are designed to work with either widgets or data of limited size displayed by that widgets. If guaranteed performance is needed you should use STL anyway. Regards, Alex On Tue, Sep 3, 2013 at 11:58 AM, Constantin Makshin cmaks...@gmail.comwrote: Thanks for the explanation, although I still don't appreciate the choice (mostly regarding the size, not signedness). :) On 09/03/2013 10:48 PM, Thiago Macieira wrote: On terça-feira, 3 de setembro de 2013 22:18:39, Constantin Makshin wrote: Could you please explain (or give a link to an article or something like that) the reasons Qt developers used to choose signed 32-bit integer for this purpose? Signed 32-bit container sizes, i.e. number of elements in a container, would be acceptable (considering the equation 'n * sizeof(T)' for the amount of memory consumed by the array alone) but why use them to calculate and store sizes of allocated memory blocks? For two reasons: 1) it's signed because we need negative values in several places in the API: indexOf() returns -1 to indicate a value not found; many of the from parameters can take negative values to indicate counting from the end. So even if we used 64-bit integers, we'd need the signed version of it. That's the POSIX ssize_t or the Qt qintptr. This also avoids sign-change warnings when you implicitly convert unsigneds to signed: -1 + size_t_variable= warning size_t_variable - 1 = no warning 2) it's simply int to avoid conversion warnings or ugly code related to the use of integers larger than int. io/qfilesystemiterator_unix.cpp: size_t maxPathName = ::pathconf(nativePath.constData(), _PC_NAME_MAX); if (maxPathName == size_t(-1)) io/qfsfileengine.cpp: if (len 0 || len != qint64(size_t(len))) { io/qiodevice.cpp: qint64 QIODevice::bytesToWrite() const { return qint64(0); } return readSoFar ? readSoFar : qint64(-1); On 09/03/2013 08:42 PM, Thiago Macieira wrote: On terça-feira, 3 de setembro de 2013 19:33:47, Mehmet Ipek wrote: Btw, size limit of QVector is 2^31 in 64 bit platforms too? Yes. All Qt container classes use a signed int for sizes. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest
Re: [Interest] 64 bit capable QVector
While I don't want to say that STL is a bad thing (it's not bad at all), the fact that its allocators (and, as a consequence, everything that uses them) are by design very friendly to memory fragmentation (the allocate new block - copy data - free old block makes it completely impossible even to shrink a block of memory in-place) makes me a bit sad... You meant allocators used by default. Such problems can be solved by using custom allocators. Regards, Alex On Tue, Sep 3, 2013 at 4:55 PM, Constantin Makshin cmaks...@gmail.comwrote: While I don't want to say that STL is a bad thing (it's not bad at all), the fact that its allocators (and, as a consequence, everything that uses them) are by design very friendly to memory fragmentation (the allocate new block - copy data - free old block makes it completely impossible even to shrink a block of memory in-place) makes me a bit sad... On 09/04/2013 03:21 AM, Alex Malyushytskyy wrote: Forgot to add, I am not trying to offend performance or any other aspect of Qt container. Personally all my code related to displaying data use them. I just believe it is not replacement for STL. Regards, Alex On Tue, Sep 3, 2013 at 4:16 PM, Alex Malyushytskyy alexmal...@gmail.com mailto:alexmal...@gmail.com wrote: STL is first of all an interface and there are various implementations, hence your remark about performances does not make sense. It does. All implementations of STL I ever used are clear about their effectiveness, associated types and complexity guarantees. Qt containers are far more than just convenience classes They are designed to work within Qt only. As far as I understand they never meant to be one of implementation or replacement of STL, thus it is not provided if not counted rare exceptions . Thus these are 'convenience' classes which provide sufficient in terms of data size and performance support of tasks common for Qt. I would add that Qt containers are designed to work with Qt widgets and carry the same limitations. And until it is impossible for example to fill QCombobox the number of items which exceeds capabilities of Qt container, it does not make sense to change the containers. But I disagree with 99.9% of Qt programmers don't need 64 bit containers. statement. It might be true for mobile devices , but it is false even for home desktops. Even if simply counting % of software which have to handle data exceeding 32 bit limit on the home personal computer you will get higher %. Rising of interest in distributed computing including visualization probably does not meant to solve problems with low memory requirements. I would expect most of the scientific programs need to support 64 bit containers even though sometimes they might need that support occasionally . Alex On Tue, Sep 3, 2013 at 2:55 PM, Philippe philw...@gmail.com mailto:philw...@gmail.com wrote: I could easily guess 99.9% of Qt programmers don't need 64 bit containers... Qt containers are far more than just convenience classes. STL is first of all an interface and there are various implementations, hence your remark about performances does not make sense. Philippe On Tue, 3 Sep 2013 14:44:58 -0700 Alex Malyushytskyy alexmal...@gmail.com mailto:alexmal...@gmail.com wrote: This question appears on the mailing lists since Qt 3 at least . At one point I was disappointed with having signed int restriction, but then I decided that QT containers are just a convenience classes which are designed to work with either widgets or data of limited size displayed by that widgets. If guaranteed performance is needed you should use STL anyway. Regards, Alex On Tue, Sep 3, 2013 at 11:58 AM, Constantin Makshin cmaks...@gmail.com mailto:cmaks...@gmail.com wrote: Thanks for the explanation, although I still don't appreciate the choice (mostly regarding the size, not signedness). :) On 09/03/2013 10:48 PM, Thiago Macieira wrote: On terça-feira, 3 de setembro de 2013 22:18:39, Constantin Makshin wrote: Could you please explain (or give a link to an article or something like that) the reasons Qt developers used to choose signed 32-bit integer for this purpose? Signed 32-bit container sizes, i.e. number of elements
Re: [Interest] Strange undeletable QTemporaryFile. Is it a bug?
Technically, it is meant to be public. It closes the QIODevice so you can no longer read from it or write to it. Actually, isn't rely on the interface, not implementation the primary idea of inheritance? QIODevice::close() - closes the device when QTemporaryFile::close() truncates and repositions, but doesn't *close* the file. If you really want to close, destroy the object or force it to open a new file (with a new name). According to above, example below does not make sense cause you can't delete file after call to bar(). . Relying on interface is already broken. void bar (QIODevice zzz) { // ... zzz.close(); // Oops } void foo () { QTemporaryFile file; bar(file); } The whole problem is that QTemporaryFile::close() does not do what it is supposed to do. And I see only 2 ways to fix it: 1. Change the interface so user can't call function which is source of the problem. 2. Change implementation so close works as expected. Thiago said that this approach may have security issues. The only way to make it work would be for close() to unset the fileName() again. When open() is called again, it creates a new file name based on the template. Which is exactly what you don't want. I might be missing something , but I would can't see why not. If you say that lifetime of the temporary file (including name) is limited by opening and closing I do not see any security issues. It is also what I would expect temporary file to do by default. If user wants to deal with this file later he remember the file name before closing and disable autodelete. All functionality is there. This change might require user to change his code when upgrading if user relied on implementation though. Regards, Alex On Mon, Aug 26, 2013 at 8:57 PM, Constantin Makshin cmaks...@gmail.comwrote: The bar() function from that example may be part of a library that neither wants nor needs to know anything about specifics of the actual type of 'zzz'. Actually, isn't rely on the interface, not implementation the primary idea of inheritance? On 08/27/2013 02:36 AM, Alex Malyushytskyy wrote: Making function which were public in the parent, private in the child shows that function should not be called. That is it. And that is the case. It does not make it impossible to shoot yourself at the feet (whatever way you choose) and access it. You can do everything in C++. But if you do it, it is your problem and responsibility and you do not feel frustrated cause the behavior does not meet your expectations. QTemporaryFile::close () is not meant to be public. User have no use of it. Make it private and this question will not ever rise again. On Sun, Aug 25, 2013 at 4:02 AM, Constantin Makshin cmaks...@gmail.com mailto:cmaks...@gmail.com wrote: void bar (QIODevice zzz) { // ... zzz.close(); // Oops } void foo () { QTemporaryFile file; bar(file); } The function bar() may be replaced by anything that doesn't care what type I/O object to work with (e.g. QDataStream). Why the hell does a function close an object owned by something else? is another question, but the idea as a whole is simple and obvious -- if a function works with a base class (e.g. anything that can act as an I/O device, be it an actual file, memory buffer, etc.), the hint don't call this method because in one of derived classes it does not what the name implies doesn't work. On Aug 24, 2013 2:05 PM, Till Oliver Knoll till.oliver.kn...@gmail.com mailto:till.oliver.kn...@gmail.com wrote: Am 24.08.2013 um 09:46 schrieb Constantin Makshin cmaks...@gmail.com mailto:cmaks...@gmail.com: Overriding a public method to make it private doesn't make much sense because this restriction can be easily circumvented by casting the pointer/reference to a base class (explicitly or by passing it to a function, in the context of this thread, expects a QFile or even more generic QIODevice). Casting? Pointers? Why so complicated? C++ makes this easy for you: #define private public #include Foo.h There you go: all private members of class Foo have just become public! A hip hip horray for the preprocessor ;) Oh, by the way: should you feel the urge to pass on this tip to someone else: please don't mention my name, will you? ;) But on a more serious note: overriding a public method and make it private is more like a design decision and a strong hint to the caller not to call this member on that concrete class instance anymore: why not? Go read the docs! (And if you still feel like calling it: C++ offers you plenty of choices
Re: [Interest] Strange undeletable QTemporaryFile. Is it a bug?
Making function which were public in the parent, private in the child shows that function should not be called. That is it. And that is the case. It does not make it impossible to shoot yourself at the feet (whatever way you choose) and access it. You can do everything in C++. But if you do it, it is your problem and responsibility and you do not feel frustrated cause the behavior does not meet your expectations. QTemporaryFile::close () is not meant to be public. User have no use of it. Make it private and this question will not ever rise again. On Sun, Aug 25, 2013 at 4:02 AM, Constantin Makshin cmaks...@gmail.comwrote: void bar (QIODevice zzz) { // ... zzz.close(); // Oops } void foo () { QTemporaryFile file; bar(file); } The function bar() may be replaced by anything that doesn't care what type I/O object to work with (e.g. QDataStream). Why the hell does a function close an object owned by something else? is another question, but the idea as a whole is simple and obvious -- if a function works with a base class (e.g. anything that can act as an I/O device, be it an actual file, memory buffer, etc.), the hint don't call this method because in one of derived classes it does not what the name implies doesn't work. On Aug 24, 2013 2:05 PM, Till Oliver Knoll till.oliver.kn...@gmail.com wrote: Am 24.08.2013 um 09:46 schrieb Constantin Makshin cmaks...@gmail.com: Overriding a public method to make it private doesn't make much sense because this restriction can be easily circumvented by casting the pointer/reference to a base class (explicitly or by passing it to a function, in the context of this thread, expects a QFile or even more generic QIODevice). Casting? Pointers? Why so complicated? C++ makes this easy for you: #define private public #include Foo.h There you go: all private members of class Foo have just become public! A hip hip horray for the preprocessor ;) Oh, by the way: should you feel the urge to pass on this tip to someone else: please don't mention my name, will you? ;) But on a more serious note: overriding a public method and make it private is more like a design decision and a strong hint to the caller not to call this member on that concrete class instance anymore: why not? Go read the docs! (And if you still feel like calling it: C++ offers you plenty of choices ;)) Cheers, Oliver ___ 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] Strange undeletable QTemporaryFile. Is it a bug?
I can't say that I am very happy with a non-closing close() and a lying isOpen(). Even if documented, it goes against any expectations. I disagree, then You would have QTemporaryFile attached to file which is not anymore under control. This would be even more confusing and made documented features wrong: the file will subsequently be removed upon destruction of the QTemporaryFile object. Detaching could be made in close(), but in this case you leave useless now QTemporaryFile alive. I think current implementation is less alone prone. What can be done - I would override close just to make it private, so people do not call it. Regards, Alex On Fri, Aug 23, 2013 at 11:50 AM, Guido Seifert warg...@gmx.de wrote: open() means it succeeded in opening. QTemporaryFile::close() truncates and repositions, but doesn't *close* the file. If you really want to close, destroy the object or force it to open a new file (with a new name). Bah, stupid me. Wrong function. I meant of course 'isOpen()', sorry. Am I so wrong that I expect a 'true' when the file is still open? But, erm... yes... now that you say it, I can even find this behaviour in the docs: Reopening a QTemporaryFile after calling close() is safe. For as long as the QTemporaryFile object itself is not destroyed, the unique temporary file will exist and be kept open internally by QTemporaryFile. I can't say that I am very happy with a non-closing close() and a lying isOpen(). Even if documented, it goes against any expectations. Guido ___ 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] Default action for a QMenu added to a QToolBar
You can add any widget (QToolButton is a widget ) to toolbar with QAction ** addWidget qtoolbar.html#addWidget* ( QWidget * *widget* ) On Tue, Aug 20, 2013 at 11:03 AM, Etienne Sandré-Chardonnal etienne.san...@m4x.org wrote: Thanks Christoph, Is there any way to do this with a QToolBar? I cannot add a QToolButton to the toolbar (unless I missed something), as you add the menu directly using addAction (qMenu-menuAction()), and the QToolBar seems to miss this setting On the other hand, QToolBar is quite useful for me (auto display of a popup button if the toolbar is not large enough for all buttons, etc...) Thanks, Etienne 2013/8/20 Christoph Feck christ...@maxiom.de On Tuesday 20 August 2013 19:27:03 Etienne Sandré-Chardonnal wrote: Dear all, I inserted a QMenu to a QToolBar. This displays the menu icon, together with a drop-down arrow for opening the menu. Clicking the menu icon in the toolbar does nothing, as the menu action is connected to nothing. Is it possible to either: - Set the default child action that will be triggered when the main menu icon is clicked (setDefaultAction doesn't do the job) - Popup the menu when the main menu icon is clicked (as when clicking the dropdown arrow) Thanks, Etienne http://qt-project.org/doc/qt-4.8/qtoolbutton.html#ToolButtonPopupMode-enum ___ 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] QWidget::render iincluding the frame?
The only way I can think of is creating a widget which would be size of the dialog including dialog frame, reparent dialog and render that widget. If QWidget::DrawChildren render flag is set I expect it will draw dialog including frame. You might reparent it back later and do some positioning so y7ou do not see visual changes. Regards, Alex On Thu, Aug 15, 2013 at 11:42 AM, Scott Aron Bloom scott.bl...@onshorecs.com wrote: Is there any way to render the frame as well as the widget (assuming a QDialog) Scott ___ 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] QThread and QPixmap::grabWindow()
I guess my suggestion was not clear. Create a slot where: - QPixmap::grabWindow( QApplication::desktop()-winId() ); will be called. - QPixmap is converted to QImage - Signal and slot may contain reference to the QImage as a parameter, so you can access filled QImage after signal is emitted.. Connect custom signal from your threat to this slot using BlockingQueuedConnection. This will insure that your thread will wait until QImage is filled. Since QImage is device independent you may use it in other than GUI threads. Finally emit such signal instead instead of the code you posted. Keep in mind that it probably there is no any reason to take screenshots too often, especially when your target is desktop - you can't really make sure it is taken the moment you want it. GUI threat may be already doing something so you would have to wait. And since only GUI thread has to do it, it might make sense to have only 1 copy of screenshot which could be accessed by multiple threads. So I suggest to store it as QImage and the mentioned above slot should check the time pixmap was taken and current time , update it if it is needed ( if that was done at least 1sec ago?). Hope this helps, Alex On Thu, Aug 8, 2013 at 2:36 PM, Alexander Syvak alexander@gmail.comwrote: It's done as following, the thread wrapper (the class holding the QThread object and the pointer to be moved into the thread-worker) connects the class to be moved into the worker-thread with the main thread slot 'make_screenshot(pointer to the class which emits the signal)'. The main thread slot puts into the pointer the made screenshot. However, pictures are received are half damaged. When there's only one thread worker, the screenshots are OK. Any variants? 2013/8/8 Rainer Wiesenfarth rainer_wiesenfa...@trimble.com Am 08.08.2013 00:11, schrieb Alexander Syvak: [...] auto const this_thread = this-thread (); moveToThread (QApplication::instance()-**thread()); screenshot = QPixmap::grabWindow( QApplication::desktop()-**winId() ); moveToThread(this_thread); [...] I think you might have a problem in understanding threads and the thread context as used in Qt. moveToThread() does NOT change the thread the current code runs in! It only changes the target for events sent to this object. In your example, the thread that executes this-thread() is identical to the one that executes QPixmap::grabWindow(). You will have to implement synchronization between the main (GUI) thread and your workers. The workers send an event to the main thread each time they need a screenshot, the main thread picks up the event, takes the screenshot and sends an event back to the caller. The addressed worker thread then picks up this event and processes the screenshot. If you have only one worker, you might wrap up your processing in a single method and use QtConcurrent::run(). Best Regards / Mit freundlichen Grüßen Rainer Wiesenfarth -- Software Engineer | Trimble Imaging Division Rotebühlstraße 81 | 70178 Stuttgart | Germany Office +49 711 22881 0 | Fax +49 711 22881 11 http://www.trimble.com/**imaging/ http://www.trimble.com/imaging/ | http://www.inpho.de/ Trimble Germany GmbH, Am Prime Parc 11, 65479 Raunheim Eingetragen beim Amtsgericht Darmstadt unter HRB 83893, Geschäftsführer: Dr. Frank Heimberg, Hans-Jürgen Gebauer ___ 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] QThread and QPixmap::grabWindow()
As far as I understand you need to make sure that window is grabbed in the main thread. So the clean way to do it - do it in the main threat without changing affinity . and wait until picture is taken in the threat you need a picture at. This will also remove race conditions you are facing - your grabWindow might be called from different threads and more of that it might be called at the same time as painting occur, which should not happen. You can't avoid synchronization here. It is your choice through events. mutexes or signal/slots . I would personally prefer last with BlockingQueuedConnection. Regards, Alex On Wed, Aug 7, 2013 at 3:11 PM, Alexander Syvak alexander@gmail.comwrote: Hello, there's a need for each thread to make screenshots and to compare them with loaded picture using QImage. Since there's only on GUI thread, I moved the the thread context to the main thread to make the screenshot in there. Here's the code snipper from the worker-threads: QPixmap screenshot; try { auto const this_thread = this-thread(); moveToThread(QApplication::instance()-thread()); screenshot = QPixmap::grabWindow( QApplication::desktop()-winId() ); moveToThread(this_thread); screenshots.append(screenshot); // Compare it with the trigger if there was no match before. if ( !matched event_p event_p-get_trigger_path().size() images_comparator::cmp( screenshot.toImage(), QImage( event_p-get_trigger_path() ), pattern() ) ) { qDebug() !!! matched !!!; matched = true; However, the grabWindow returns null QPixmap always. Who knows how to achive what's needed here? ___ 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] click on QComboBox caused application to crash in Windows Server 2012
I remember having problem with combobox when QT was built as static libraries with static CRTs. That is was one of the reason we gave up on static builds, is it your case? Alex On Mon, Aug 5, 2013 at 6:53 PM, Mehrdad Momeny mehrdad.mom...@gmail.comwrote: Hi everyone, Recently I encountered a weird issue on Windows Server 2012, when user clicks on a Combo box to open it, it causes the application to crash, our app uses a specific stylesheet, but removing that stylesheet didn't change anything. We are using Qt 4.8.3 (I tried with 4.8.5 but no difference) and I didn't find anyone else (anyone who spoke about it on the internet) having this issue :/ Here is the back trace of crash which stops in line 2563 of qcombobox.cpp calling view()-scrollTo(view()-currentIndex(), ...) Generated by Visual Studio 2008 QtGuid4.dll!QComboBox::showPopup() Line 2563 + 0x2e bytesC++ QtGuid4.dll!QComboBox::mousePressEvent(QMouseEvent * e=0x00919f20) Line 2901 C++ QtGuid4.dll!QWidget::event(QEvent * event=0x00919f20) Line 8368 C++ QtGuid4.dll!QComboBox::event(QEvent * event=0x00919f20) Line 2873C++ QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver=0x08119788, QEvent * e=0x00919f20) Line 4557 + 0x11 bytes C++ QtGuid4.dll!QApplication::notify(QObject * receiver=0x08119788, QEvent * e=0x00919f20) Line 4100 + 0x2f bytesC++ QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver=0x08119788, QEvent * event=0x00919f20) Line 915 + 0x15 bytesC++ QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver=0x08119788, QEvent * event=0x00919f20) Line 234 + 0x38 bytes C++ QtGuid4.dll!QApplicationPrivate::sendMouseEvent(QWidget * receiver=0x08119788, QMouseEvent * event=0x00919f20, QWidget * alienWidget=0x08119788, QWidget * nativeWidget=0x00e89c08, QWidget * * buttonDown=0x709236ec, QPointerQWidget lastMouseReceiver={...}, bool spontaneous=true) Line 3166 + 0xe bytes C++ QtGuid4.dll!QETWidget::translateMouseEvent(const tagMSG msg={...}) Line 3365 + 0x2a bytes C++ QtGuid4.dll!QtWndProc(HWND__ * hwnd=0x002201de, unsigned int message=513, unsigned int wParam=1, long lParam=2818723) Line 1698 + 0xc bytes C++ Any idea what may be wrong here!? Thanks in advance, Mehrdad Momeny ___ 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] QLineEdit with a validator set
Check for intermediate state has to be done when user initiated action which needs a valid input at lineEdit. There is no universal solution. Normally it is but not limited to either Apply button clicked in the dialog or line edit losing focus. When you found when this should be done, add code which initiate validation. Regards, Alex On Wed, Jul 17, 2013 at 7:28 AM, Carl Schumann schum...@fnal.gov wrote: Hi, I have a text input that I would like to validate. So I am using a QLineEdit instance with a validator. The user can not type an invalid value, which is good. But users can type an intermediate value and type enter. When they do so I would like to report an error so the user knows the input was not accepted. It is not clear to me how to do this task, since the returnPressed signal is not emitted as a result of the input being invalid. Currently I am exploring making my own subclass of QLineEdit. Thanks for your time. Any ideas would be appreciated please. Sincerely, Carl Schumann ___ 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] bad_alloc raised : Amout of RAM available ?
Just my few cents: Is your application a 32-bit app? Under Windows, applications are restricted to 1.5 to 2 GB of memory even though the system has more available. This even includes running a 32-bit app on a 64-bit system. That is not exactly right. On Windows 32 , by default 32 bit application is restricted to max of 2 GB of memory for data. You can adjust system to use 3Gb , but this is unusual. This includes all memory and typically you can't get a continuous chunk of memory over 1.8 GB. At the same time (might depend on compiler options, if not mistaken for MVC it is /largeaddressaware ) the same 32 bit application running on Windows 64 bit can address up to 4 GB of data. A bit off-topic, but still: it's not a very good idea to make your application's behavior/logic dependent on amount of free memory reported by the system. Reasons: 1) most, if not all, modern OSes use delayed allocation strategy, so a successful malloc() or its equivalent doesn't guarantee you actually will be able to use that memory; 2) multitasking means there's always a chance that during the period between you request information about available RAM and try to use it another process will allocate some amount of memory for its own needs, causing your allocation to fail. My suggestion is either to: 1) use system's native functions to get total amount of memory and use it to determine the upper limit for your allication (e.g. never allocate more than 50% of RAM even if it's not used by anything else); There are cases when you need as much memory as system can provide, otherwise it is a good suggestion if your upper limit is not more than is allowed for process (This is really a concern for win32 ) . I would add that If you need more memory then RAM available it is usually better to manager swapping yourself, since usually it can be organized much more efficient for specific cases than general approach used by system. 2) enlarge your buffers when necessary until you get an out of memory signal in form of std::bad_alloc, NULL returned by an allocation function, etc.. I would not advice this. I see exception as a costly emergency feature which should never happen in normal situation. It is much better to avoid this, especially if you really need as much memory as you can get, cause looped allocation (until it fails) is slow. It is much better to test process memory once. Keep in mind that if you need a large continuous chunk of memory, that might be far away from available memory for process even at startup due to data from dll loaded, but Windows do provide sufficient information about memory usage to counter this.. Regards Alex On Mon, Jul 8, 2013 at 10:20 AM, Constantin Makshin cmaks...@gmail.comwrote: A bit off-topic, but still: it's not a very good idea to make your application's behavior/logic dependent on amount of free memory reported by the system. Reasons: 1) most, if not all, modern OSes use delayed allocation strategy, so a successful malloc() or its equivalent doesn't guarantee you actually will be able to use that memory; 2) multitasking means there's always a chance that during the period between you request information about available RAM and try to use it another process will allocate some amount of memory for its own needs, causing your allocation to fail. My suggestion is either to: 1) use system's native functions to get total amount of memory and use it to determine the upper limit for your allication (e.g. never allocate more than 50% of RAM even if it's not used by anything else); 2) enlarge your buffers when necessary until you get an out of memory signal in form of std::bad_alloc, NULL returned by an allocation function, etc.. On Jul 8, 2013 4:20 PM, qt.dan...@free.fr wrote: Using 4.8 under windows / mingw, I catch a std::bad_alloc exception raised somewhere, that I do not seem to have raised. At that point, there is still 66% of system memory available according to windows. 1) Is there a Qt way to programmatically monitor the amount of RAM yet available to the current process ? 2) Is there a standard way to debug this, in order to find where the exception was raised ? Quentin ___ 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] how to use QAction::changed() and doc missing
Connect changed to your custom slot where you will check if action changed the state, You will need somehow to get pointer to QAction and previous state there. There are multiple ways to do it. For example: You may subclass QAction, add variable which would keep previous enable state , add slot there. connect slot to the change signal before you set variable state in constructor. Add special signal enableStateChanged() trigger it in the mentioned slot if state changed. On Wed, Jul 3, 2013 at 10:24 AM, Vincent vincentb1...@gmail.com wrote: Hello, It seems that QAction::changed() is not documented (if I understand well what does it do) When clicking on the changed() links all across the following doc page, we are pointed to the What is this property description: http://qt-project.org/doc/qt-5.0/qtwidgets/qaction.html What I would like to do is to connect a slot to a signal that would be raised when the QAction is enabled/disabled. Do you know how to do that? Thanks, Cosmo ___ 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] Qt ifw, error message: Could not write installer configuration
If I run the installer by right clicking on it and select Run as administrator, the installation will finish without a problem. How can I make this work? Did not you mentioned how to fix a problem yourself? You have to run program which is changing files in system folders as an administrator, having administrator account is not enough.. Alex On Tue, Jul 2, 2013 at 7:51 AM, Niclas Karlsson niclas.karls...@xdin.comwrote: Hi, I'm using QT installer framework (the binary release 1.3.0) to distribute (offline) my Windows application. The default target directory is set to C:\Program files (x86)\MyApp. When I run the installer on a computer with windows 7 the User Account Control window is displayed right before any files will install. I Press Yes, and the installation continues. When the progressbar hits 99 % en error message is displayed; Could not write installer configuration to C:\Program files (x86)\MyApp/uninstall.ini: Access error, not the forward slash after MyApp (don't think this is the problem). If a make some investigations before I press the OK button in the error message, I can see that the installer installed the files to the correct directory. When I hit the OK button the installation is aborted and all files are removed again. If I run the installer by right clicking on it and select Run as administrator, the installation will finish without a problem. How can I make this work? Best regards, Niclas ___ 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] QIcon on/off doesn't work on QAction
First. Your code should create a memory leak. Cause addAction will make a copy of icon and you never delete result of colorize Look at declaration: QAction **addAction qtoolbar.html#addAction-5* ( const QIcon *icon*, const QString *text*, const QObject * *receiver*, const char * *member* )Second. You did not clarify what does not work means. Anyway my guess you should either set use QToolbar::setIconSize to the size of your pixmap or add compatible (by size ) pixmap to your icon. The icons you are using are definitely not compatible with default toolbar icon sizes, so at the best the enabled icon is auto scaled, then greyed and that what you may see, at the wrse you see no icon at all ( sorry too lazy to test). Regards, Alex On Tue, Jul 2, 2013 at 4:14 AM, Sensei sense...@gmail.com wrote: Dear all, I currently use a multiple QPixmap on a single QIcon to make the current button visible in a QButtonGroup. I use the following code: // Colorize! QIcon colorize(const QString pix) { QPixmap orig(pix), blue(orig.size()); blue.fill(QColor(64 - 32, 160 - 32, 255 - 32)); blue.setMask(orig.createMaskFromColor(Qt::transparent)); QIcon *i = new QIcon(); i-addPixmap(blue, QIcon::Normal, QIcon::On); i-addPixmap(orig, QIcon::Normal, QIcon::Off); return *i; } // Set the icon: it works perfectly toolbutton-setIcon(colorize(:/icons/do.png)); The code above works perfectly. A selected button is blue, an inactive one is gray (the normal icon). However, setting the icon in a QAction embedded in a QToolBar, doesn't: action = new QAction(colorize(:/icons/add_file.png), QString(), this); connect(action, SIGNAL(triggered()), this, SLOT(test())); toolbar-addAction(action); Is there something I'm missing? Might it be the color of the icon (dark gray) that can influence this behavior? Thanks! ___ 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] Desktop deployment
I just wanted to point that you must to deploy all dependencies not only Qt. You will have to deploy VC CRTs at least if your application has no other dependencies. Alex On Wed, Jun 19, 2013 at 8:21 AM, Yves Bailly yves.bai...@sescoi.fr wrote: Greetings all, Here's a maybe silly question, but I really couldn't find any valuable help from the documentation. Let's assume I'm creating an application, development and target platforms being Windows 7, using Visual C++. If I want to give my .exe file to someone, I usually have to give him an archive containing my .exe, *and* a copy of all the needed Qt's libraries, including the plugins. Taking care to don't forget the qt.conf file. So that the executable can be executed just by a double-click in the explorer. Until now, I was *manually* copying the needed *.dlls from Qt's directory to the directory in which my executable is build. Which can be quite cumbersome, to say the least, having to filter out the *.lib, *.pdb, the debug flavors, and so on. Is there any way to automatically copy the needed files in the right place? Some kind of deployment option (similar to what exists for Android), or even better, some magical variable or function to include in the project file and processed by qmake? Going further, let's assume my application depends on various libraries, also created and managed my myself and other collegues. How to make sure all the final *.lib, *.dll and so on are placed in the same folder? It's always possible to use the same target folder for in shadow building for several projects in QtCreator, but this doesn't seem easily movable from a developer to another. Is there any other solution, unless to manually adjust DESTDIR, DLLDESTDIR and the likes in the project file? Thanks for any hints. -- /- Yves Bailly - Software developer -\ \- Sescoi RD - http://www.sescoi.fr -/ The possible is done. The impossible is being done. For miracles, thanks to allow a little delay. ___ 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] Long menus on Windows
I will try to recall what I did once. Instantiate and add subclass of QWidgetAction to the menu. Such subclass had to instantiate your widget (better not to derive it from dialog). To do this override createWidget. Such widget can be any complex or simple widget. If not mistaken I had explicitly call setAutoFillBackground(true ) in a widget constructor. You would also have to close menu yourself as a reaction on appropriate events (for example item selection) for example in your widget when user selected item you might call Q_ASSERT( parentWidget()-inherits( QMenu ) ); parentWidget() -close() Hope this helps, Alex On Fri, May 31, 2013 at 3:24 PM, John Weeks j...@wavemetrics.com wrote: Alex- Thank you! You seem to be the only one that takes an interest in my peculiar questions. The dialog takes extra clicks- one to select a menu item that displays the dialog, then more clicks to interact with the dialog and click OK button. I agree that huge menus aren't great; I'm not sure where the big menu gets to be big enough to counteract the drawbacks of putting up a dialog. By the way you can always to make your dialog function like menu. That would be cool. Can you give me a pointer to get me started? Wait- I guess there really isn't any trickiness- just a button; when you click the button, the dialog goes up posititioned at the mouse click. Any accept or reject causes the dialog to disappear. I'll think seriously about that! -John Weeks ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Container members in abstract base class?
They are not. static_cast exists for purpose. On Wed, May 22, 2013 at 10:10 AM, Constantin Makshin cmaks...@gmail.comwrote: Well, C-style casts are still useful because, unlike dynamic_cast, they need neither RTTI nor run-time checks, making the compiled code somewhat smaller and faster. You just need to be very careful with them. :-) On May 22, 2013 8:52 PM, Jonathan Greig redteam...@gmail.com wrote: Thank you André. The dynamic_cast worked perfectly. I'm from a C background and have been doing C-style casts for years without any major problems. Apparently this guy has also:) http://stackoverflow.com/questions/28002/regular-cast-vs-static-cast-vs-dynamic-cast - Swyped from my droid. On May 22, 2013 9:21 AM, André Somers an...@familiesomers.nl wrote: Op 22-5-2013 16:03, Jonathan Greig schreef: BaseObject* base = (BaseObject*)item; if(base) { base-setObjectRubberPoint(**key, point); } The above looks suspicious. The cast you're doing here is unsafe. Your check on base on the second line is useless, as the C-style cast you're using doesn't do any checking. So, my suspicion is that your item isn't a BaseObject, and thus the method call you make into it is going to fail. Use a dynamic_castBaseObject*(**item) for your cast instead. That cast _ will_ result in a 0 pointer if the cast fails. André -- You like Qt? I am looking for collegues to join me at i-Optics! ___ 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] Increase width of tab in QTabWidget
You may create your own style. example can be found at: http://harmattan-dev.nokia.com/docs/library/html/qt4/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar You can specify left and right margins or minimum width for example. Regards, Alex On Thu, May 16, 2013 at 7:02 PM, Sujan Dasmahapatra sujan.dasmahapa...@gmail.com wrote: how can I incraese width of tab in QTabWidget?. Is it possible. Any suggestion is appreciated. -- Thanks Regards Sujan ___ 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] Unique - Hardware bound - ID
Some discouragement (from personal experience): - often systems have more then 1 network card and do not guarantee that they will return the same MAC addresses even after simple reboot (Windows XP as an example) not even counting different configurations. - I am not sure what Qt uses to receive MAC address , but assuming it uses native API, the same MAC address will be returned for any system which does not have a network card installed (or have it disabled in current configuration) Mentioned above should encourage do not rely solely on MAC address for computer identification. Regards, Alex On Wed, May 15, 2013 at 3:52 AM, Konrad Rosenbaum kon...@silmor.de wrote: ** On Tuesday 14 May 2013 22:27:23 Alex Malyushytskyy wrote: Such things are normally resolved using MAC address on any system, which is unique for every network adapter, But there always may be a system which does not have network adapter, have a few network adapters or does not let you to obtain MAC address unless you are a root (Linux) I do not think Qt support this, but if not counting some complications listed above, native for system code you will have to right is easy. You can get MAC addresses via QNetworkInterface::allInterfaces(). Some encouragement: 99.9% of all PCs and Laptops do have a network card and/or Wireless Interface. Unless you target the 0.1% of non-networked machines you can assume to have one (even if it is unconfigured). At the very least if your app has network access then you can assume ethernet (modem-only machines are exceedingly rare these days). Some words of caution: MAC addresses can be changed in software. Depending on your paranoia level you may not want to rely on them - in that case you may want to think about hardware dongles to secure your app. Konrad ___ 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] TableWidget size dynamically
Direct answer on your question will be ui.TableWidget-setColumnWidth(0,201); ui.TableWidget-setColumnWidth(1,120); ui.TableWidget-setColumnWidth(2,121); Ask yourself why you did not like solution above or your own solution and what you want to achieve. Then if you can't figure out how to implement this describe what you want to achieve and ask question how. Regards, Alex On Wed, May 15, 2013 at 3:08 AM, Sujan Dasmahapatra sujan.dasmahapa...@gmail.com wrote: I got a QTableWidget with 3 columns in it. How can I resize the columnwidth based on resizing my MainWindow. Currently I have set a fixed width for column using ui.TableWidget-setColumnWidth(0,200); ui.TableWidget-setColumnWidth(1,200); ui.TableWidget-setColumnWidth(2,200); Any help is highly appreciated. -- Thanks Regards Sujan ___ 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] Unique - Hardware bound - ID
UUIDs is not unique for hardware/system, so I doubt QUuid will help. Such things are normally resolved using MAC address on any system, which is unique for every network adapter, But there always may be a system which does not have network adapter, have a few network adapters or does not let you to obtain MAC address unless you are a root (Linux) I do not think Qt support this, but if not counting some complications listed above, native for system code you will have to right is easy. Regards, Alex On Tue, May 14, 2013 at 2:45 AM, Gopalakrishna Bhat gopalakb...@gmail.comwrote: Hi, On Tue, May 14, 2013 at 3:11 PM, Adrian Stern adrian.st...@screenfood.com wrote: Hello I'm looking for an easy way to get a unique ID for the system my software is running on. We need this ID to be absolutely unique so we can identify each running system and assing stuff to it. So far I found a few linux specific ways to get some IDs, which I think can be sufficient but surely not the best solution. e.g. demidecode, hdparm, sdparm, /proc/foo Is there a Qt-way of doing this stuff? Platform independent would be great but is not a must. If you know the right linux dependent way of doing this, help would be much appreciated. Please have a look at QUuid . http://qt-project.org/doc/qt-4.8/quuid.html Freundliche Grüsse / Best Regards / Meilleures salutations Adrian Stern Diese E-Mail und ihre Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anhänge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet. This e-mail and any attachments may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest With regards, Gopalakrishna -- My blog http://gkbhat.blogspot.com ___ 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] Oops! Somebody's got a bad case of dependency bloat!
* we expect that most people who build Qt from sources are Qt developers themselves (majority of users will download binaries and the stats prove it); Thiago, I afraid your expectations are wrong. My statement is totally based on my experience. Most of my Qt life I was a Qt commercial customer ( 8 of 10 years) and we always had to build Qt binaries for Windows. (That was also a reason we stopped paying for commercial support.) Most of the time Qt binaries were not available for all Microsoft compiler versions we were using. And I can still point to the discussion where you claimed that you will not build 64 bit binaries cause 64 Windows market does not exist even though we had such on our office computers for about 2 years and my son had it on his laptop. Current situation is not much better. Just look at Qt5 page these days. The only 64 bit version of binaries is available for download is Qt 5.0.2 for Windows 64-bit (VS 2012, 500 MB)http://download.qt-project.org/official_releases/qt/5.0/5.0.2/qt-windows-opensource-5.0.2-msvc2012_64-x64-offline.exe There is no binaries generated for the only 64 bit supported Windows platform (VS 2010 according http://qt-project.org/wiki/Qt_5.0) and 64 bit Windows is not even in the list of targeted platforms. Lifespan of our software can't be the same as lifespan of Qt. We still have have some products built with VS 2005, even though active development is done on VS 2010. Upgrading costs money and often does not provide any additional value to end customers. Often we simply can't upgrade cause other 3rd party products are not upgraded yet ( for example Fortran ). Above means multiple versions of Qt have to be built from the source. For example currently I have 8 versions of Qt 4.7.3 ( the last version we upgraded to) on my Windows desktop. it might be uncommon since often a team of developers work on a single product, but even in this case these days you will need both 32 and 64 bit versions per compiler used. Do not take me wrong. I think you do a perfect job on Qt development. I believe that Perl was brought in with consideration and can accept this. But I do not want you to have false expectations. Simplicity may make a difference between life and death. This is a reason we do not live in the Linux world yet. This may make a difference for the Qt future on Windows. Also I disagree with you about Windows not being a good development platform. I have not done any programming on MAC, but I've spend as much development time as I can on Windows having access to Linux on desktop and clusters, cause I find it much more developer friendly (in this case user friendly). VS provides 99% of the tools I ever needed for development and have the most convenient debugging features. Convenience of being able to build multiple configuration from a single source is a reason I still maintain VS projects together with qmake projects and use last only on Linux. Whatever is missing can be added for additional cost installing 3rd party software. You can get something similar on Linux, but at least product which provides comparable features we are using there cost more than VS subscription and definitely is more expensive than memory management solutions which can be integrated in VS. I might be not a typical developer, but I've spent a sufficient time working on both Windows and Linux. And I prefer VS for development. Best regards, Alex On Wed, Apr 10, 2013 at 12:02 PM, Thiago Macieira thiago.macie...@intel.com wrote: On quarta-feira, 10 de abril de 2013 11.55.24, Bob Hood wrote: No doubt you meant what you said. However, it hardly changes the fact that the one omitted is rather ubiquitous, regardless of your personal feelings about it. I have no love for Microsoft (especially after Windows 8), and I hate Apple and their ecosystem snobbery with a passion. However, as a commercial developer, I understand the need to support them as part of basic business practices. While I may curse them like a sailor privately, I never allow my prejudices to reach my customers through my product. Actually, it's pure statistics. Operating systems where Qt current is known to run: Windows Mac OS X Linux *BSD Solaris QNX The majority of those have Perl. And really, I installed ActivePerl on my IT-locked-down-and-virus-scanning laptop easily. I *really* do not understand what the big deal is -- was my experience atypical? If you want to build a hugely complex framework like Qt, with a million lines of code, please understand you'll need to get a beefy machine and install some dependencies. If you don't want to build, try using one of the pre-built binaries. Let me give you another important point: we're trying to make the source releases to be as close as the repositories on which we (Qt developers) develop Qt. Why? Here are a few reasons: * we expect that most people
Re: [Interest] Layout expanding not as I would like...
It might be better also to attach ui file, so people can really see the source. Possible problems as I can guess: - You do not have widget (top) layout which created. If this is a case in designer click outside red boxes and click pn create vertical layout icon. - You are trying to re-size dialog in 2 directions. Both directions matters, you might want to add resizer at the bottom to avoid scaling. Regards, Alex On Wed, Apr 10, 2013 at 5:20 AM, Etienne Sandré-Chardonnal etienne.san...@m4x.org wrote: The second image (showing the problem) is missing: http://imageshack.us/a/img577/7843/example2e.png Sorry, Etienne 2013/4/10 Etienne Sandré-Chardonnal etienne.san...@m4x.org Dear interest users, Another question about layouts. I have a few labels in a small table layout. This layout is nested in a horizontal layout with a spacer on the right. The Xn, Yn and Zn label policies are set to Fixed as this will never change in the app. The N/A labels will be updated to numbers by the app, so size is set to preferred. The following picture shows how resizing works: http://imageshack.us/a/img594/8161/example1m.png Then, I set the N/A labels to Expanding, and their maximum size to 75. When increasing the layout size, it starts working properly, the N/A label expands. But when reaching the maximum size of 75, now the layout expands everything by increasing its margins. I would expect to increase only the spacer as in the first image, as the maximum size is reached. How can I fix this behavior? Thanks, Etienne ___ 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] Layout expanding not as I would like...
It might be better also to attach ui file, so people can really see the source. Possible problems as I can guess: - You do not have widget (top) layout which created. If this is a case in designer click outside red boxes and click pn create vertical layout icon. - You are trying to re-size dialog in 2 directions. Both directions matters, you might want to add resizer at the bottom to avoid scaling. Regards, Alex On Wed, Apr 10, 2013 at 5:20 AM, Etienne Sandré-Chardonnal etienne.san...@m4x.org wrote: The second image (showing the problem) is missing: http://imageshack.us/a/img577/7843/example2e.png Sorry, Etienne 2013/4/10 Etienne Sandré-Chardonnal etienne.san...@m4x.org Dear interest users, Another question about layouts. I have a few labels in a small table layout. This layout is nested in a horizontal layout with a spacer on the right. The Xn, Yn and Zn label policies are set to Fixed as this will never change in the app. The N/A labels will be updated to numbers by the app, so size is set to preferred. The following picture shows how resizing works: http://imageshack.us/a/img594/8161/example1m.png Then, I set the N/A labels to Expanding, and their maximum size to 75. When increasing the layout size, it starts working properly, the N/A label expands. But when reaching the maximum size of 75, now the layout expands everything by increasing its margins. I would expect to increase only the spacer as in the first image, as the maximum size is reached. How can I fix this behavior? Thanks, Etienne ___ 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] Layout expanding not as I would like...
It might be better also to attach ui file, so people can really see the source. Possible problems as I can guess: - You do not have widget (top) layout which created. If this is a case in designer click outside red boxes and click pn create vertical layout icon. - You are trying to re-size dialog in 2 directions. Both directions matters, you might want to add resizer at the bottom to avoid scaling. Regards, Alex On Wed, Apr 10, 2013 at 5:21 PM, Alex Malyushytskyy alexmal...@gmail.comwrote: It might be better also to attach ui file, so people can really see the source. Possible problems as I can guess: - You do not have widget (top) layout which created. If this is a case in designer click outside red boxes and click pn create vertical layout icon. - You are trying to re-size dialog in 2 directions. Both directions matters, you might want to add resizer at the bottom to avoid scaling. Regards, Alex On Wed, Apr 10, 2013 at 5:20 AM, Etienne Sandré-Chardonnal etienne.san...@m4x.org wrote: The second image (showing the problem) is missing: http://imageshack.us/a/img577/7843/example2e.png Sorry, Etienne 2013/4/10 Etienne Sandré-Chardonnal etienne.san...@m4x.org Dear interest users, Another question about layouts. I have a few labels in a small table layout. This layout is nested in a horizontal layout with a spacer on the right. The Xn, Yn and Zn label policies are set to Fixed as this will never change in the app. The N/A labels will be updated to numbers by the app, so size is set to preferred. The following picture shows how resizing works: http://imageshack.us/a/img594/8161/example1m.png Then, I set the N/A labels to Expanding, and their maximum size to 75. When increasing the layout size, it starts working properly, the N/A label expands. But when reaching the maximum size of 75, now the layout expands everything by increasing its margins. I would expect to increase only the spacer as in the first image, as the maximum size is reached. How can I fix this behavior? Thanks, Etienne ___ 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] Layout expanding not as I would like...
I am sorry for multiple posts. Something happened to my gmail and it was not shoring any reaction on Send button click, and I was clicking and clicking On Wed, Apr 10, 2013 at 5:21 PM, Alex Malyushytskyy alexmal...@gmail.comwrote: It might be better also to attach ui file, so people can really see the source. Possible problems as I can guess: - You do not have widget (top) layout which created. If this is a case in designer click outside red boxes and click pn create vertical layout icon. - You are trying to re-size dialog in 2 directions. Both directions matters, you might want to add resizer at the bottom to avoid scaling. Regards, Alex On Wed, Apr 10, 2013 at 5:21 PM, Alex Malyushytskyy alexmal...@gmail.comwrote: It might be better also to attach ui file, so people can really see the source. Possible problems as I can guess: - You do not have widget (top) layout which created. If this is a case in designer click outside red boxes and click pn create vertical layout icon. - You are trying to re-size dialog in 2 directions. Both directions matters, you might want to add resizer at the bottom to avoid scaling. Regards, Alex On Wed, Apr 10, 2013 at 5:20 AM, Etienne Sandré-Chardonnal etienne.san...@m4x.org wrote: The second image (showing the problem) is missing: http://imageshack.us/a/img577/7843/example2e.png Sorry, Etienne 2013/4/10 Etienne Sandré-Chardonnal etienne.san...@m4x.org Dear interest users, Another question about layouts. I have a few labels in a small table layout. This layout is nested in a horizontal layout with a spacer on the right. The Xn, Yn and Zn label policies are set to Fixed as this will never change in the app. The N/A labels will be updated to numbers by the app, so size is set to preferred. The following picture shows how resizing works: http://imageshack.us/a/img594/8161/example1m.png Then, I set the N/A labels to Expanding, and their maximum size to 75. When increasing the layout size, it starts working properly, the N/A label expands. But when reaching the maximum size of 75, now the layout expands everything by increasing its margins. I would expect to increase only the spacer as in the first image, as the maximum size is reached. How can I fix this behavior? Thanks, Etienne ___ 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] Interest Digest, Vol 19, Issue 41
Danny, I have not tried LLDB and I am not sure it will support all languages we need, but TotalView (debugger we were using on Linux) which is providing close to VS features for debugging (but decently support multi-threading debugging) cost 3 times more than VS Professional Edition (not upgrade which is cheaper ). I work with VS2005, 2008 and 2010 on a daily basis. I do not remember a single crash. But each software has bugs. We are not talking about bugs right now. I could keep talking about features I prefer in VS, could try to show you that environment for development on Linux and Windows would cost you about the same if you want a comparable decent features as far as I see them: - compiler - debugger - memory management tool - source control ( we actually do not use Microsoft solution for such purpose ) Something Linux/Windows has out of the box, something does not. If you do not mind to download software these days you can get a decent development environment for free. I would prefer to have Valgrind on Windows, but absence of its version on Windows was not a valid reason to consider Windows a bad platform for development. I think that if you pay money you can get better development environment on Windows. For comparable money you can get similar environment on Windows and Linux. And cost of such environment will be cheaper then on Mac (satisfied? :) ) I once considered to try my skills there and when I calculatex expected cost I decided I could live without it. Finally, if you do a serious development you can't avoid developing/debugging/profiling on the platform you going to deliver. Even if you use cross-platform tools like Qt, platform differences did not magically disappear, they are just hidden, So even if you do not like platform, you will have to deal with it, if you want Qt to be on it. You have more problems on Windows and are less efficient on Linux? Ok, I am more efficient on Windows. It may or may not change in the future. Does it make any platform of any of us bad or good? I do not think so, even if you are in the most tasks better than me, I bet there some when I am better. The same can be said about platform. We are just different. I wish I've spent time writing this response with my family Best regards and good night, Alex On Wed, Apr 10, 2013 at 6:48 PM, Michael Jackson imikejack...@gmail.comwrote: On Apr 10, 2013, at 8:23 PM, Danny Price deepblue...@googlemail.com wrote: The one thing that VS does well is debugging but that's changing now thanks to LLDB. And when will QtCreator support LLDB? I would love to be able to actually debug vectors, maps, sets, QString on OS X. Saves me the trip to Visual Studio. MJ. ___ 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] QSqlDatabase left open
Do you say QStringList qstringlist.html QSqlDatabase::connectionNames () returns anything after QSqlDatabase::close is called? I believe in Qt 4.6 it worked on Windows. You may try QSqlDatabase::removeDatabase but it may cause some resource leeks if there are open queries. Regards, Alex On Thu, Apr 4, 2013 at 5:11 PM, Scott Aron Bloom scott.bl...@onshorecs.comwrote: In Qt 4, is there a way to FORCE close all sql database connections… ** ** Use sqlite, even calling QSqlDatabase::close does not cause all connections to close… ** ** Any thoughts on forcing it to just close every connection… Scott ___ 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] QMainWindow::restoreState : where to call it?
It is supposed to be no difference when restore state as soon as all children (toolbars, etc) are created already. Also if you are using QSettings to save/load state make sure you already set atributes to QSettings so it is written/read from the same location. Regards, Alex On Wed, Mar 20, 2013 at 9:14 AM, Scott Aron Bloom scott.bl...@onshorecs.com wrote: Post some code showing where you are using it in the constructor… I use it in mine and it works fine. From: interest-bounces+scott.bloom=onshorecs@qt-project.org [mailto:interest-bounces+scott.bloom=onshorecs@qt-project.org] On Behalf Of Etienne Sandré-Chardonnal Sent: Wednesday, March 20, 2013 6:05 AM To: Interest@qt-project.org Subject: [Interest] QMainWindow::restoreState : where to call it? Dear all, I want to use QMainWindow::restoreState for restoring window dock widgets. saveState works well in closeEvent (I have some data in the registry wrote with QSettings). restoreState does not work when called from the constructor (nothing is restored) I have googled for this, most people put it in showEvent. But showEvent is called also when the window gets restored after being minimized, the docks should not be restored then! What is the best way to use it? The documentation is lacking a clear example (or I did not find it) Thanks! Etienne ___ 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] Multiple windows app modal?
It might be different guidelines for different system, but the only restriction I would expect from top level disabled window is that it cannot receive input from the user. And it is supposed to be able to become active cause you might need to move the window. If in your case it seems unreasonable you may play with focus policy (change it on top enablining/disabling) , overrode focusIn, focusOut function or install custom event handler. Regards, Alex On Tue, Mar 12, 2013 at 1:16 PM, Scott Aron Bloom scott.bl...@onshorecs.com wrote: By looking at the attached.. I would be confused by the “grayed out” buttons on the graph windo… In general, having a window you cant close, or minimize or move (all available by a windows menubar menu) would be disconcerting… Thouigh you could try changing the window constructor windows flags to get a different type of title bar to satisfy your needs.. There is a windows flag demo/example in the Qt distro to play with. ** ** But what I mean, is for the top level widget, have a single frame child that is vertically (or horizontally) layed out with zero margins. And name the QFrame.. If you then frame-setEnabled( false) all children would be disabled. ** ** You may need to change/update the style for the disabled children to NOT look disabled. ** ** scott ** ** *From:* John Weeks [mailto:j...@wavemetrics.com] *Sent:* Tuesday, March 12, 2013 12:48 PM *To:* Qt Project *Cc:* Scott Aron Bloom *Subject:* Re: [Interest] Multiple windows app modal? ** ** Thanks, Scott. I appreciate the thoughtful comments I've been getting. I think by now I know about enough about Qt to be dangerous :) ** ** On 12-Mar-2013, at 11:27 AM, Scott Aron Bloom wrote: Rather than disable the window (which I could see the being tons of reasons not to do) ** ** Could you elaborate? why not just disable a top level background frame or group box? ** ** I'm afraid I don't quite understand. The windows in question are top-level windows (that is, real OS windows). ** ** In case it's of interest: ** ** I have attached a screen shot of a demo of the feature. It happens to be taken on a Macintosh, but could be on Windows. Hopefully one day it could on Linux. ** ** The window labelled Pause for Cursor is a window created by user code. In a real application, our users often create wonderfully complicated panels packed to the gills with various kinds of controls. The idea here is that the circle and box markers on the graph indicate a region of interest in the graphed data. The control panel waits for the user to adjust the positions of the markers; when the user clicks Continue, analysis code (also user-written) can analyse the marked region of interest. ** ** There may be other graphs, tables, and other kinds of windows present. Think of our application as a numerical analysis IDE. ** ** -John Weeks ** ** ___ 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] Multiple windows app modal?
I guess comment below was meant to send to mailing list. On Mon, Mar 11, 2013 at 3:46 PM, John Weeks j...@wavemetrics.com wrote: On 05-Mar-2013, at 5:02 PM, Alex Malyushytskyy wrote: Remember you can always disable any window at any time and leave only desired windows accessible to user. And so I tried calling QWidget::setEnabled(false) on the top-level widget for windows that I want to not be active. The contents do turn gray, and mouse clicks in those windows are blocked. But still the windows are activated (the window buttons are colored and the frames appear activated) and they come to the top. To me, this is unexpected! -John ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Multiple windows app modal?
I believe your case is outside of the normal usage pattern of modal windows/dialogs. Remember you can always disable any window at any time and leave only desired windows accessible to user. Alex On Mon, Mar 4, 2013 at 5:06 PM, John Weeks j...@wavemetrics.com wrote: I have a need to make a group of windows behave in an app modal fashion, while being mutually non-modal. That is, the GUI in each of this group of windows is still responsive, but nothing should be allow in windows that aren't part of this group. I'm part of the way there by running a private event loop and event filter. The event filter blocks events for windows that aren't in the group (returns true for those events) and allows them (returns false) if the target window is one of the windows in the group. But there is (at least) one flaw- other windows can be activated. That is, they appear activated, but since I'm blocking any mouse and key events, they don't do anything. I'm wondering how Qt achieves the high-quality window modality that they use for a dialog. Or is it just that window modality is something that both Windows and Mac provide as an OS service, but what I want is not? Thanks to all! -John An IgorWindow is a class w use to encapsulate the parts of a window that are special to our application. bool PauseForUserObject::eventFilter(QObject *watched, QEvent *event) { Q_UNUSED(watched); bool result = false; // means don't block this event // This seems fragile. I have gone through the event type definition in qcoreevent.h and I am blocking // all the events that sound like GUI interaction events. if (event-type() == QEvent::MouseButtonPress || event-type() == QEvent::MouseButtonRelease || event-type() == QEvent::MouseMove || event-type() == QEvent::KeyPress || event-type() == QEvent::KeyRelease || event-type() == QEvent::Wheel || event-type() == QEvent::DragEnter || event-type() == QEvent::DragMove || event-type() == QEvent::DragLeave || event-type() == QEvent::Drop || event-type() == QEvent::DragResponse) { IgorWindow * watchedWindow = IgorWindowFromQObject(watched); if (watchedWindow == NULL) result = true; // block it else { result = !_windowIsRelatedToInterestingWindow(watchedWindow); } } if (event-type() == QEvent::Paint) result = false; // allow paint events for any window. if (event-type() == QEvent::ContextMenu || event-type() == QEvent::MouseButtonDblClick || event-type() == QEvent::InputMethod || event-type() == QEvent::TabletMove || event-type() == QEvent::TabletPress || event-type() == QEvent::TabletRelease || event-type() == QEvent::OkRequest || event-type() == QEvent::HelpRequest || event-type() == QEvent::IconDrag || event-type() == QEvent::Shortcut || event-type() == QEvent::ShortcutOverride || event-type() == QEvent::WhatsThisClicked || event-type() == QEvent::EnterWhatsThisMode || event-type() == QEvent::LeaveWhatsThisMode || event-type() == QEvent::HoverEnter || event-type() == QEvent::HoverLeave || event-type() == QEvent::HoverMove || event-type() == QEvent::NonClientAreaMouseMove || event-type() == QEvent::NonClientAreaMouseButtonPress || event-type() == QEvent::NonClientAreaMouseButtonRelease || event-type() == QEvent::NonClientAreaMouseButtonDblClick || event-type() == QEvent::GrabMouse || event-type() == QEvent::UngrabMouse || event-type() == QEvent::GrabKeyboard || event-type() == QEvent::UngrabKeyboard || event-type() == QEvent::TouchBegin || event-type() == QEvent::TouchUpdate || event-type() == QEvent::TouchEnd ) { result = true; // block this event } return result; // this block EVERYTHING } ___ 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] Qt VS Addin
Digia had plans to add Qt4 support according to link below: http://blog.qt.digia.com/blog/2012/12/19/visual-studio-add-in-1-2-0-for-qt-5-released/ Alex On Fri, Mar 1, 2013 at 4:56 AM, Duane duane.heb...@group-upc.com wrote: On 12/10/2012 02:41 AM, Haataja Ismo wrote: Hi! Will there be a VS addin for VS 2012 and Qt4? I've asked this before but with no response. Is there a better place to ask this question? Sorry about no response to the question earlier... There will be a VS-addin release for Qt4/VS2012 out at some point. This is the plan anyway. I can't confirm schedule for this but hopefully soon after we have final version of VS-addin for Qt5 ready and out. Does anyone know if the VS-addin for Qt4/VS2012 is available yet? Last one I tried was only for Qt5. ___ 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 remove QGraphicsEllipseItem from parent
Is it still shown if you force graphics window to update (might be just by minimizing/ maximizing or resizing) ? If not it means that scene was not updated and you can fix it calling QGraphicsScene::update yourself. Alex On Sun, Feb 24, 2013 at 5:00 AM, tang ke ta...@lemote.com wrote: On 02/24/2013 07:56 PM, Vincent Cai wrote: Dear All, I have a QGraphicsEllipseItem whose parent is a QGraphicsRectItem which is shown on a scene. When I delete the QGraphicsEllipseItem, why it is still shown on the scene? How can I remove it from the scene? Thanks, Vincent. This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest You can get the answer from the qt doc. Good luck. -- 应用部 唐科 TEL : 0512-52308661-88686 FAX: 0512-52308688 MP : 18962393077 E-mail: ta...@lemote.com 地址:江苏省常熟市虞山镇梦兰工业园 ___ 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] DSLR Remote Pro for windows
Your main problem will be not GUI, it will be technical details on how to control Cannon cameras. I would advice you to check other that QT forum sources, cause it is not right place to ask such questions. For example: http://www.usa.canon.com/cusa/consumer/standard_display/sdk_homepage Google rocks. Alex ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Qt Installer Framework
I see same behavior in an INNO Setup, however MSI behaves different - it doesn't allow to install program twice. It all depends on the design of your installation: product and package codes. You can have multiple products with the same name ( for example different version of the products ) installed on the same computer and function without any problem if they have different GUID. Regards, Alex ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QGraphicsScene crash after removeItem() and delete item
It is mostly likely related it is related to improper code in QGraphicsItem subclass which probably did not call QGraphicsItem::prepareGeometryChange() as Pierre mentioned before. Alex On Wed, Dec 5, 2012 at 5:29 PM, Jan Kundrát j...@flaska.net wrote: On Thursday, 29 November 2012 12:33:58 CEST, Volker Poplawski wrote: while (not m_items.isEmpty()) { QGraphicsItem *item = m_items.takeFirst(); m_scene-removeItem(item); // qtdoc says it's faster to remove item first then delete delete item; } When you call removeItem, its children are removed from the scene as well; when you delete it, these children will be deleted immediately, too. Are you sure that none of the items in your m_items is a child of any item present earlier in that list? Have you tried to run your program under valgrind? And as a style suggestion, it might be better to rework the loop like this: Q_FOREACH(QGraphicsItem *item, m_items) { m_scene-removeItem(item); delete item; } m_items.clear(); QList very likely doesn't have much overhead even when used in this way, but it feels wrong to keep deleting a first item from a container which is not a linked list. The interesting things is that without the removeItem() call, i.e. just calling delete on the items, my program does not crash. This is interesting. Cheers, Jan ___ 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] HierarchicalHeaderView for a QTableView
As far as I understand cell either is hierarchical or not. If it is hierarchical it must have a root (otherwise it can be presented by a few regular cells). I just briefly played with the code, but I was able to get both regular and hierarchical sections, so I am not sure I understood your question. Alex On Tue, Nov 13, 2012 at 7:03 AM, Alex Strickland s...@mweb.co.za wrote: Hi I downloaded this: http://qt-apps.org/content/show.php?content=103154 It seems quite nice to allow hierarchical headers for a QTableView, but it looks like the hierarchy must always have a root. I am trying to add multiple root columns, or alternately hide the root row/column. Actually if I replace: QStandardItem* rootItem = new QStandardItem(root); with: QStandardItem* rootItem = new QStandardItem(); the root row header is hidden, but not the root column row header. Any ideas? -- Regards Alex ___ 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] Dependency Injection
http://en.wikipedia.org/wiki/Dependency_injection On Thu, Nov 8, 2012 at 12:44 PM, Yunior Bauta Pentón ypen...@uci.cu wrote: Hello. What is Dependency Injection Framework more used actually to Qt and C++ ? Any sample ? Thank -- Ing. Yunior Bauta Pentón Dpto: PostgreSQL/DATEC Universidad de las Ciencias Informáticas http://postgresql.uci.cu http://www.uci.cu/ ___ 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] Spell checking.
Since combobox is using QLineEdit for editing, it provides a pointer to it with: QLineEdit * QComboBox::lineEdit () const Also you force it to use QLineEdit subclass with setLineEdit() Alex On Wed, Oct 31, 2012 at 10:07 AM, Bill Crocker william.croc...@analog.com wrote: Hello: I am adding spell checking to my application. I have the spell checking engine. I can see how to use the QSyntaxHighlighter to to underline words that are spelled incorrectly in a QTextEdit. I understand that I can configure a QTextEdit to behave as a single line widget for use in place of a QLineEdit. But, how do I add spell checking to the single line QLineEdit of a QComboBox? Thanks. Bill ___ 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] Can't get menu with QWidgetAction to close after click! (Mac OS 10.6.8, Qt 4.8.3)
On Windows, QT 4.7 it works as as expected. I guess problem is specific to MAC Alex On Tue, Oct 9, 2012 at 3:39 PM, Jim Prouty j...@wavemetrics.com wrote: On Oct 9, 2012, at 12:31 PM, Stephen Chu wrote: Are you sure you want a push button or a text entry field in the menu from the menu bar? It's, hmm, very different way of building an UI. Especially on a Mac. That's only a test program; the real application has a color swatch in the widget that gets clicked. But the issue is the same (and this sample code is simpler): after interacting with the QWidgetAction inserted into a menu, how can I get the menu to go away? Clicking in a normal action (menu item) dismisses the menu after emitting triggered(). I'd like the same behavior for my QWidgetAction, but it just sits there like a bump on a log whether it contains a button or a color swatch. --Jim Jim How does it work? Prouty Voice: (503) 620-3001, FAX: (503) 620-6754 Makers of IGOR Pro, scientific data analysis and graphing for Mac and PC http://www.wavemetrics.com ___ 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] Can't get menu with QWidgetAction to close after click! (Mac OS 10.6.8, Qt 4.8.3)
By the way try to call QAction-trigger(); in _onPushButton(bool b) If MAC implementation depends on this signal it definitely should solve the problem. By default QWidgetAction does not call it: Note that it is up to the widget to activate the action, for example by reimplementing mouse event handlers and calling QAction::trigger(). Alex On Tue, Oct 9, 2012 at 5:23 PM, Alex Malyushytskyy alexmal...@gmail.com wrote: On Windows, QT 4.7 it works as as expected. I guess problem is specific to MAC Alex On Tue, Oct 9, 2012 at 3:39 PM, Jim Prouty j...@wavemetrics.com wrote: On Oct 9, 2012, at 12:31 PM, Stephen Chu wrote: Are you sure you want a push button or a text entry field in the menu from the menu bar? It's, hmm, very different way of building an UI. Especially on a Mac. That's only a test program; the real application has a color swatch in the widget that gets clicked. But the issue is the same (and this sample code is simpler): after interacting with the QWidgetAction inserted into a menu, how can I get the menu to go away? Clicking in a normal action (menu item) dismisses the menu after emitting triggered(). I'd like the same behavior for my QWidgetAction, but it just sits there like a bump on a log whether it contains a button or a color swatch. --Jim Jim How does it work? Prouty Voice: (503) 620-3001, FAX: (503) 620-6754 Makers of IGOR Pro, scientific data analysis and graphing for Mac and PC http://www.wavemetrics.com ___ 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] QTextStream: output representation of floating point number with exactly n digits
setRealNumberNotation ( QTextStream::ScientificNotation ) with setRealNumberPrecision() to specify number of digits? Alex On Fri, Oct 5, 2012 at 3:59 PM, Rui Maciel rui.mac...@gmail.com wrote: Is it possible to manipulate QTextStream so that it outputs a representation of a float or a double with exactly n digits? I've tried setRealNumberPrecision() but it doesn't appear to have any effect. Thanks in advance, Rui Maciel ___ 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 run 21 threads concurrently
Why do you need Threads[th].cancel();? According to documentation not only the QFuture returned by QtConcurrent::run() does not support canceling,..., but I do not see any reason you could want to do this. Alex On Thu, Oct 4, 2012 at 6:25 AM, André Somers an...@familiesomers.nl wrote: Op 4-10-2012 15:21, Sujan Dasmahapatra schreef: I am not able to run my threads concurrently please help. How can I run 21 threads concurrently and get the job done by 8 cpus what I have in my machine. I am doing like this [code] std::vectorQFuturevoid Threads; QFuturevoid Th; for(int z=0; z21; z++) { Th = QtConcurrent::run(this,UnrstParser,z); Thraeds.push_back(Th); } for(int th=0; thThreads.size(); th++) { if(Threads[th].isRunning()) Threads[th].waitForFinished(); Threads[th].cancel(); } Threads.clear(); [/code] With this first few threads are probably running but not all the threads. As it's supposed to generate some files by each thread which is not being generated. Please help. QtConcurrent will use as many threads as it deems useful, based on the system you are running on. Unless you have a 21 core system, it is probably not useful to run 21 threads your your task. However, QThreadPool has methods to change how many threads are considdered useful, so you should look into using that class. André ___ 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] Aligning QProgressBar inside a QSplashScreen
That's not so good; Q_CHECK_PTR will print Out of memory upon seeing a Q_ASSERT just prints an assert information in debug Q_CHECK_PTR terminates execution if you can't process, and this is the case, cause this pointer had to be initialized before the function is called. Code can't recover from it. This should not happen, Stop is the best you can do. Alex On Wed, Oct 3, 2012 at 1:32 AM, Jan Kundrát j...@flaska.net wrote: On 10/02/12 05:07, Alex Malyushytskyy wrote: You would save a lot of time if u properly initialized this-progress to null Agreed, that's always a very good idea. and used Q_CHECK_PTR in drawContents as below That's not so good; Q_CHECK_PTR will print Out of memory upon seeing a null pointer. Q_ASSERT is what has served me well here (and I don't care about it being optimized out in release). With kind regards, Jan -- Trojita, a fast 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] Aligning QProgressBar inside a QSplashScreen
Q_ASSERTs are not survivable. If you trip one, the application terminates. I am not sure why I thought Q_CHECK_PTR would work even in release, when documentation clearly states they both do nothing if QT_NO_DEBUG was defined. By the way even using Q_ASSERT you still have to compare pointer it to null, this why pointer always should be initialized as I advised above. And I still do not see a reason to prefer Q_ASSERT over Q_CHECK_PTR when checking pointers for NULL, even though I would change the default message it prints to mention NULL pointer instead of out of memory. It completely misleading especially since at least on Windows you might get not NULL pointer as a result of memory allocation even if process is out of memory and only attempt to use it will have result in exception thrown. Alex On Wed, Oct 3, 2012 at 4:01 PM, Thiago Macieira thiago.macie...@intel.com wrote: On quarta-feira, 3 de outubro de 2012 15.50.30, Alex Malyushytskyy wrote: That's not so good; Q_CHECK_PTR will print Out of memory upon seeing a Q_ASSERT just prints an assert information in debug Not really. Q_ASSERT, if it fails, calls qt_assert, which will abort the application with a core dump (SIGABRT) or, on Windows, call the debugger routines indicating failure. Q_ASSERTs are not survivable. If you trip one, the application terminates. Q_CHECK_PTR terminates execution if you can't process, and this is the case, cause this pointer had to be initialized before the function is called. Q_CHECK_PTR only checks for null. It can't tell an invalid pointer from a valid one. Code can't recover from it. This should not happen, Stop is the best you can do. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ 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] packaging a build
Does anyone have an idea what's going on, or has anyone tried releasing something with qt5 and MSVC? I have not tried, Qt5 but I do not believe in mysteries, you are missing dependency or provide wrong executable ( debug for example) First thing to check is CRT (MSVCRT*.dll), other computer may have them named the same, but in reality they might be different version. The best solution - provide CRT libraries you link against with your application. Simplest to try - put them all in the folder with your executable. Then check all dependencies of your dependencies ( QT , ICU, etc) Alex On Thu, Sep 6, 2012 at 2:52 PM, Morgan McKenzie speedin...@hotmail.com wrote: Hi, I've built a sample application for a school project and I'm trying hand it in. However, it doesn't seem to work on any computer other than mine (windows 7 64 bit) There's no error message - it simply starts and immediately exits (no window opened) It was built with the Qt5 beta using MSVC 2010 32-bit. I've just been trying to add .dll files into the folder in the hope that that would make it work. I've tried using the Dependency Walker, but it didn't seem to be missing anything on the other computers that it had on mine. So far I've added: Application.exe (my application) Qt3D5.dll Qt3DQuick5.dll QtCore5.dll QtGui5.dll QtNetwork5.dll QtQml5.dll QtQuick5.dll QtQuickParticles5.dll QtV85.dll icudt49.dll icuin49.dll icuuc49.dll When I run it on my computer (which has the most recent version of Visual Studio 2010 Re-distributable on it) it works fine, but on another Windows 7 64 bit computer, also with 2010 re-distributable installed, it does not work. Does anyone have an idea what's going on, or has anyone tried releasing something with qt5 and MSVC? I could also upload the files in a zip somewhere if that'd help - let me know! Thanks! Morgan McKenzie ___ 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] memory fragmentation?
On Linux, you wouldn't allocate 1 GB of memory with sbrk. You'd use an anonymous mmap, which reserves address space but provides no memory backing. The allocation is done on faulting the page. That's how glibc's malloc() serves allocations above a certain adaptive threshold. Thiago, Many thanks for a good comment, It looks like what we actually needed. I will check if anonymous mapping maps are supported on all systems we have to support, this might be a great improvement for our Linux clients :) Alex ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] memory fragmentation?
Harri Pasanen ha...@mpaja.com wrote: I wonder why you say Linux is less flexible? Couldn't you just write a custom allocator directly using sbrk()? Also, 32 bit linux process leaves more application space free, so you can easily reach 2Gb process size, while I recall windows XP having issues after 1.5Gb.It's been a while, so I might not recall all details... From the top of my head with Physical Address Extension for 32 bit Windows you can make 3GB for the user and 1GB for the kernel. But by default: on 32 bit windows: XP - 1.5Gb, windows 2000 and Vista 32 - 2Gb 32 bit application on 64 bit windows: - large address space aware; 4 gb - NOT large address space aware 2 gb I wonder why you say Linux is less flexible? Couldn't you just write a custom allocator directly using sbrk() First of all I apologize if it sounded offensive. I am not guru on Linux ( all native code I ever wrote under Linux besides Qt were some graphics routines which basically repeated similar GDI logic ), but person who was writing code doing allocation under Linux said that he could not find similar solution which would not require reallocation of the array(s) which would be appropriate for our case. As far as I understand after reading help sbrk() performs an actual allocation ( means memory is taken - process space grow ). So potentially if you can control memory allocation for every part of the code we could try to allocate the array at the end of the memory segment memory going to grow , and keep allocated more as needed, keeping all the other allocations in some reserved region ahead. But if I understood it right you will have to control memory allocation for all dependencies to make it work. Under the windows it works differently. Address range is reserved (no memory allocation occurs), application does not consume any memory and reserved/allocated block does not have to be and the end of allocated address space. So if you know maximum memory your application might need/can afford you do not even have to control memory allocation for other objects. For example: assume you need 1 GB for a single array, and all other data can't grow beyond total 500 MB. First thing you can do - reserve 1 GB the earliest possible, and let other allocation happen normally. Application will not allocate this memory until you commit it. You want to load 50MB file into this memory. Commit 50 MB, You want to load another file which uses 150MB. Commit extra 100 MB. Address space is continues, physically no memory re-allocation occurs, pointers are kept valid. You do not care how 3rd party components (like dlls) do memory allocation. Anyway thanks for comments, I might try to play with custom allocator and custom allocator using sbrk() as you suggested :) Regards, Alex On Wed, Aug 22, 2012 at 1:21 PM, BRM bm_witn...@yahoo.com wrote: From: Jason H scorp...@yahoo.com C++ on .NET functions as it does now, however the compiler introduces the operator of ^ as a type modifier like * (pointer) ^ are handles to managed objects, as * are addresses of objects. The runtime then handles dereferencing the handles for you. jsut like your compiler uses the appropriate instructions with a pointer. By which you mean C++/CLI, not strictly C++. You can mix the two with a .NET environment, and native C++ doesn't support the ^ operator. For that matter you can use 'new' instead of 'gcnew' as well, and now you have a mixture of what's being managed and what is not. $0.02 Ben ___ 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] Best Practices returning data from a dialog
It depends on functionality you need and type of your dialog (modal/modeless) In any case I do not think appropriate time is when dialog is closed. Check QDialog documentation for example at: http://doc.qt.nokia.com/4.7-snapshot/qdialog.html In general for modal dialog you might want to update data when as reaction on accepted () signal or when exec returns with QDialog::Accepted For modeless dialogs (in general) you might update data as soon it is changed in the dialog or button Ok/ Apply clicked (again depends on the design). Common sense is the best practice. Regards, Alex On Wed, Aug 22, 2012 at 3:15 PM, JM johnmil...@email.it wrote: Hi all, What are the best practices to return from a common dialog window? At the moment I have already solved with a Slot connected to the closure of the dialog, that invokes methods to retreive data. But what are the best practices? What are the pros and cons of every solution? TIA, JM ___ 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] memory fragmentation?
Nonsense. Any application using a gigabyte or more of memory should HAVE SWITCHED to 64-bit a couple of years ago. It is not nonsense. You provide to users version which works on their system (whatever they have). And even though application may need close to 2GB of data (or more) to work efficiently, it does not mean that it can't be run on 32 bit computers to solve reasonable problems there. It does not mean that you can't recommend user to use 64 bit version of the code. You have to make sure your application either handles all the tasks correctly, be efficient if possible, or at least it has to notify user that specific task can't be handled on this specific system as early as possible. Crashing or even exiting due to insufficient memory in the middle of long term task is not a choice. What can be done to combat this in C++/Qt? As it was said above you can control memory allocation yourself, up to the point you can write your own garbage collector. All applications I know which are designed to work with huge amount of memory (especially large than available RAM) are utilizing its own memory handling. System due to generality normally is too inefficient for your specific case. For example one of our application on Windows ( this is the case when Windows is more flexible than Linux) - reserves the largest amount of continues memory we could afford for data (leaving enough for your widgets ) using VirtualAlloc with MEM_RESERVE flag, This insures that this address range will not be used when regular memory allocation occurs. - When data is loaded VirtualAlloc is called with MEM_COMMIT flag to allocate as much memory as needed. This approach works well since reservation takes no time, time consuming operation is (normally associated with memory allocations) committing. Unfortunately it is way too difficult to give good advice without knowing application details. Regards, Alex ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] crashing when incompatible qt already exists on user's system
Talking about Windows the only reliable solution is to supply all dependencies (at least not system) with your application. For example you can build dll with different compiler or version of the same compiler. You have to make sure that your application uses correct build of QT. On top of this, according to my experience, you can't rely on Qt binary compatibility in the most cases when your application has subclasses with customized behavior.. So make sure your application is provided with corrected Qt and plugin versions. I personally use QCoreApplication::setLibraryPaths at runtime for such purpose. Regards, Alex On Mon, Aug 13, 2012 at 6:31 PM, Justin Karneges jus...@affinix.com wrote: Hi folks, It appears that MinGW's C++ ABI is not reliable between releases. I don't know how often this happens, but in any case I've witnessed the following issue: - Build machine has C:\Qt\4.8.2, built using a recent MinGW compiler. This machine builds my application. - User's machine has C:\Qt\4.8.2, built using an older MinGW compiler (for example, the binary package offered at qt.nokia.com). This installation of Qt is not required to run the application, it merely happens to be there because the user is also a Qt developer, perhaps working on other projects. - When user runs the application generated by the build machine, the app attempts to load plugins from C:\Qt\4.8.2\plugins on the user's machine. The ABIs don't match, and the application crashes. I can think of a few solutions: 1) Build machine should use a Qt path that is unlikely to exist on a machine that the app is deployed to. 2) Remove C:\Qt\4.8.2\plugins from the plugin paths somehow (maybe this could be done at runtime, with QCoreApplication::removeLibraryPath(), though I don't know if this would have an effect on paths that are compiled into the lib directly). 3) When building your own Qt, pass -buildkey to configure, so that Qt rejects plugins that weren't built against the same Qt. This could work as long as the signature check itself doesn't end up triggering an ABI-related crash. For example, if nothing at the linking level could cause a crash, and the qtplugin checks are pure C, then maybe this would be a safe choice. I'm curious to know how others out there have mitigated this problem. Thanks, Justin ___ 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] Question about usage QNetworkRequest with QNetworkRequest::AuthenticationReuseAttribute set to QNetworkRequest::Manual
I am starting url request as void ubFileManager::startRequest( QUrl _url ) { qDebug() url= _url; QNetworkRequest request (url); request.setAttribute ( QNetworkRequest::AuthenticationReuseAttribute, QVariant( QNetworkRequest::Manual ) ); // where qnam is instance ofQNetworkAccessManager reply = qnam.get( request ); connect(reply, SIGNAL(finished()), this, SLOT(httpFinished())); } In httpFinished() reply-error() is set to Host requires authentication ( I left only my code which executed below) void ubFileManager::httpFinished() { . if (reply-error()) { QMessageBox::information( qobject_castQWidget*(parent()), tr(HTTP), tr(Download failed: %1.) .arg(reply-errorString())); reply-deleteLater(); reply = 0; emit loadingError( threadId ); return; } .. return; } Even though I have not done authentication, so far so good. I've sent request, got an expected error. Problem is that next thing what happens is unhandled exception in QNetworkd4.dll. Checking Call Stack in a few cases gives me an impression that this might be multithreaded code, cause point of the failure and order of calls seems changing depending on the break points set. But failure always occur somewhere in the QHttpNetworkConnectionChannel.cpp . In one of the cases I get exception thrown in bool QHttpNetworkConnectionChannel::sendRequest() . // read loop for the response while (socket-bytesAvailable()) { // exception is thrown below, cause reply is null QHttpNetworkReplyPrivate::ReplyState state = reply-d_func()-state; switch (state) { case QHttpNetworkReplyPrivate::NothingDoneState: { Call stack is below: QtNetworkd4.dll!QHttpNetworkConnectionChannel::_q_receiveReply() Line 362 + 0xb bytes C++ QtNetworkd4.dll!QScopedPointerQObjectData,QScopedPointerDeleterQObjectData ::data() Line 135 + 0x3 bytes C++ QtNetworkd4.dll!qGetPtrHelperQScopedPointerQObjectData,QScopedPointerDeleterQObjectData (const QScopedPointerQObjectData,QScopedPointerDeleterQObjectData p) Line 2338 + 0xb bytes C++ QtNetworkd4.dll!QHttpNetworkReply::d_func() Line 161 + 0x13 bytes C++ QtNetworkd4.dll!QHttpNetworkConnectionChannel::_q_receiveReply() Line 362 + 0xb bytes C++ QtNetworkd4.dll!QHttpNetworkConnectionChannel::_q_readyRead() Line 885 C++ QtNetworkd4.dll!QHttpNetworkConnectionChannel::qt_metacall(QMetaObject::Call _c, int _id, void * * _a) Line 87 + 0x8 bytes C++ QtCored4.dll!QMetaObject::metacall(QObject * object, QMetaObject::Call cl, int idx, void * * argv) Line 238 C++ QtCored4.dll!QMetaObject::activate(QObject * sender, const QMetaObject * m, int local_signal_index, void * * argv) Line 3278 + 0x27 bytes C++ QtCored4.dll!QIODevice::readyRead() Line 91 + 0x12 bytes C++ QtNetworkd4.dll!QAbstractSocketPrivate::canReadNotification() Line 640 C++ QtNetworkd4.dll!QAbstractSocketPrivate::readNotification() Line 77 + 0x15 bytesC++ QtNetworkd4.dll!QAbstractSocketEngine::readNotification() Line 155 C++ QtNetworkd4.dll!QReadNotifier::event(QEvent * e) Line 1104 C++ QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 4462 + 0x11 bytes C++ QtGuid4.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3862 + 0x10 bytes C++ QtCored4.dll!QCoreApplication::notifyInternal(QObject * receiver, QEvent * event) Line 731 + 0x15 bytes C++ QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 215 + 0x39 bytes C++ QtCored4.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) Line 485 + 0xf bytes C++ user32.dll!76a062fa() [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll] user32.dll!76a06d3a() user32.dll!76a06ce9() user32.dll!76a077c4() user32.dll!76a0788a() QtCored4.dll!QEventDispatcherWin32::processEvents(QFlagsenum QEventLoop::ProcessEventsFlag flags) Line 813 C++ QtGuid4.dll!QGuiEventDispatcherWin32::processEvents(QFlagsenum QEventLoop::ProcessEventsFlag flags) Line 1170 + 0x15 bytes C++ QtCored4.dll!QEventLoop::processEvents(QFlagsenum QEventLoop::ProcessEventsFlag flags) Line 150 C++ QtCored4.dll!QEventLoop::exec(QFlagsenum QEventLoop::ProcessEventsFlag flags) Line 201 + 0x2d bytesC++ QtCored4.dll!QCoreApplication::exec() Line 1008 + 0x15 bytes C++ QtGuid4.dll!QApplication::exec() Line 3737 C++ UrbanBlast.exe!main(int argc, char * * argv) Line 120 + 0x6 bytes C++ UrbanBlast.exe!WinMain(HINSTANCE__ * instance, HINSTANCE__ * prevInstance, char *
Re: [Interest] QNetworkAccessManager - how to enforce authentication?
Thiago and Richard, many thanks for help, It seems the problem is on the server side - I set up my own http server (used Abyss) and and it always send unauthorized response. At the same time IE have the same problem as my software with server I am working with Authentication. I will try to resolve it with server admin, but question still remain, is there any other way to reset QNetworkAccessManager beside creating a new instance of it? Even though if it does not sound right for that specific case ( my experience with web programming is limited, so I do not judge it) i guess there might be other cases when you might want to reauthorize user from the application side. Alex On Thu, Aug 9, 2012 at 2:08 PM, Richard Moore r...@kde.org wrote: On 9 August 2012 03:34, Alex Malyushytskyy alexmal...@gmail.com wrote: user will not be requested for authentication second time, instead QNetworkReply signal finished() is emitted with error Connection closed. Fire up wireshark or similar and check the response code your server provides when it gets these requests. In both cases it should send a 401 unauthorized response with a WWW-Authenticate header specifying the authentication realm. If it does not then your server is broken. If it does send those even when the second request from QNAM with the invalid Authorization header (the header for basic authentication) is received then it's likely to be QNAM that is broken. Cheers Rich. ___ 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] [Development] Digia to acquire Qt from Nokia
The best news would be Nokia replace Windows with Qt in the future plans. I feel better for Qt developers, cause they are going (if willing) to get job in Digia. If not counting that, it was already clear that somebody will take over Qt and first candidate was Digia due to the fact they already provided some commercial support. Question is if their commercial base will be able to provide sufficient financial support to keep Qt development at the same level as Nokia could for long term. Only time can answer this. Alex On Thu, Aug 9, 2012 at 7:03 PM, Ben Lau xben...@gmail.com wrote: Yeah!! The best news for Qt in this year! ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Attaching to an existing MS EXCEL instance
I think you should read: http://support.microsoft.com/kb/238975/ This might be not as easy as you think: quote Theoretically, you can iterate the ROT for each individual instance, but Office applications do not register themselves if another instance is already in the ROT because the moniker for itself is always the same, and cannot be distinguished. This means that you cannot attach to any instance except for the first. However, because Office applications also register their documents in the ROT, you can successfully attach to other instances by iterating the ROT looking for a specific document, attaching to this document, and then getting the Application object from this document. /quote And I am not sure if Qt can help you anyhow. Regards, Alex ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Qt Visual Studio Add-in error when using CMake 2.8
Hi Mikhail, If you have so many C++ error in the project that was normally compiled with different CMake without compiler change, it might be that your project was not configured properly and mocing was actually done by add-in. In this case errors you get should be probably linking errors. So you might be required to add mocing manually to your CMake project for each relevant file, I have not used CMake in such way, but I am pretty sure I've seen somewhere on the web instructions how to add mocing to CMake projects. Alex On Thu, Jul 12, 2012 at 8:33 AM, Joerg Bornemann joerg.bornem...@nokia.com wrote: On 10/07/2012 20:36, ext Gerenrot, Mikhail wrote: We have a C++ project that uses QT3. We run CMake to generate the project and run VS 2008 to compile. With CMake 2.6 everything was OK, but now we have upgraded to CMake 2.8. It generates the project, but VS does not compile, it gives Qt Visual Studio Add-in error that says “ERROR: Can't find the Qt version that's associated with this project.”. The add-in never really supported CMake generated projects. If this worked for you until now, its purely accidental. ;-) To find out why this stopped working you could maybe diff the project files that were generated with different CMake versions. BR, Jörg ___ 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] Qt5 qml only and qfiledialog, qfontdialog, ... crash
setQuitOnLastWindowClosed(true) only sets flag which is checked when any QWidget closed and closes application when you need the last one. So, since I assume you do not have QWIdget instances anymore, you need manually call exit when you need to exit:. voidQCoreApplicationexit ( int returnCode = 0 ) Alex On Tue, May 8, 2012 at 5:20 AM, qtnext qtn...@gmail.com wrote: it works but ... if i do that, when I close the qml view it no more quit the application and stay as zombie ... I have tryed various hack like : QGuiApplication::setQuitOnLastWindowClosed(true); at start just before opening QfileDialog I set QGuiApplication::setQuitOnLastWindowClosed(false) then set to QGuiApplication::setQuitOnLastWindowClosed(true); if I do that, the qfiledialog do no more close the apps, but after If it try to close the apps, it don't close the apps even if before I call setQuitOnLastWindowClosed(true) ! Le 08/05/2012 10:48, Bo Thorsen a écrit : Den 07-05-2012 15:09, qtnext skrev: Hi, I have started a new desktop application trying to use only qml with Qt5 : I need to choose file. There is now no ready to use components to open, choose a file, so I have tryed to add widgets module in the pro file, and use Qfiledialog ... I can open QFileDialog, but when I close the dialog box, the function in my apps corresponding to the after is executed just after, but it close the apps just after ... my application is derived from qapplication ... Is it forbidden to mix a qquickview and real qwidget dialog box or is it a bug ? Try this in your main(): QApplication app; // Your derived class here, of course app.setQuitOnLastWindowClosed(false); Bo Thorsen, Fionia Software. ___ 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] deleting row from QSqlTableModel - not working
try the following ( assuming index is equal to row ): view-model()-removeRow(index); Alex On Sat, May 5, 2012 at 5:29 AM, Sujan Dasmahapatra sujan.dasmahapa...@gmail.com wrote: I am trying to delete a row from QSqlTableModel which is show in the QTableView but it's not working please help. MainWindow *mainwindow; QSqlTableModel *model; QTableView *view; model = new QSqlTableModel(this,mainwindow-db); model-setTable(Tbl_Drawing); model-select(); view = new QTableView; QHeaderView *m_vert_header= view-verticalHeader(); connect(m_vert_header, SIGNAL(sectionClicked ( int ) ), this, SLOT(deleteRow ( int ) )); view-setModel(model); view-show(); The above way I am able to show the entriesnow deleting a row like this view-model()-removeRow(index, view-currentIndex()); But it's not removing the entry from the table..The item is still shown.Please help me whats going wrong in this Thanks Sujan ___ 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] problem building qwt in windows
I would recommend looking for help on Qwt forum, it is separated product and has nothing to do with Qt besides it is using it. It is like asking such question on Widows forums, cause your have Windows installed. As for building problem, just from my experience QWT pro file is too complicated and visual studio addon does not create a correct equivalent. I suggest you either use qmake from command line as recommended, or convert pro file from /src subfolder (or each subfolder ) one by one instead. Alex On Tue, May 1, 2012 at 4:28 PM, caius ligarius caius9...@gmail.com wrote: I installed Qwt4.2.0 to C:\Qt folder I currently have Qt version 4.6.1 installed in C:\Qt\4.6.1, which I have been using successfully with VS2008. Next, to build Qwt I open c:\Qt\Qwt\qwt.pro in VS2008 using the Qt plugin. After this when I try to compile this .pro file I get the following errors. Any idea what I can do to fix this? (All includes, libs etc. seem to be correctly configured since I open the .pro file using the Qt plugin). 1-- Build started: Project: qwt, Configuration: Debug Win32 -- 1Moc'ing qwt_wheel.h... 1Moc'ing qwt_thermo.h... 1Moc'ing qwt_slider.h... 1Moc'ing qwt_sldbase.h... 1Moc'ing qwt_scale.h... 1Moc'ing qwt_push_button.h... 1Moc'ing qwt_plot_zoomer.h... 1Moc'ing qwt_plot_picker.h... 1Moc'ing qwt_plot_canvas.h... 1Moc'ing qwt_plot.h... 1Moc'ing qwt_picker.h... 1Moc'ing qwt_legend.h... 1Moc'ing qwt_knob.h... 1Moc'ing qwt_dyngrid_layout.h... 1Moc'ing qwt_dial.h... 1Moc'ing qwt_counter.h... 1Moc'ing qwt_compass.h... 1Moc'ing qwt_analog_clock.h... 1Compiling... 1moc_qwt_wheel.cpp 1c:\qt\qwt\include\qwt_sldbase.h(53) : error C2061: syntax error : identifier 'Orientation' 1c:\qt\qwt\include\qwt_sldbase.h(54) : error C2146: syntax error : missing ';' before identifier 'orientation' 1c:\qt\qwt\include\qwt_sldbase.h(54) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1c:\qt\qwt\include\qwt_sldbase.h(54) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1c:\qt\qwt\include\qwt_sldbase.h(54) : warning C4183: 'orientation': missing return type; assumed to be a member function returning 'int' 1moc_qwt_thermo.cpp 1c:\qt\qwt\include\qwt_array.h(25) : fatal error C1083: Cannot open include file: 'qmemarray.h': No such file or directory 1moc_qwt_slider.cpp 1c:\qt\qwt\include\qwt_array.h(25) : fatal error C1083: Cannot open include file: 'qmemarray.h': No such file or directory 1moc_qwt_sldbase.cpp 1c:\qt\qwt\src\moc\debug\../../../include/qwt_sldbase.h(53) : error C2061: syntax error : identifier 'Orientation' 1c:\qt\qwt\src\moc\debug\../../../include/qwt_sldbase.h(54) : error C2146: syntax error : missing ';' before identifier 'orientation' 1c:\qt\qwt\src\moc\debug\../../../include/qwt_sldbase.h(54) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1c:\qt\qwt\src\moc\debug\../../../include/qwt_sldbase.h(54) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1c:\qt\qwt\src\moc\debug\../../../include/qwt_sldbase.h(54) : warning C4183: 'orientation': missing return type; assumed to be a member function returning 'int' 1.\src\moc\Debug\moc_qwt_sldbase.cpp(113) : error C2061: syntax error : identifier 'Orientation' 1.\src\moc\Debug\moc_qwt_sldbase.cpp(122) : error C2061: syntax error : identifier 'Orientation' 1moc_qwt_scale.cpp 1c:\qt\qwt\include\qwt_array.h(25) : fatal error C1083: Cannot open include file: 'qmemarray.h': No such file or directory 1moc_qwt_push_button.cpp 1c:\qt\qwt\src\moc\debug\../../../include/qwt_push_button.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1c:\qt\qwt\src\moc\debug\../../../include/qwt_push_button.h(36) : error C2143: syntax error : missing ',' before '' 1c:\qt\qwt\src\moc\debug\../../../include/qwt_push_button.h(41) : error C2146: syntax error : missing ';' before identifier 'textFormat' 1c:\qt\qwt\src\moc\debug\../../../include/qwt_push_button.h(41) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1c:\qt\qwt\src\moc\debug\../../../include/qwt_push_button.h(41) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1c:\qt\qwt\src\moc\debug\../../../include/qwt_push_button.h(41) : warning C4183: 'textFormat': missing return type; assumed to be a member function returning 'int' 1c:\qt\qwt\src\moc\debug\../../../include/qwt_push_button.h(42) : error C2061: syntax error : identifier 'TextFormat' 1.\src\moc\Debug\moc_qwt_push_button.cpp(78) : error C2061: syntax error : identifier 'TextFormat' 1.\src\moc\Debug\moc_qwt_push_button.cpp(79) : error C2061: syntax error : identifier 'Alignment' 1.\src\moc\Debug\moc_qwt_push_button.cpp(86) : error C2061: syntax error : identifier 'TextFormat'
[Interest] QSqlRelationalDelegate combobox is not updated
I found a problem which looks like a bug when trying to display data from database in QTableView using QSqlRelationalDelegate. Assume I have 2 tables: -streets -addresses Table Addresses has column which contains reference to ID in the streets. QSqlRelationalTableModel is used for both tables and edit strategy is set to QSqlTableModel::OnFieldChange. Initially table is loaded correctly, but then if record is added into or removed from the streets the change does not appear when viewing addresses. In other words if combobox is opened it contains old values, even though if table streets is displayed, all changes are there. I verified that select() for addresses is called after appropriate changes are made in streets at the file (with 3rd party software). I tried to set different QSqlRelationalDelegate hoping this should re-create the combobox, but it did not fix the problem So I am not sure what else could be done. Any idea is appreciated. Regards, Alex ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QSqlRelationalDelegate combobox is not updated
I fixed problem manually calling select on the column relation model QSqlRelationalTableModel* model = model-select(); ... QSqlTableModel* childModel = model-relationModel ( TAC_street_id ); Q_CHECK_PTR( childModel ); childModel-select(); I am still not sure this is not a bug. I am surprised QSqlRelationalTableModel select() does not call select() for every relation model set itself. Regards, Alex -- Forwarded message -- From: Alex Malyushytskyy alexmal...@gmail.com Date: Thu, Apr 19, 2012 at 2:34 PM Subject: QSqlRelationalDelegate combobox is not updated To: interest@qt-project.org I found a problem which looks like a bug when trying to display data from database in QTableView using QSqlRelationalDelegate. Assume I have 2 tables: -streets -addresses Table Addresses has column which contains reference to ID in the streets. QSqlRelationalTableModel is used for both tables and edit strategy is set to QSqlTableModel::OnFieldChange. Initially table is loaded correctly, but then if record is added into or removed from the streets the change does not appear when viewing addresses. In other words if combobox is opened it contains old values, even though if table streets is displayed, all changes are there. I verified that select() for addresses is called after appropriate changes are made in streets at the file (with 3rd party software). I tried to set different QSqlRelationalDelegate hoping this should re-create the combobox, but it did not fix the problem So I am not sure what else could be done. Any idea is appreciated. Regards, Alex ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] QSplashScreen and multiple screens.
I've just got weird looking case when my software is running on the systems with multiple screens. My main application window saves its last position and size, so if it was moved to second monitor it will be re-opened there. But QSplashScreen will still be shown on the primary screen at startup. I tried to look in documentation, but found it more confusing than helpful: QSplashScreen::QSplashScreen ( QWidget * parent, const QPixmap pixmap = QPixmap(), Qt::WindowFlags f = 0 ) ,,, The typical use for this constructor is if you have a multiple screens and prefer to have the splash screen on a different screen than your primary one. In that case pass the proper desktop() as the parent. Above line means that it is possible to have multiple desktops, but if it is talking about QApplication::desktop() (AFAIK) it is supposed to be only one. So I assume that this is a bug in the documentation and it is QApplication::desktop() -screen( screenNumber ) which is supposed to be passed and as far as I understand the whole sequence should look like: 1. Create main window and restore it geometry, 2. determine screen number it will be shown on , but before it is shown with QDesktopWidget ::screenNumber( const QWidget* widget ) const 3. Create and show splash screen as a child of determined screen number. Now I already made QSplashScreen a child of my main application window and I expected this to be done automatically to be done automatically when QSplashScreen is shown. Is there any problem with my logic? In other words why QSplashScreen (if have parent) does not check that this parent is not a screen and find correct screen for its parent? Regards, Alex ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Re : QLineEdit stretch in QHBoxLayout using designer
No, widget Size Policy will not change anything until layout is flying in the air. It is the same as trying to tow a car which has no any connection to the truck. Alex On Fri, Feb 17, 2012 at 3:28 PM, BOUCARD Olivier boucard_oliv...@yahoo.fr wrote: Hi Carl, Try to play with the widget Size Policy, it will become clear. Olivier. De : Carl Schumann schum...@fnal.gov À : Qt Interest List interest@qt-project.org Envoyé le : Vendredi 17 février 2012 21h47 Objet : [Interest] QLineEdit stretch in QHBoxLayout using designer Qt community, I using Qt Designer to layout a very simple GUI via the following steps: 1. Using the New Form dialog I create a Main Window 2. Then a drop a Spin Box and a Line Edit widget onto the main window with the Line Edit to the right of the Spin Box. 3. Select both and then select Form - Lay Out Horizontally from the main menu of Designer 4. Then try out the GUI with Form - Preview ... from the main menu The Line Edit has a fixed width that does not respond to resizing the main window or entering long text. How do I make the Line Edit stretch to use up all the empty space to its right in the main window please? Thanks for any help. Sincerely, Carl Schumann ___ 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] qwt debug version not working with Qt-4.8.0
qwt has its own mailing list which is the best way to post questions about it. On Wed, Jan 18, 2012 at 4:26 AM, Pritam pritam_ghang...@infosys.com wrote: Hi Sujan, I have never used qwt before, I have no idea why its named like that. On Wednesday 18 January 2012 05:22 PM, Sujan Dasmahapatra wrote: Hi Pritam Can you tell why the dll is qwtd5.dll instead of qwt5d.dll. Previously when I built qwt it was qwt5d not qwtd5.dll. Now it is qwtd5.dll Is that creating any problem. Thanks Sujan ** ** Kind regards, *Sujan Dasmahapatra *Project Leader, Aero Group CE - Aero Group Tel+91 80 66470248 Mob s...@lmwindpower.com %25EMAIL%25 *LM Wind Power Blades* lmwindpower.com *Together we capture the wind to power a cleaner world* -- This e-mail and any attachments are confidential. If you are not the named or intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Any unauthorized disclosure, use or storage is prohibited and might be unlawful. *From:* interest-bounces+sdh=lmwindpower@qt-project.org [ mailto:interest-bounces+sdh=lmwindpower@qt-project.orginterest-bounces+sdh=lmwindpower@qt-project.org] *On Behalf Of *Pritam *Sent:* Wednesday, January 18, 2012 3:51 PM *To:* interest@qt-project.org *Subject:* Re: [Interest] qwt debug version not working with Qt-4.8.0 ** ** May be you have some code in Q_ASSERT macros which is making the application crash. Check that out. Have you tried debugging any other application. May be your debugger itself is crashing but in that case qt creator should tell you that gdb terminated abnormally. On Wednesday 18 January 2012 02:42 PM, Sujan Dasmahapatra wrote: There’s no compilatioln error, even no linking error. When I launch my application and try to load plots, shows “Application stopped in an unxepcted way”. There is no crash even. Its works fine with release mode. Kind regards, *Sujan Dasmahapatra *Project Leader, Aero Group CE - Aero Group Tel+91 80 66470248 Mob s...@lmwindpower.com %25EMAIL%25 *LM Wind Power Blades* lmwindpower.com *Together we capture the wind to power a cleaner world* -- This e-mail and any attachments are confidential. If you are not the named or intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Any unauthorized disclosure, use or storage is prohibited and might be unlawful. *From:* Алексей Протченко [mailto:tverdy...@gmail.comtverdy...@gmail.com] *Sent:* Wednesday, January 18, 2012 2:39 PM *To:* List for both Qwt users and developers *Subject:* Re: qwt debug version not working with Qt-4.8.0 Hello, Sujan Can you post what's the error message of the compiler you have seen? 2012/1/18 Sujan Dasmahapatra s...@lmwindpower.com Dear Friends I have build Qwt with Qt-4.8.0. Debug version dll is not correct it▓s coming as ▒qwtd5.dll▓ which is supposed to be ▒qwt5d.dll▓. My application is not working when I built in debug mode its crashing. But in release mode all the plots are coming correctly. Please tell me if it is a Qwt bug or Qt bug.???Any help would be highly appreciated. How can I debug the code. ?? Thanks Sujan ═ ═ ═ Kind regards, ═ ═ *Sujan Dasmahapatra *Project Leader, Aero Group CE - Aero Group Tel+91 80 66470248 Mob═ s...@lmwindpower.com %25EMAIL%25 ═ *LM Wind Power Blades* lmwindpower.com ═ *Together we capture the wind to power a cleaner world* -- ═ This e-mail and any attachments are confidential. If you are not the named or intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Any unauthorized disclosure, use or storage is prohibited and might be unlawful. ═ -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ qwt-interest mailing list qwt-inter...@lists.sourceforge.net
Re: [Interest] Qt assistant example not working
Debug void MainWindow::initializeAssistant() and find out why it fails. Mostly likely you don't have assistant_adp.exe in the QLibraryInfo::location(QLibraryInfo::BinariesPath); Alex On Thu, Jan 12, 2012 at 3:39 AM, Sujan Dasmahapatra s...@lmwindpower.com wrote: Dear Friends I am trying to build the ‘simpletextviewer’ example and run. Its build successfully. After launching the application I am clicking on help assistant I can see the assistant is coming and going off. The help assistant is not launching. I am using Qt4.5.2. Now I am trying to implement the help assistant in my application. There also the same thing is happening it not launching the assistant is launching and crashing. Any help would be highly appreciated. Thanks Sujan Kind regards, Sujan Dasmahapatra Project Leader, Aero Group CE - Aero Group Tel+91 80 66470248 Mob s...@lmwindpower.com LM Wind Power Blades lmwindpower.com Together we capture the wind to power a cleaner world This e-mail and any attachments are confidential. If you are not the named or intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Any unauthorized disclosure, use or storage is prohibited and might be unlawful. ___ 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