Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Determing a paint device

    6
    0 Votes
    6 Posts
    3k Views
    D
    Then you can use type(). :)
  • 0 Votes
    3 Posts
    7k Views
    M
    Thanks Vass..its working fine.. Thanks for your valuable inputs..
  • QListwidget item with mousedoubleclicked

    2
    0 Votes
    2 Posts
    4k Views
    M
    Hi If you want to receive double click event to process you should try to use doubleClicked(QModelIndex) signal and then process it in your custom slot. I'm not sure if that's what you looking for, so in case you want to assign int number to the list item you can do it by setting role Qt::UserRole+1 with value using setData( int role, const QVariant & value) method and then retrieve it when processing the signal. Hope that helps Cheers
  • [Solved] Signal & Slot to QGraphicView items

    16
    0 Votes
    16 Posts
    8k Views
    Z
    [quote author="ThaRez" date="1317039266"]The problem is there are several spin boxes and then I'd have to pass a pointer to all of them (?). By passing the main window, can't I then access them all?[/quote] Yes you can access them all this way. But the coupling (as I understand it) is between an item and a specific spinbox. So you should better pass through the appropriate spinbox corresponding to each item when you create each item. Or use the other approach and have the mainwindow make the connections as needed. Anyway, glad you got something working.
  • [SOLVED]Easiest way to set image to NOT auto repeat ?

    5
    0 Votes
    5 Posts
    5k Views
    EddyE
    thanks for sharing your solution!
  • [SOLVED]QVariant in signal argument and QSignalSpy

    13
    0 Votes
    13 Posts
    11k Views
    X
    I also got bitten by this particular nastiness, your post helped me solve it. Many thanks!
  • [Solved] Inserting and deleting rows with QAbstractProxyModel

    6
    0 Votes
    6 Posts
    7k Views
    EddyE
    You're welcome. Please add [Solved] in front of your title using the edit link.
  • Qt multiscreen with Mac Spaces

    3
    0 Votes
    3 Posts
    2k Views
    J
    There's the screenshot of how the app looks like before I switch spaces, and how it should look like after I switch back. As you can see, there is one QMainWindow with two QDialogs over it. The dialog in question is a child of another QDialog. !http://dl.dropbox.com/u/43071740/QDialogVSSpaces/Step1.png(http://dl.dropbox.com/u/43071740/QDialogVSSpaces/Step1.png)! The Space Overview, right before I switch back from another Space: !http://dl.dropbox.com/u/43071740/QDialogVSSpaces/Step2.png(http://dl.dropbox.com/u/43071740/QDialogVSSpaces/Step2.png)! What happens after I clicked on the app again. !http://dl.dropbox.com/u/43071740/QDialogVSSpaces/Step3.png(http://dl.dropbox.com/u/43071740/QDialogVSSpaces/Step3.png)! Another few things. I've change the parent Dialog to display a debug message after it returns from the child dialog's exec(): @ CFit4PointsDlg* pkDlg = new CFit4PointsDlg( this, &init ); pkDlg->setModal( true ); pkDlg->exec(); qDebug() << "\tReturn from Fit4PointsDlg->exec&#40;&#41;"; delete pkDlg;@ The debug message never showed up. I even override the child dialog's event handlers and slots: @/******************************************************************* Reimplemented slots *******************************************************************/ void CFit4PointsDlg::accept() { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][accept] ACCEPTED"; #endif QDialog::accept(); } void CFit4PointsDlg::done( int r ) { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][done] DONE"; #endif QDialog::done( r ); } void CFit4PointsDlg::reject() { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][reject] REJECTED"; #endif QDialog::reject(); } void CFit4PointsDlg::lower() { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][lower] LOWERED"; #endif QDialog::lower(); } void CFit4PointsDlg::setFocus() { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][setFocus] Set Keyboard Focus"; #endif QDialog::setFocus(); } /******************************************************************* * Reimplemented functions *******************************************************************/ void CFit4PointsDlg::closeEvent ( QCloseEvent * e ) { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][closeEvent] CLOSED"; #endif QDialog::closeEvent( e ); } void CFit4PointsDlg::hideEvent ( QHideEvent * event ) { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][hideEvent] HIDDEN"; #endif QDialog::hideEvent( event ); } void CFit4PointsDlg::moveEvent( QMoveEvent * event ) { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][moveEvent] MOVED " << event->oldPos() << "=>" << event->pos(); #endif QDialog::moveEvent( event ); } void CFit4PointsDlg::focusInEvent( QFocusEvent * event ) { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][focusInEvent] FOCUS IN " << endl << "\tparent: " << this->parentWidget(); #endif QDialog::focusInEvent( event ); } void CFit4PointsDlg::focusOutEvent( QFocusEvent * event ) { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][focusOutEvent] FOCUS OUT " << endl << "\tparent: " << this->parentWidget(); #endif QDialog::focusOutEvent( event ); } void CFit4PointsDlg::setVisible ( bool visible ) { #ifdef _DEBUG qDebug() << "[Fit4PointsDlg][setVisible] Set Visible " << visible; #endif QDialog::setVisible( visible ); }@ The only functions that might responded during switching back to the Space and having the child dialog disappear is the FocusIn/Out event handlers. I was hoping somwthing will happen with hideEvent as well, but it's debug message never shows during this event. Also, on some rare occasions, the child dialog might reappear (This is something rather erratic; I've yet to find out how to reproduce this). When it does, it will appear that the child dialog no longer has the parent dialog as a parent anymore; came to that conclusion because moving the parent dialog doesn't affect the child dialog's position anymore, as it normally does. I searched my code and was pretty sure I never explicitly reset the child dialog's parent. Maybe there's something else doing that without me knowing?
  • How to select all items in the scene

    10
    0 Votes
    10 Posts
    12k Views
    P
    @QList<QGraphicsItem *> items = scene->items(); foreach( QGraphicsItem *item, items ) { item->hide(); } @ i changed the code it's working for me [Edit : added @ code tags, Eddy]
  • A Strange Behaviour with my ORACLE Database

    7
    0 Votes
    7 Posts
    4k Views
    F
    Probably the problem is a commit not done. When acting in parallel on the data, independently from the users you are connect as, the database does not make all the data immediately visible until you commit. This is a behavior required to avoid dirty reads, phantom reads, and so on. Moreover, if a user is performing a locking operation (e.g., select for update) the other user (in the other transaction) is locked. When the first user ends (commit/abort) his work, the other user is unlocked and can access the data. So you problem could be either data uncommitted or a lock on the data you are trying to get from the database.
  • Qt example crashing on exit...

    5
    0 Votes
    5 Posts
    7k Views
    G
    See the "doc note":http://developer.qt.nokia.com/doc/qt-4.7/gettingstartedqt.html#comments in the "copy of the respective page":http://developer.qt.nokia.com/doc/qt-4.7/gettingstartedqt.html within Qt DevNet, it contains a fix for the crash and some other additions that are missing from the official document.
  • ProcessIdToSessionId undeclared?

    6
    0 Votes
    6 Posts
    4k Views
    Q
    Oh that makes sense :S thanks man.
  • 0 Votes
    10 Posts
    4k Views
    R
    Alright, thanks for the help. I agree that writing the code out of context would have been the best route, but there really was no one place that I could single out to help demonstrate my issue without providing all of the code (which is why I didn't provide it originally). I did figure out how to get it to run for some reason the size() function in a for loop created issues but when I changed it to end at a value it ran. Sorry if I have offended anyone for the way I asked for help, just had no idea what could be causing the error.
  • [Solved] 'Distributing' area between two widgets, and resizing that area?

    3
    0 Votes
    3 Posts
    3k Views
    L
    Ah, that's the one! Thanks.
  • Validating an XML file with a schema file

    7
    0 Votes
    7 Posts
    6k Views
    AlicemirrorA
    @mlong: then, I agree with you. Excluding strange and rare cases, when a malformed xml error is retrieved it is sufficient for me to suppose that something is wrong in the data.
  • [Solved] Retrieving data of various types from file using QTextStream

    6
    0 Votes
    6 Posts
    4k Views
    M
    [quote author="Tobias Hunger" date="1316845290"]Why aren't you using QSettings to store your settings?[/quote] That's already been mentioned above. :-)
  • QTreeWidgetItemIterator craches.

    12
    0 Votes
    12 Posts
    5k Views
    P
    Here is a short example: http://dl.dropbox.com/u/26596688/testProject.tar.gz
  • Pick words from .txt

    11
    0 Votes
    11 Posts
    4k Views
    R
    bq. There are no stupid questions, only stupid answers. Go ahead :) Happy coding :)
  • [Solved] Program crashing when QTcpSocket receives data

    5
    0 Votes
    5 Posts
    3k Views
    F
    Thanks peppe, that line 50 was the cause of my problem. pMainWIn->activeWindow() is not really what I wanted to. Code is now fixed with QTcpSocket not subclassed and working fine :D I appreciate your help!
  • Develop demo application

    25
    0 Votes
    25 Posts
    12k Views
    F
    [quote author="Lukas Geyer" date="1316780193"] We are still talking about data related to the software protection here, not data in general, aren't we? [/quote] Not sure what you are talking about, since I guess your example is about data protection, not application protection. Anyway, this thread demonstrates again that it is difficult even to talk about this kind of software protection (I mean demo locks).