Coder Social home page Coder Social logo

Comments (3)

ntadej avatar ntadej commented on September 6, 2024 1

So, the first argument is a name for variable to use in the loop and the second is a list. So it can be rewritten as

QList<QSlider*> list = findChildren<QSlider*>();
for (int i = 0; i <  list.size(); i++) {
  list[i]
}

from examples.

ntadej avatar ntadej commented on September 6, 2024

This is c++11 standard. Qt 5.7 and later will require it by default. I think Visual Studio 2012 may be required.

Or, you can always rewrite the loop in older syntax.

from examples.

joehellesen avatar joehellesen commented on September 6, 2024

Tadej,

Thank you for pointing this out. It looks like I need to learn more about C++11. In the mean time I am stuck with the Visual Studio 2010 compiler. Could you tell me what that line would look like using the older syntax like for(x=0; x <MAX; x++)

The statement below is more complex than my simple example above.

for (QSlider *slider : findChildren<QSlider*>()) {

Your response will help me understand how the newer range based loops work.

Thank You,

Joe Hellesen

From: Tadej Novak [mailto:[email protected]]
Sent: Monday, May 9, 2016 1:10 AM
To: vlc-qt/examples [email protected]
Cc: joehellesen [email protected]; Author [email protected]
Subject: Re: [vlc-qt/examples] Cannot compile vlc-qt example - syntax error (#4)

This is c++11 standard. Qt 5.7 and later will require it by default. I think Visual Studio 2012 may be required.

Or, you can always rewrite the loop in older syntax.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #4 (comment) https://github.com/notifications/beacon/ASXOkpEz_QInVSVWSaS-qpACZhp1zXbCks5p_s_DgaJpZM4IZvSp.gif

from examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.