600+ Dialogs



  • Hey all,

    I was just wondering if there's a way to just make ONE dialog window that can be used over and over for different information?

    I have created a movie program where I can run my exe and have a list of all my movies. I have the option of playing the movie, or reading the plot to the movie. The plot is written on the dialog window.

    Thing is, I have over 600 movies... well, more, but only 600 so done on backup... Do I need to do 600 dialogs? Seems a bit nuts lol.... So, just curious if there was a way to use one dialog as a format, then just put the info from each movie in it?

    Thanks all... This is an awesome place for info. YAY forum.qt.io :)


  • Moderators

    @Epiales666 I don't really understand what you want to do. You can use same dialog class for all movies - just create one instance for each movie you want to play.



  • @Epiales666
    You design one dialog. Then you write code so as you want to show each movie you change properties in that dialog --- which movie it is showing, what its title is, etc. That's what the point of writing code is! :)



  • @jsulm said in 600+ Dialogs:

    @Epiales666 I don't really understand what you want to do. You can use same dialog class for all movies - just create one instance for each movie you want to play.

    Ended up with an eye infection, so been off last few days. Thanks for your reply. What I am wanting, or what I have right now.

    I created a program in designer that displays all my movies and titles. I just click play on the movie and it plays. Each movie also has a button to push that will display the plot to the movie and the authors, ect information.

    So was wondering if there was a way to write the code so I don't have to have 600+ diologs for EACH movie plot? It's for personal use only, so I can do 600+ dialogs, but was hopin there was a better way so it didn't use so much space. Right now I have like 200 dialogs, for 200 different movies lol. Thanks


  • Qt Champions 2016

    Hi
    Welcome back then :)
    Normally you would have a data file with information. ( like authors)
    you would then load this data into the app
    and use with 1 dialog to show info by replace the
    text in label etc.

    Its like a movie catalog program?



  • @Epiales666 said in 600+ Dialogs:

    So was wondering if there was a way to write the code so I don't have to have 600+ diologs for EACH movie plot? It's for personal use only, so I can do 600+ dialogs, but was hopin there was a better way so it didn't use so much space. Right now I have like 200 dialogs, for 200 different movies lol. Thanks

    Don't design a single dialog more till you get the hang of doing it programmatically :) 200 dialogs for 200 movies, just "wow".....


  • Qt Champions 2016

    @JNBarchan
    We have to give +1 for effort :)



  • @mrjj
    I did say "wow" :)

    I'm thinking that @Epiales666 is kind of designing the complete application by hard-coding one movie to each dialog in Qt Creator and more or less having no other code?


  • Qt Champions 2016

    @JNBarchan
    Yes i think he just use designer and draw them all :)



  • @mrjj @JNBarchan

    Yeah, it's all done in designer.... but I was thinking with all the information for each movie, it's either put it in one HUGE long file, that goes on forever, adding each information to the file, or having seperate dialogs... I didn't know which would be better, nor where to start with just one dialog usage lol... yeah, 200 dialogs hehe...

    I mean, it's going to be huge if placed in ONE file as well isn't it? So it's like picking the better of the two evils?



  • @mrjj @JNBarchan

    I"m not too well knowledged on C++, but I have done a lot of php/mysqli... I'm assuming I'd have to write an "IF" this button is click, put "THIS" information.... so each movie would be done like that, so one dialog could be used as the initial dialog. Then the if and elses I would 'assume'.... But doing it like that, would create one huge file with over 600 movie plots, and titles and such. And since I"m pretty new to all this, I didn't know which way to go.

    Since I've gotten into this, and done a few things with it, I'm starting to learn more and more. Been diving into some C++ tutorials and videos to learn a bit more too.

    But yeah, I had no idea where to start using just one initial dialog, or whether or not it would be okay to do it with all new dialogs per each movie, or just one. If it will be better to do it with one dialog box and then doing an if else type thing, let me know and I'll try and redo it lol. Thanks to the both of ya.



  • @Epiales666
    We're not sure what you have in mind, but putting the information per movie in something external and picking it up when needed is a "lesser evil" than putting it into separate dialogs.

    Perhaps you should explain a bit about your situation. Where are you getting this list of plots from? Are you typing in the plots yourself? Where do you get your list of movies from to tie with the plots? Just an outline.



  • @Epiales666
    If you've got 600 movies, 600 if-elses will not be the right approach :)

    At some level, you'll want to attach the plot info to the movie name, but not by pairing each one into its own dialog at design-time :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.