Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 457.9k Posts
  • Design of custom dynamic interface

    2
    0 Votes
    2 Posts
    1k Views
    L
    I'm not quite sure about your requirements, but QWidget (more specifically QObject) has a sender() method, which allows for retrieving the emitting object within a slot. @ void doWidgetClick() { CustomWidget pSender = qobject_cast<CustomWidget>(sender()); } @ For the "correct" solution design-wise you should consider using a "QSignalMapper":http://qt-project.org/doc/qt-4.8/qsignalmapper.html. As to your code: You cannot pass values using the connect() statement. @ // WRONG, this is a value, not a type connect(this, SIGNAL(click()), pReceiver, SLOT(doWidgetClick(this))); idget*))); @ Slots can only have less, not more arguments (excluding signal default arguments). @ // WRONG, slot has more arguments than signal // RIGHT, only if click signal has at least one default argument connect(this, SIGNAL(click()), pReceiver, SLOT(doWidgetClick(QWidget*))); @
  • Qt 4.7 Browser example

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • How does WLAN debugging work ?

    4
    0 Votes
    4 Posts
    2k Views
    P
    Actually, I am refering to the Qt Creator and its option to set a WLAN adress instead of a COM Port to transfer the data to which works with CODA (Debug Agent) that has to be started. If you are interested, search for the text string WLAN "here":http://doc.qt.nokia.com/qtcreator-2.4/creator-running-targets.html#running-on-a-device. And I hope that someone could explain this thing to me :)
  • 0 Votes
    10 Posts
    8k Views
    B
    In both cases I close the dialog. But only the one using QDialog::show() will NOT block at QApplication::exec(). I read somewhere that this happens because my QDialog has no parent widget assigned. [quote author="1+1=2" date="1335891728"]If your @ myDialog @ is your only Widget. When it's closed, your application will be marked as finished. so QApplication::exec() will exit ASAP. [/quote] The reason I use exec() and not show() or open() is because the call is inside a loop like this: @ bool keepLooping = true; do { QDialog myDialog int result = myDialog.exec(); if(result) { if(something) keepLooping = false; } else { keepLooping = false; } } while(keepLooping); myQApplication.exec(); // The application exits now @ This will only work with QDialog::exec(). I guess the QApplication::exec() at the end of the code above is reduntant at this particular case because the application is going to quit anyway. To be honset I do not know why it is there at first place (it is a big project I am not the one who wrote this code). An alternative solution would be to add: @ QTimer::singleShot(0, &myQApplication, SLOT(quit())); @ ..before calling QApplication::exec(); Thanks a lot for your help guys! Cheers, Bekos
  • Segmentation fault in QGraphicsView::setScene()

    5
    0 Votes
    5 Posts
    3k Views
    V
    Or may be try clean and build or rebuild.
  • View wit 3 column remove row work with 4 column dont work

    4
    0 Votes
    4 Posts
    2k Views
    P
    Somebody know, why if columns IDStanowiska or DataUrodzenia is emplt (have Value NULL) then cant delete this row ?? Columns Imie and Nazwisko can by emplty, because they are NOT NULL and MySQL automatically add empty String . Somebody Know how delete row if in View exist column how have NULL value ??
  • QVTKWidgetPlugin.dll

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • [Solved]QTableView storing Objects of a class.

    2
    0 Votes
    2 Posts
    2k Views
    S
    I found "address book example":http://doc.qt.nokia.com/4.7-snapshot/itemviews-addressbook.html and after going through the code i came to know that i need to subclass QAbstractTableModel and override the required functions. But still find this a long way to go as i need to store a single object for each/particular row. Thanks for your time :)
  • How to set up environmental variables on Ubuntu for Qt creator

    2
    0 Votes
    2 Posts
    3k Views
    V
    Do you know where qmake is installed? If you know the path, may be try adding the path of qmake and see whether it is working?
  • Using QReadWriteLock

    9
    0 Votes
    9 Posts
    6k Views
    S
    Hmmm, not all my threads are QThreads... I'm guessing QThreadStorage wouldn't work right for me? In fact, only the UI stuff runs in QThreads in my project, I think.
  • No matching signal for on_currentChanged with QItemSelectionModel

    3
    0 Votes
    3 Posts
    8k Views
    J
    Would like to use the auto connection, but without the connect, the slot doesn't get called. Other auto connection slots on other dialogs work fine. Is there something else to do to get auto connect to work with the QItemSelectionModel?
  • Impossible to use repaint() again

    2
    0 Votes
    2 Posts
    1k Views
    Z
    To trigger your paint event just call update() on your custom widget.
  • Network: Connecting Client and Server on different machines

    5
    0 Votes
    5 Posts
    3k Views
    V
    You mean it could be an issue of the firewall?? Wow, I would have never thought about it. I'll give it a try.
  • [Solved] Style not working with QItemDelegate

    3
    0 Votes
    3 Posts
    4k Views
    M
    Thanks. It works
  • QListView with animated icons

    2
    0 Votes
    2 Posts
    4k Views
    S
    Hi, For the animated icon you can look into "QMovie":http://qt-project.org/doc/qt-4.8/qmovie.html#details, One approach can be to create your custom delegate to show a QLabel and listItems (text) for a single row and then create a QMovie from the animated icon(.gif) , then set the QMovie to QLabel. Eg @QMovie *movie = new QMovie(":Animations/icons/yourAnimatedIcon.gif"); QLabel *yourLabel = new QLabel(this); yourLabel->setMovie(movie); movie->start();@ Check if this works :) Note: Instead of using delegates you can easily use setItemWidget() for item widgets or setIndexWidget() for item views respectively for adding a lable to you item widget/view.
  • Custom Widget Problem

    7
    0 Votes
    7 Posts
    4k Views
    R
    Thanks Robot Herder...I'll do (more) reading. I really appreciate your help! Rich
  • Problems with connect() and some classes

    6
    0 Votes
    6 Posts
    3k Views
    B
    Thank you! It worked. [quote author="mlong" date="1335823162"]Make your gauges member variables so they are accessible throughout your class. Then create a slot to do that specific task. For instance: @ // slot: void setValuesOnTimeout() { gauge1->updateValues(30); gauge2->updateValues(30); } @ Then connect like: @ connect(timerRand,SIGNAL(timeout()),this,SLOT(setValuesOnTimeout())); @ Edit: Alternately... (I think this might work, but I haven't tried it...) Make the default values on your updateValues slots = 30. Then just connect: @ // These will use the default value of 30 connect(timerRand,SIGNAL(timeout()),gauge1,SLOT(updateValues())); connect(timerRand,SIGNAL(timeout()),gauge2,SLOT(updateValues())); @[/quote]
  • Someting wrong with currentPath on linux

    5
    0 Votes
    5 Posts
    2k Views
    P
    its work thx :)
  • [Solved] Apps using Plugins accessing static libs

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Quint32 to char []

    4
    0 Votes
    4 Posts
    3k Views
    G
    elephant... thank you.. working