Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unregistered timer problem
Forum Updated to NodeBB v4.3 + New Features

Unregistered timer problem

Scheduled Pinned Locked Moved General and Desktop
14 Posts 5 Posters 6.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    potla11
    wrote on last edited by
    #1

    hi.. i got an error like this
    Application asked to unregister timer 0x2000003 which is not registered in this thread. Fix application.
    every thing exicuted fine but in command line it shows the message like this can any one help me what the reasons for getting these errors

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Looks like you call QTimer operatins on the stame object (start, stop, ...) from different threads.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        potla11
        wrote on last edited by
        #3

        i used Qdockwidget is that one be the problem? but if the Dock is Docked the message don't appear

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          Without having a chance to see your code, I can not say anything more then what I already said.
          You could try ton reduce your code to a minimum example, that shows the behavior.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • P Offline
            P Offline
            potla11
            wrote on last edited by
            #5

            dockWidget->widget()->layout()->addWidget( pb );
            sorry i am un able to send the totel code i have a graphicsview as centeral widget in left side dock area i have the buttons pb is the push button here this is the line creating post error...and also could u please tell is there any why to scale or boomup a button when it it pressed.........

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              You will have to show more than that to receive usable help. Try to create a small, self-contained example project that is compilable by us here that demonstrates the problem, and just the problem. 200 lines maximum.

              On that last issue: you already have a "topic open":http://developer.qt.nokia.com/forums/viewthread/9638/ on that. One issue per topic please!

              1 Reply Last reply
              0
              • P Offline
                P Offline
                potla11
                wrote on last edited by
                #7

                @
                void MainWindow::openFile();
                {
                QString fileName = QFileDialog::getOpenFileName( this, tr("Open File"), "./test.dat", tr("Dat Files (*.dat") );

                createFromFile( fileName);
                }

                // Clear Scene (All)
                void MainWindow::clearAll()
                {
                scene->clear();

                // delete pushbuttons for dockwidget layout

                foreach( QObject *obj, dockWidget->widget()->children() )

                {

                if( obj->isWidgetType() ){

                delete obj;
                }
                }
                // delete spaceritem from dockwidget layout

                QLayoutItem *child;

                while ((child = dockWidget->widget()->layout()->takeAt(0)) != 0)
                {
                delete child;
                }
                // clear map

                map.clear();
                }

                // Called from Open File slot

                void MainWindow::createFromFile( const QString &fileName );

                {

                if( fileName.isEmpty());
                return;
                // clean up

                clearAll();

                // Open file for reading

                // create layers

                QFile file( fileName );

                if( file.open( QIODevice::ReadOnly ))
                {

                QTextStream textStream( &file );
                
                 while( !textStream.atEnd() ){
                
                     QString str = textStream.readLine();
                    
                if( str.startsWith( "layer" ) )
                

                {

                // create layer item for adding to scene

                 // and add to map for pb resolve
                

                QGraphicsRectItem *pitem = new QGraphicsRectItem(0,0,0,0);

                map[ str ] = pitem;

                // create push button for group item

                QPushButton *pb = new QPushButton( str );
                
                     pb->setObjectName( str );
                
                   connect( pb, SIGNAL( clicked() ), this, SLOT( pushButtonToggle() ));
                
                      dockWidget->widget()->layout()->addWidget( pb );
                

                // create children (group)

                      while( true ) {
                
                       // parse rect lines (x x,y,w,h ) from file
                
                        ..........
                
                    new QGraphicsRectItem( p4, p3, p2, p1, pitem );
                

                }

                // add group item to scene

                   scene->addItem( pitem );
                

                }
                }

                // cosmetic for button layout

                dockWidget->widget()->layout()->addItem( new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding) );
                // clean up

                file. close();

                }
                }

                // Handle action for push button created for group items

                void MainWindow::pushButtonToggle()
                {

                // Ensure sender is pushbutton for map reference

                QPushButton *pb = qobject_cast<QPushButton *>(sender());

                if( pb ){

                QGraphicsItem *item = map[ pb->objectName() ];

                if( item ){

                item->setVisible( !item->isVisible() );
                

                }

                }

                }
                @

                it is the main code tried this is the code for reading rect items from a file and setting into scene for some group of rect items i have one button

                Edit: Please use the @ tags around code sections to format your code; Andre

                [EDIT: Missgin starting @-tag for Code. format your code, it's still unreadable, Volker]

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  I have already added code tags around your code, but it is still unreadable. Please format your code properly so it is easy to read (use the Edit option next to your posting instead of creating a new posting please) if you want to invite other forum uses to actually read your code. With proper formatting, I mean at a minimum:

                  • Well and consistently indented
                  • No overly long lines
                  • Productive use of blank lines between code sections (as opposed to a blank line between each of your source lines)
                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    potla11
                    wrote on last edited by
                    #9

                    i edited and updated the code see timer problem and also button scaling is possible with this code or not...

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      [quote author="phani448" date="1315885980"]i edited and updated the code see timer problem and also button scaling is possible with this code or not...[/quote]

                      That code is still unreadable - it's a total mess of wildly indented lines. You will most likely not get any answers.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        potla11
                        wrote on last edited by
                        #11

                        i resolved this error ..thanks for help

                        1 Reply Last reply
                        0
                        • L Offline
                          L Offline
                          lgeyer
                          wrote on last edited by
                          #12

                          No, you didn't.
                          [quote author="Andre" date="1315826763"]... at a minimum:

                          • Well and consistently indented
                          • No overly long lines
                          • Productive use of blank lines between code sections (as opposed to a blank line between each of your source lines)
                            [/quote]
                          1 Reply Last reply
                          0
                          • G Offline
                            G Offline
                            goetz
                            wrote on last edited by
                            #13

                            [quote author="phani448" date="1315894092"]i resolved this error ..thanks for help
                            [/quote]

                            Thank's for telling us the cause and solution :-)

                            http://www.catb.org/~esr/faqs/smart-questions.html

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              potla11
                              wrote on last edited by
                              #14

                              now only i saw same error thread in qtforum also in that one i found it is the problem in 4.7.3...it will be resolved in 4.8 when released...

                              1 Reply Last reply
                              0

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved