Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.0k Posts
  • [SOLVED] Label display of an Int

    7
    0 Votes
    7 Posts
    7k Views
    G
    Hi, you should create the label as child and add it to the layout,or even better, add it to the ui created bny the GUI editor. BUT: never create a widget in all places where you want to access it, it's enough to create it once. If diceout is part of the ui, it's the easies way, then it would be: @ void MainWindow::on_d2button_clicked() { int gervalue = rand() % 2 + 1; ui->diceout->setNum(gervalue); } @
  • 0 Votes
    16 Posts
    8k Views
    I
    [quote author="Volker" date="1300056406"]I suspect it to be some caching problem on the OS level (could be some race condition too).[/quote] I don't know what you mean by race condition but I agree on the OS caching. Although using the same algorithm works on PHP just fine (using filesize(), fopen(), feof() and fgets()) and on Ruby too (file(), filestats() to find the size, tell() for the cursor pos and readlines()), so maybe the framework should prevent this issue somehow. Tomorrow I'll take a deeper look at QFile's source code to see if I can find something supicious (I doubt it though). Also if the problem persists I'll try a different aproach. (Haven't tried QFileSystemWatcher as suggested by Andre yet..) It's really annoying to debug, after the last modification it failed only ONCE, and then worked for 3-4 hours until I closed it without problems!
  • 0 Votes
    6 Posts
    4k Views
    J
    I've raised fault report "QTBUG-18095":http://bugreports.qt.nokia.com/browse/QTBUG-18095 Edit: fixed link; Andre
  • Can't build sample apps

    6
    0 Votes
    6 Posts
    3k Views
    Z
    I agree. Sadly we have to live with such things. I find it less painful to use no-spaces in paths as a rule of thumb to avoid nasty surprises when trying to use tools that do not properly quote and/or escape special characters.
  • Odd error during release compilation

    4
    0 Votes
    4 Posts
    3k Views
    P
    No, uic generates everything except ui_login.h. Andre, You have right, I've added ui_login.h but now I have another error @ g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\landlord.exe object_script.landlord.Release -L"c:\Qt\STATIC\qt\lib" -L"c:\Qt\STATIC\qt\lib" -lmingw32 -lqtmain -lQtWebKit -lQtSql -ljscore -lshlwapi -lversion -lQtGui -lQtNetwork -l gdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtCore -lkern el32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32 c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -ljscore collect2: ld returned 1 exit status mingw32-make[1]: *** [release\landlord.exe] Error 1 mingw32-make[1]: Leaving directory `c:/Qt/STATIC/qt/landlord' mingw32-make: *** [release-all] Error 2 @ It's mine first attempt to creating release exe file, so Im sure that my lack of knowledge is general problem:), And sorry for that. //edit. Everything works fine. Thanks for help.
  • Spinbox Totals

    6
    0 Votes
    6 Posts
    4k Views
    ?
    why not reimplement validate() ?
  • One *simple* Release build of fetchmore

    23
    0 Votes
    23 Posts
    9k Views
    AlicemirrorA
    ec31, try to mark ad "code" the lines of the post that are from the compiler, it became readable and clear.
  • Monitor QScrollArea's Bar Changes

    5
    0 Votes
    5 Posts
    3k Views
    G
    You must not cast to QAbstractSlider pointer type. A QScrollBar inherits from QAbstractSlider, so you can safely assign directly: @ QAbstractSlider *VBar= scrollArea->verticalScrollBar(); @ And you're better off to assign it to a QScrollBar pointer, to have access to the other methods too, if necessary. And yes, you do have access to QAbstractSlider's methods and signals too.
  • [SOLVED] How to get QModelIndex needed for QAbstractTableModel::setData?

    3
    0 Votes
    3 Posts
    3k Views
    P
    disregard my post... I was handling the signal in the wrong object. What I needed to do was handle the signal in my inherited QAbstractTableModel object and do the following.... @ public slots: void RegisterValueChanged(QObject* obj, RegData* e) { registerMap[e->Desc] = e->Value; reset(); } @ [EDIT: code formatting, Volker]
  • [SOLVED]which widget would be the best to display the following data?

    18
    0 Votes
    18 Posts
    7k Views
    P
    Hi Gerolf, Thanks!, :-) I have been reading the docs but just can´t seem to connect things together. As you can see in my implementation, I have an inherited QThread class that initializes my structure pointer array. If you have noticed, I intentionally place a null pointer to register 5 because I do not have a continguous set of register in my real world scenario. QMap basically is a subset of my structure pointer array without the null pointer. I can populate the table view with RegisterModel using QMap. However, as you can see, when my thread executes, it changes the structure array value. Do I have to loop through the QMap items, compare the description strings, and then update TableView by emitting a signal dataChange()? This seem time consuming if I have loop through the QMaps items for every registers that changes.... Please advise...
  • Top Most in Scroll Area

    6
    0 Votes
    6 Posts
    3k Views
    M
    thx Andre ur help was amazing and fast
  • Extending the addressbook example by a find method

    5
    0 Votes
    5 Posts
    3k Views
    A
    Well, the table is a model (a QAbstractItemModel subclass). You set a model on a view by using setModel() on the view, the table in this case. To put a QSortFilterProxy model into the picture, you have to recognize that it too is a model just like the table model you already have. Only, instead of giving access to actual data, it gives access to another model that it provides another view on: it may be sorted, filtered, or even otherwise modified. So, you set the proxy model as the model for the view, and set the original model as the source model for the proxy model. There is actually a code example inside the example you are modifying. Take a look at the AddressWidget::setupTabs() method in the example code you referenced. You will see a QSortFilterProxy model being set up there.
  • Get available physical memory, multiple plattforms?

    4
    0 Votes
    4 Posts
    6k Views
    J
    Thanks to both of you for your fast replys. I know, that I cannot prevent it and I cannot know, what other applications use. Nethertheless, I hope, that I´ll find a usefull percentage of the available physical memory, assuming, that the user of my application is aware of the fact, that he should not run other heavy applications at the same time. Additionally, a swap would just slow the execution down (as long as the virtual memory is not fully loaded as well), so it would be no drama (just not nice).
  • Signaling a slot in a different application on a Symbian device

    5
    0 Votes
    5 Posts
    4k Views
    A
    Sure, it all depends on what you want to achieve in the end. You could even combine the two approaches: signal through a local socket, and use the shared memory to actually move the data around. Might be more efficient for larger blobs of data.
  • Configuring QT for Linux with DOM Support

    7
    0 Votes
    7 Posts
    3k Views
    L
    Hallo I solved my problem,I forgot in the projectfile QT+=xml. Thank you for help. FRH
  • QComboBox Signal FocusInEvent or Highlighted/Activated?

    15
    0 Votes
    15 Posts
    11k Views
    P
    Thanks, It works like it should, and your code is more condensed! I will get it figured out eventually! Thanks for all the help!
  • QProcess launches application in the background on MAC 10.6

    5
    0 Votes
    5 Posts
    5k Views
    Y
    Thanks, I'm try it
  • Qt Eclipse basic question

    2
    0 Votes
    2 Posts
    2k Views
    K
    I think what You are looking for is a SpinBox. And really why do You need to use Eclipse isn't QtCreator an option? In my mind, making someone use Eclipse is a very harsh form of punishment. "C++-GUI-Programming-with-Qt-4-1st-ed.":http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip
  • Qt vs. WPF

    25
    1 Votes
    25 Posts
    40k Views
    AlicemirrorA
    Thank you. Just an advice: after you setup the project on public, I can be a follower as a registered user and get code and modify documents you have already wrote. Then another registered user can ask to you to be a contributor and if you accept him, he became part of the development team for that project. In the admin area, set as you needs the permissions on the related groups so followers, visitors and contributors can have the right authorizations. Then, last but not least, add the right licens to the project (at the end of the "categorization" page).
  • [Solved] Get coordinates from mousPressEvent

    7
    0 Votes
    7 Posts
    9k Views
    JohanSoloJ
    Well, running my own program loop would make my life much easier... I guess a possibility would be to write a wrapper, that would do the interface between the BlackBoard and the other part of the software, which I already have. This would "solve" the problem of getting only one mouse click, since the mouse click from BlackBoard would be connected to the corresponding action in the "processing code". What do you think?